ipv6: Handle IPv4-mapped src to in6addr_any dst.
authorJonathan T. Leighton <jtleight@udel.edu>
Wed, 24 May 2017 01:53:33 +0000 (21:53 -0400)
committerRaspbian kernel package updater <root@raspbian.org>
Sun, 23 Jul 2017 02:57:19 +0000 (02:57 +0000)
commit85a0f1b2a8ec3600e57f92660072be044d2bf8eb
tree5e77c14afbc7db847d6e8effba91d6134db62e66
parent9efe16e46f1e9c45212adff296259d969e6d142e
ipv6: Handle IPv4-mapped src to in6addr_any dst.

[ Upstream commit 052d2369d1b479cdbbe020fdd6d057d3c342db74 ]

This patch adds a check on the type of the source address for the case
where the destination address is in6addr_any. If the source is an
IPv4-mapped IPv6 source address, the destination is changed to
::ffff:127.0.0.1, and otherwise the destination is changed to ::1. This
is done in three locations to handle UDP calls to either connect() or
sendmsg() and TCP calls to connect(). Note that udpv6_sendmsg() delays
handling an in6addr_any destination until very late, so the patch only
needs to handle the case where the source is an IPv4-mapped IPv6
address.

Signed-off-by: Jonathan T. Leighton <jtleight@udel.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv6/datagram.c
net/ipv6/tcp_ipv6.c
net/ipv6/udp.c