buglwIP - A Lightweight TCP/IP stack - Bugs: bug #28651, tcp_connect: no callbacks called...

 
 

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

bug #28651: tcp_connect: no callbacks called if tcp_enqueue fails

Submitter:  Simon Goldschmidt <goldsimon>
Submitted:  Sun 17 Jan 2010 06:13:51 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned Release:  None
lwIP version:  CVS Head

Thu 21 Jan 2010 06:45:34 PM UTC, comment #3: 

Fixed by moving state change and list-registration down and only execute it if tcp_enqueue succeeds.

Simon Goldschmidt <goldsimon>
Group administrator
Tue 19 Jan 2010 06:45:28 PM UTC, comment #2: 

I think to fix this, the pcb should stay on the 'bound' list until tcp_write() returned ERR_OK (since no segment is created otherwise) - meaning if tcp_connect returns != ERR_OK, the pcb is still on the 'bound' list, not the 'active' list.

Then, api_msg.c:do_connect should signal op_completed if tcp_connect returns != ERR_OK.

Simon Goldschmidt <goldsimon>
Group administrator
Tue 19 Jan 2010 05:55:05 AM UTC, comment #1: 

Turns out that the problem is in tcp_connect (updated summary): If tcp_enqueue fails for some reason, the pcb is on the list of active pcbs but may not have unsent data. This leads to neither the 'connected' nor the 'err' callback of that pcb being called by tcp_tmr.

Simon Goldschmidt <goldsimon>
Group administrator
Sun 17 Jan 2010 06:13:51 PM UTC, original submission:  

In do_connect(), when tcp_connect() fails, do_connected() will never be called and thus op_completed is never signalled.

Proposed solution: check return value of tcp_connect() and directly signal op_completed if != ERR_OK.

Simon Goldschmidt <goldsimon>
Group administrator

 

(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 (Submitted the item)
  •  

    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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-01-23 goldsimon Open/ClosedOpen Closed
    2010-01-21 goldsimon StatusNone Fixed
    2010-01-19 goldsimon Assigned toNone goldsimon
    2010-01-19 goldsimon Summarynetconn/socket: connect may block forever tcp_connect: no callbacks called if tcp_enqueue fails

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code