buglwIP - A Lightweight TCP/IP stack - Bugs: bug #37958, netconn API doesn't handle...

 
 

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

bug #37958: netconn API doesn't handle correctly connections half-closed by peer

Submitted by:  Valery Ushakov <uwe>
Submitted on:  Wed 19 Dec 2012 03:26:21 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

Wed 18 Feb 2015 09:23:11 PM UTC, comment #1:

Fixed, thanks for reporting.

I've chosen to call 'netconn_close_shutdown(conn, NETCONN_SHUT_RD)' instead of your suggested 'sys_mbox_free/sys_mbox_set_invalid' as that seemed to introduce less change of behaviour.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Wed 19 Dec 2012 03:26:21 PM UTC, original submission:

Half-open connections that were half-closed by peer are stuck with netconn::last_err = ERR_CLSD, which prevents further writes over them. Cf. netconn_recv_data:

As a quick kludge I changed that to

which, from a quick look, should be thread-safe, since recv_tcp() won't send anything after sending NULL pbuf to indicate that peer has performed close.

And changed LWIP_ERROR checks for sys_mbox_valid(&conn->recvmbox) in netconn_recv() and netconn_recv_data() with explicit

which seems to work, but I haven't investigated/tested this thoroughly.

Valery Ushakov <uwe>

 

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 (Posted a comment)
  • -unavailable- added by uwe (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 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 18 Feb 2015 09:23:11 PM UTCgoldsimonOpen/ClosedOpen=>Closed
    Wed 18 Feb 2015 09:23:10 PM UTCgoldsimonStatusNone=>Fixed
      Assigned toNone=>goldsimon

    Back to the top


    Powered by Savane 3.1-cleanup1