netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* follow-up: discrepancy with POSIX
@ 2007-09-19 15:21 Ulrich Drepper
  2007-09-19 15:47 ` Andi Kleen
  2007-09-19 16:15 ` David Miller
  0 siblings, 2 replies; 17+ messages in thread
From: Ulrich Drepper @ 2007-09-19 15:21 UTC (permalink / raw)
  To: netdev, Linux Kernel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

As a follow up to my question from yesterday on the netdev list what I
think is a real problem.  Either in the kernel or in the POSIX spec.

The POSIX spec currently says this about SOCK_DGRAM sockets:

  If  address is a null address for the protocol, the socket’s peer
  address shall be reset.

The term "null address" is not further specified but it will usually be
read to allow the following scenario to work out:

   fd = socket(AT_INET6, ...)

   connect(fd, ...some IPv6 address...)

   struct sockaddr_in6 sin6 = { .sin6_family = AF_INET6 };
   connect(fd, &sin6, sizeof (sin6));

   connect(fd, ...some new IPv6 address...)

This does not work on Linux in the moment.  The socket remains connected
to the old IPv6 address but the second connect() call does succeed (this
does not sound OK).  What does work is if the connect call to
disassociate the address uses AF_UNSPEC instead of AF_INET6.


The question is: do people here think this is a problem in the POSIX
spec?  Binding to :: and 0.0.0.0 isn't possible, so maybe the Linux
implementation should allow this?

If you think the POSIX spec is wrong (and can point to other
implementations doing the same as Linux) let me know and I'll work on
getting the spec changed.

- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFG8T6L2ijCOnn/RHQRAnSRAJ9sXDGG9OepEQWQInaPgwxCWlaH6wCghqim
ULttg5/lU8c1rSpBnoRCjB8=
=nGVv
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2007-09-19 20:33 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-19 15:21 follow-up: discrepancy with POSIX Ulrich Drepper
2007-09-19 15:47 ` Andi Kleen
2007-09-19 16:49   ` Ulrich Drepper
2007-09-19 16:52     ` David Miller
2007-09-19 17:04       ` Ulrich Drepper
2007-09-19 17:27         ` Ulrich Drepper
2007-09-19 17:26     ` Andi Kleen
2007-09-19 17:46       ` Ulrich Drepper
2007-09-19 17:57         ` Andi Kleen
2007-09-19 18:02           ` Ulrich Drepper
2007-09-19 18:30             ` Andi Kleen
2007-09-19 18:38               ` Rick Jones
2007-09-19 19:40                 ` Andi Kleen
2007-09-19 20:33                 ` Valdis.Kletnieks
2007-09-19 18:06         ` Alan Cox
2007-09-19 16:15 ` David Miller
2007-09-19 16:39   ` Alan Cox

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).