lwIP - A Lightweight TCP/IP stack - Bugs: bug #3168, Handling UDP/TCP PCBs upon netif...
You are not allowed to post comments on this tracker with your current authentication level.
bug #3168: Handling UDP/TCP PCBs upon netif address change.
Submitter: | Leon Woestenberg <likewise> | ||
Submitted: | Wed 09 Apr 2003 03:21:01 PM UTC | ||
Category: | TCP | Severity: | 3,5 |
Item Group: | Faulty Behaviour | Status: | Fixed |
Privacy: | Public | Assigned to: | goldsimon |
Open/Closed: | Closed | Planned Release: | None |
lwIP version: | None |
Jump to the original submission
Mon 21 May 2007 05:04:23 PM UTC, comment #19: |
Simon Goldschmidt <goldsimon> |
Wed 16 May 2007 06:53:49 PM UTC, comment #18: OK, I've checked in file #12764.
|
Simon Goldschmidt <goldsimon> |
Mon 14 May 2007 08:48:23 PM UTC, comment #17: Funny. Maybe someone was too concerned about this, after all...
|
Simon Goldschmidt <goldsimon> |
Mon 14 May 2007 07:48:09 PM UTC, comment #16: Re TCP: the same. Only the bind() would fail. |
Jonathan Larmour <jifl> |
Mon 14 May 2007 05:37:10 PM UTC, comment #15:
|
Simon Goldschmidt <goldsimon> |
Mon 14 May 2007 02:31:45 PM UTC, comment #14: After trying on Linux, even when the locally bound address goes away, recv() will remain blocked and not report an error. Even if I do a non-blocking recv(), still no error is returned, and netstat shows the listening socket remains bound to the (now gone) address.
|
Jonathan Larmour <jifl> |
Sun 13 May 2007 03:05:55 PM UTC, comment #13:
|
Simon Goldschmidt <goldsimon> |
Sun 13 May 2007 02:48:01 PM UTC, comment #12:
|
Simon Goldschmidt <goldsimon> |
Fri 27 Apr 2007 11:55:53 AM UTC, comment #11: Systems are allowed to generate additional error codes beyond what the standard lists for each function (as per http://www.opengroup.org/onlinepubs/007908799/xsh/errors.html).
|
Jonathan Larmour <jifl> |
Fri 27 Apr 2007 11:32:04 AM UTC, comment #10:
|
Simon Goldschmidt <goldsimon> |
Thu 26 Apr 2007 08:23:43 PM UTC, comment #9: Re comment 8, I think we should follow what other stacks do. From memory, with them, if they are unbound, i.e. local IP of 0.0.0.0, then they determine the local IP only at the point of transmission, based on routing. Otherwise if they are bound to a specific local IP addr, they get an error. From experimentation on Linux, trying it out with a UDP socket, send() gets EINVAL if the local IP address that had been bound gets changed.
|
Jonathan Larmour <jifl> |
Thu 26 Apr 2007 07:42:15 PM UTC, comment #8: Hm, thinking some more about this: can't we simply set the local_ip address of the UDP pcbs to the new address? I mean, maybe they are 'connected' somehow, but since UDP is a connectionless protocol, just setting the new address should be enough.
|
Simon Goldschmidt <goldsimon> |
Thu 19 Apr 2007 11:23:30 AM UTC, comment #7: Since for TCP pcbs, a call to pcb->recv() with a pbuf p=NULL means the connection is closed, I propose to do it that way for UDP pcbs on netif address change.
|
Simon Goldschmidt <goldsimon> |
Thu 05 Apr 2007 08:47:25 AM UTC, comment #6: The new error callback might have further uses, but I'd be happy with a change to the receive callback to indicate connection closed as well. If we try and keep the UDP semantics as similar to the TCP semantics as possible I think that would be good. |
Kieran Mansley <kieranm> |
Wed 04 Apr 2007 07:28:01 PM UTC, comment #5: I thought about it: another (simpler) solution would be to add an additional parameter to the receive callback to tell it the connection has closed. Or we define calling it with p = 0 means 'closed' or something.
|
Simon Goldschmidt <goldsimon> |
Tue 06 Mar 2007 12:05:42 PM UTC, comment #4: Yes, at first glance it looks like we need to implement an error callback in the udp_pcb similar to the tcp one. At the moment only receive callbacks are supported on UDP.
|
Kieran Mansley <kieranm> |
Tue 06 Mar 2007 11:55:52 AM UTC, comment #3: Searching through the code, I found out that calling pcb->recv with pbuf argument = 0 is not a good idea, since at least recv_udp() in api_msg.c directly dereferences the p pointer without a check.
|
Simon Goldschmidt <goldsimon> |
Tue 06 Mar 2007 10:23:57 AM UTC, comment #2: OK, I think we have to do something with all connections listed in 'udp_pcbs' (defined in udp.c) that are connected (e.g. have a remote port or remote ip set).
|
Simon Goldschmidt <goldsimon> |
Mon 26 Feb 2007 03:06:17 PM UTC, comment #1: Sounds like only UDP remains to be fixed. Should be straightforward. Any volunteers? |
Kieran Mansley <kieranm> |
Wed 09 Apr 2003 03:21:01 PM UTC, original submission:
Stale PCBs hang around upon netif address day.
|
Leon Woestenberg <likewise> |
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 6 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2007-05-21 | goldsimon | Status | In Progress | Fixed | |
Open/Closed | Open | Closed | |||
2007-05-13 | goldsimon | Attached File | - | Added udp_check_local_ip_on_send.patch, #12764 | |
2007-04-19 | goldsimon | Status | None | In Progress | |
2007-04-19 | goldsimon | Attached File | - | Added netif_handle_udp.patch, #12527 | |
2007-03-06 | kieranm | Assigned to | likewise | goldsimon |
Powered by Savane 3.13-d3ae.
Corresponding source code
OK, since noone seems to care, I'm closing this now!
A little summary:
While (at least) linux does not inform a socket that its local address has changed (if != INADDR_ANY), we do for TCP sockets, but not for UDP sockets. Personally, I think this is OK as long as we document it (where???).