udp6: Use Segment Routing Header for dest address if present
authorAndrew Lunn <andrew@lunn.ch>
Mon, 3 Jan 2022 17:11:32 +0000 (18:11 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:05:05 +0000 (11:05 +0100)
commit591a1e2ef0f11cb37fb8ebb6479885229425e784
tree03f35490a4c9720765c5f72cb72c1a22ce9d05c2
parentaf58dbc08ea3e736a47394da75d9c849a18e606c
udp6: Use Segment Routing Header for dest address if present

[ Upstream commit 222a011efc839ca1f51bf89fe7a2b3705fa55ccd ]

When finding the socket to report an error on, if the invoking packet
is using Segment Routing, the IPv6 destination address is that of an
intermediate router, not the end destination. Extract the ultimate
destination address from the segment address.

This change allows traceroute to function in the presence of Segment
Routing.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: David Ahern <dsahern@kernel.org>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/net/seg6.h
net/ipv6/udp.c