From: David Miller <davem@davemloft.net>
To: akpm@osdl.org
Cc: netdev@vger.kernel.org, yujiang.wang@sun.com,
bugme-daemon@bugzilla.kernel.org
Subject: Re: [Bugme-new] [Bug 6646] New: UDP socket doesn't return to bound state after association is dissolved by connect(..AF_UNSPEC)
Date: Sat, 10 Jun 2006 18:10:26 -0700 (PDT) [thread overview]
Message-ID: <20060610.181026.21594839.davem@davemloft.net> (raw)
In-Reply-To: <20060605000751.f3bc7ed3.akpm@osdl.org>
From: Andrew Morton <akpm@osdl.org>
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.
prev parent reply other threads:[~2006-06-11 1:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200606050658.k556wJ8X032608@fire-2.osdl.org>
2006-06-05 7:07 ` [Bugme-new] [Bug 6646] New: UDP socket doesn't return to bound state after association is dissolved by connect(..AF_UNSPEC) Andrew Morton
2006-06-11 1:10 ` David Miller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060610.181026.21594839.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=akpm@osdl.org \
--cc=bugme-daemon@bugzilla.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=yujiang.wang@sun.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).