]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net: setsockopt: fix IPV6_UNICAST_IF option for connected sockets
authorRichard Gobert <richardbgobert@gmail.com>
Thu, 8 Dec 2022 14:54:46 +0000 (15:54 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:27 +0000 (13:32 +0100)
commit22dbe4a6ea37449738b06e276381c1af1790cd8f
tree48f1cfa11bf1dfa8c99d5204f233aa816d97020d
parent7cc54e9ffcf5ffbf7a80cc30211848ae9911776c
net: setsockopt: fix IPV6_UNICAST_IF option for connected sockets

[ Upstream commit 526682b458b1b56d2e0db027df535cb5cdcfde59 ]

Change the behaviour of ip6_datagram_connect to consider the interface
set by the IPV6_UNICAST_IF socket option, similarly to udpv6_sendmsg.

This change is the IPv6 counterpart of the fix for IP_UNICAST_IF.
The tests introduced by that patch showed that the incorrect
behavior is present in IPv6 as well.
This patch fixes the broken test.

Reported-by: kernel test robot <oliver.sang@intel.com>
Link: https://lore.kernel.org/r/202210062117.c7eef1a3-oliver.sang@intel.com
Fixes: 0e4d354762ce ("net-next: Fix IP_UNICAST_IF option behavior for connected sockets")
Signed-off-by: Richard Gobert <richardbgobert@gmail.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ipv6/datagram.c