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

Submitted by:  Kai Raschick <raschick>
Submitted on:  Wed 07 Aug 2013 11:35:43 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: Faulty BehaviourStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: 1.3.2

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

Fixed, thanks.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>

 

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

    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
    Thu 20 Feb 2014 09:33:19 PM UTCgoldsimonStatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1