buglwIP - A Lightweight TCP/IP stack - Bugs: bug #31590, getsockopt(... SO_ERROR ...) gives...

 
 

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

bug #31590: getsockopt(... SO_ERROR ...) gives EINPROGRESS after a successful nonblocking connection.

Submitted by:  Ken MacKay <kmackay>
Submitted on:  Tue 09 Nov 2010 12:10:10 AM UTC  
 
Category: TCPSeverity: 3 - Normal
Item Group: Faulty BehaviourStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: CVS Head

Mon 22 Nov 2010 08:57:02 PM UTC, comment #2:

Fixed by letting getsockopt overwriting 0 and temporary errors in sock->err (currently, only EINPROGRESS is temporary, all other errors are generated by the application calling socket functions).

Thanks for reporting!

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Mon 22 Nov 2010 08:22:54 PM UTC, comment #1:

The problem is that our SO_ERROR implementation always first returns an old socket error and only returns the underlying netconn error on the second call. In your case, that means the second return value is the correct one. I'll fix that.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Tue 09 Nov 2010 12:10:10 AM UTC, original submission:

If I create a new TCP socket and set it to be nonblocking, then call connect(), it returns -1 with errno set to EINPROGRESS as expected. I then call select() with the socket in the write set to determine when the connection has succeeded. This also works as expected. Now I need to determine if the socket is actually connected, or errored out. I use getsockopt(socket, SOL_SOCKET, SO_ERROR, ...) to get the socket error code if any.

On other platforms (Windows, OSX, Linux), if the connection has been successful then the socket error code is 0. However, when using lwIP, the socket error code is EINPROGRESS even after a successful connection has been made.

Ken MacKay <kmackay>

 

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 kmackay (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
    Mon 22 Nov 2010 08:57:02 PM UTCgoldsimonStatusIn Progress=>Fixed
      Open/ClosedOpen=>Closed
    Mon 22 Nov 2010 08:22:54 PM UTCgoldsimonStatusNone=>In Progress
      Assigned toNone=>goldsimon

    Back to the top


    Powered by Savane 3.1-cleanup1