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.

Submitter:  Ken MacKay <kmackay>
Submitted:  Tue 09 Nov 2010 12:10:10 AM UTC
   
 
Category:  TCP Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned 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>
Group administrator
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>
Group administrator
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>

 

(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 (Posted a comment)
  • -email is unavailable- added by kmackay (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-11-22 goldsimon StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2010-11-22 goldsimon StatusNone In Progress
        Assigned toNone goldsimon

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code