buglwIP - A Lightweight TCP/IP stack - Bugs: bug #52471, Change in netconn_recv_data_tcp...

 
 

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

bug #52471: Change in netconn_recv_data_tcp causing recv regression

Submitted by:  Joel Cunningham <jcunningham>
Submitted on:  Mon 20 Nov 2017 07:45:09 PM UTC  
 
Category:  sockets/netconn Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Fixed
Privacy:  Public Assigned to:  Simon Goldschmidt <goldsimon>
Open/Closed:  Closed Planned Release:  2.1.0
lwIP version:  git head

( Jump to the original submission)

Mon 05 Feb 2018 08:03:31 PM UTC, comment #10: 

Committed in 030ffdee82e915065ac1ceb949d443fd15626fe9

Joel Cunningham <jcunningham>
Project Member
Mon 05 Feb 2018 07:59:58 PM UTC, comment #9: 

Looks good, please push :-)

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Mon 05 Feb 2018 07:57:15 PM UTC, comment #8: 

Simon,

I took a look at the changes and they look correct to me.  I did spot some dead code which I believe can be removed.  Please see attached patch.

(file #43180)

Joel Cunningham <jcunningham>
Project Member
Sun 04 Feb 2018 07:21:13 PM UTC, comment #7: 

Should be correctly fixed now.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Tue 30 Jan 2018 10:23:47 AM UTC, comment #6: 

The original commit was "socket/netconn recv: FIN should only be reported once (as '0' for sockets, as 'ERR_CLSD' for netconns)" (db3a4e31586f8614b0a27b482406b0c212a4e08a)

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Tue 21 Nov 2017 07:25:07 PM UTC, comment #5: 

I'll reopen this to keep it as a reminder this has to be fixed.
Also the unit test needs to be re-enabeld.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Mon 20 Nov 2017 08:36:40 PM UTC, comment #4: 

Yes. Thanks.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Mon 20 Nov 2017 08:22:19 PM UTC, comment #3: 

I also had to disable the unit tests that checked for an error after receiving remote closure (0) from recv()

Joel Cunningham <jcunningham>
Project Member
Mon 20 Nov 2017 07:56:36 PM UTC, comment #2: 

Reverted in ebcae98ae65c26a0c210c802540bf027d07fe2f1

Joel Cunningham <jcunningham>
Project Member
Mon 20 Nov 2017 07:47:14 PM UTC, comment #1: 

Ooops! Could you please just revert that commit? I don't have access to git right now. I'll rework that patch later then.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Mon 20 Nov 2017 07:45:09 PM UTC, original submission:  

Found this after pulling up to include db3a4e31586f8614b0a27b482406b0c212a4e08a, but recv no longer returns 0 during a remote closure, instead it returns ENOTCONN.

I did a little debugging and what's happening is that in my application, it reads the last pbuf from recvmbox, but calls netconn_recv_data_tcp() (from lwip_recv_tcp) again since there is more buffer space. This processes the close message, deallocates the recvmbox (via netconn_close_shutdown) and returns ERR_CLSD back to lwip_recv_tcp, but since we did successfully read data during this call, the 0 return is lost.  Then during the next call to recv(), we hit the case modified in db3a4e3 and now return ERR_CONN

Joel Cunningham <jcunningham>
Project Member

 

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

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

    Only logged-in users can vote.

     

     

     

    Follow 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-02-05 jcunningham Attached File- => Added 0001-sockets-remove-ERR_CLSD-case-after-data-receive.patch, #43180
    2018-02-04 goldsimon StatusNone => Fixed
        Open/ClosedOpen => Closed
    2018-01-30 goldsimon StatusFixed => None
    2017-11-21 goldsimon Assigned tojcunningham => goldsimon
        Open/ClosedClosed => Open
        Planned ReleaseNone => 2.1.0
    2017-11-20 jcunningham StatusNone => Fixed
        Assigned toNone => jcunningham
        Open/ClosedOpen => Closed

    Back to the top


    Powered by Savane 3.5