]> git.baikalelectronics.ru Git - kernel.git/commit
ipv6: check for IPv4 mapped addresses when connecting IPv6 sockets
authorMax Matveev <makc@redhat.com>
Fri, 5 Aug 2011 10:56:30 +0000 (03:56 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 5 Aug 2011 10:56:30 +0000 (03:56 -0700)
commitbe5375bb2ff2ae79ad96a212eee52162374adaa5
treebb0e318d09366001552d13efbbe128564956adde
parentf1be04d839959bb682a651eecba35ff0ca64ea78
ipv6: check for IPv4 mapped addresses when connecting IPv6 sockets

When support for binding to 'mapped INADDR_ANY (::ffff.0.0.0.0)' was added
in 5d800c11299a67405192a34e7a46e67d3808fb41 the rest of the code
wasn't told so now it's possible to bind IPv6 datagram socket to
::ffff.0.0.0.0, connect it to another IPv4 address and it will all
work except for getsockhame() which does not return the local address
as expected.

To give getsockname() something to work with check for 'mapped INADDR_ANY'
when connecting and update the in-core source addresses appropriately.

Signed-off-by: Max Matveev <makc@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/datagram.c