From: Andrew Morton <[EMAIL PROTECTED]> Date: Mon, 5 Jun 2006 00:07:51 -0700
> > When disconnect a UDP socket, Linux kernel set local port to zero if the > > port > > number comes from a implicit bind. Linux connect(2) man page reads: > > "Generally, connection-based protocol sockets may successfully *connect* > > only > > once; connectionless protocol sockets may use *connect* multiple times to > > change > > their association. Connectionless sockets may dissolve the association by > > connecting to an address with the /sa_family/ member of *sockaddr* set to > > *AF_UNSPEC*." > > But dissolve the association should not impact the local binding, while > > currently it does. In contrast, Unix variants like Solaris don't alter local > > binding when disconnecting a UDP socket. You can only preserve the parts of a local binding which are explicitly specified. Since you make an explicit bind to a source address, that will be preserved by the disconnect. However, since you use a zero anonymous port during the bind, the one choosen by the kernel will not be preserved. If you had choosen an explicit port during bind() it would be preserved by the disconnect. This behavior is intentional and will not change. - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html