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

Submitted by:  Simon Goldschmidt <goldsimon>
Submitted on:  Sun 17 Jan 2010 06:13:51 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: Faulty BehaviourStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned 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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by goldsimon (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 23 Jan 2010 03:02:41 PM UTCgoldsimonOpen/ClosedOpen=>Closed
    Thu 21 Jan 2010 06:45:34 PM UTCgoldsimonStatusNone=>Fixed
    Tue 19 Jan 2010 06:45:28 PM UTCgoldsimonAssigned toNone=>goldsimon
    Tue 19 Jan 2010 05:55:05 AM UTCgoldsimonSummarynetconn/socket: connect may block forever=>tcp_connect: no callbacks called if tcp_enqueue fails

    Back to the top


    Powered by Savane 3.1-cleanup1