buglwIP - A Lightweight TCP/IP stack - Bugs: bug #39718, disconnecting an UDP socket...

 
 

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

bug #39718: disconnecting an UDP socket reports an error

Submitter:  Kai Raschick <raschick>
Submitted:  Wed 07 Aug 2013 11:35:43 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned Release:  None
lwIP version:  1.3.2

Thu 20 Feb 2014 09:33:19 PM UTC, comment #3: 

Fixed, thanks.

Simon Goldschmidt <goldsimon>
Group administrator
Tue 11 Feb 2014 10:59:13 AM UTC, comment #2: 

it can be found in the 2013 version of the posix standard:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/connect.html

"For SOCK_DGRAM sockets, the peer address identifies where all datagrams are sent on subsequent send() functions, and limits the remote sender for subsequent recv() functions. If the sa_family member of address is AF_UNSPEC, the socket's peer address shall be reset"

This is allready implemented in the function lwip_connect:
if (name_in->sin_family == AF_UNSPEC) {
    LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_connect(%d, AF_UNSPEC)\n", s));
    err = netconn_disconnect(sock->conn);
  }

The problem is, that a few lines above, an error is returned if name->sa_family is not eaqual to AF_INET. So the netconn_disconnect function will never be called.

Kai Raschick <raschick>
Fri 10 Jan 2014 08:10:07 PM UTC, comment #1: 

So connect(AF_UNSPEC) should behave like disconnect()? I can't find the standard stating this, could you help me there? Or is this some platform-specific behaviour?

Simon Goldschmidt <goldsimon>
Group administrator
Wed 07 Aug 2013 11:35:43 AM UTC, original submission:  

disconnecting a connected UDP socket by calling connect() with parameter name->sin_family = AF_UNSPEC allways reports an EIO error (illegal argument).

in function lwip_connect, if parameter name->sin_family = AF_UNSPEC, netconn_disconnect() should be called, but before that, the parameter is checked and an error is returned if name->sin_family is not equal to AF_INET.

Kai Raschick <raschick>

 

(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 raschick (Posted a comment)
  • -email is unavailable- added by goldsimon (Posted a comment)
  •  

    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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-02-20 goldsimon StatusNone Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code