buglwIP - A Lightweight TCP/IP stack - Bugs: bug #49861, listen on a REUSEADDR socket...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #49861: listen on a REUSEADDR socket return ENOMEM while address in used

Submitter:  Wen Xichang <wenxichang>
Submitted:  Fri 16 Dec 2016 09:10:05 AM UTC
   
 
Category:  TCP Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned Release:  2.0.1
lwIP version:  2.0.0

Sat 31 Dec 2016 02:37:20 PM UTC, comment #3: 

Fixed (added function tcp_listen_with_backlog_and_err() to get the error reason when listening fails).

Thanks for reporting.

Simon Goldschmidt <goldsimon>
Group administrator
Wed 21 Dec 2016 02:45:40 PM UTC, comment #2: 

To fix this nicely, there is no way but to change the return value of tcp_listen(). To stay backwards compatible, a new function needs to be introduced, something like this:


err_t tcp_listen2(struct tcp_pcb *pcb, u8_t backlog, struct tcp_pcb **pcb_out);


Anyone have an idea for a better name of this new funtion?

Simon Goldschmidt <goldsimon>
Group administrator
Fri 16 Dec 2016 02:44:59 PM UTC, comment #1: 

Correct. Although this is unfortunately not straightforward to fix...

Simon Goldschmidt <goldsimon>
Group administrator
Fri 16 Dec 2016 09:10:05 AM UTC, original submission:  

function tcp_listen_with_backlog return NULL in the follow condition:
1. address/port is already used
2. memory alloc failed

the caller give the same ERR_MEM error, that's not correct as expected.

Wen Xichang <wenxichang>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by wenxichang (Submitted the item)
  • -email is unavailable- added by wenxichang
  •  

    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
    2016-12-31 goldsimon StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2016-12-16 goldsimon StatusNone In Progress
        Assigned toNone goldsimon
        Planned ReleaseNone 2.0.1
    2016-12-16 wenxichang Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code