lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] ICMP port unreachable when using netconn UDP


From: Ben Bobbitt
Subject: Re: [lwip-users] ICMP port unreachable when using netconn UDP
Date: Mon, 18 Feb 2008 08:22:37 -0600
User-agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)

The connect was being called prior to a transmit, which was working ok. As I mentioned in a follow up email, the problem with receive was that I was passing IP_ADDR_ANY to the bind() call, which, according to a document that I was referrring to, should have been ok. Once I changed that to use the real IP addr, it started receiving ok. The next problem was running out of netbufs, which seems to require that I call netbuf_delete() on the netbuf returned from the receive call, which seems wrong, since I didn't allocate that buffer. However, I could only receive N packets, where N was the lwipopts.h config param for memp_netbufs ( I don't have the code in from of me right now, so that may not be the exact parameter). Calling netbuf_delete() after using the received data fixed that problem. Thanks for your help.


All I have done is to make the UDP related changes to the lwipopts.h file, and then in the module that was previously a webserver example: pxHTTPListener = netconn_new( NETCONN_UDP );

addr.addr = htonl(0xc0a80002);  // my local ip 192.168.0.2

netconn_bind(pxHTTPListener, &addr, webHttpPort );

addr.addr = htonl(0xc0a80065);  // ip of the remote system

netconn_connect(pxHTTPListener,&addr,webHttpPort);


You shouldn't need to do a connect if you receive. But if you do it should precisely match the remote end's IP/port. I doubt that your remote system 192.168.0.65 is sending _from_ webHttpPort, and is probably using a random high port number.

So just don't do the connect.

Jifl






reply via email to

[Prev in Thread] Current Thread [Next in Thread]