seg6: export get_srh() for ICMP handling
authorAndrew Lunn <andrew@lunn.ch>
Mon, 3 Jan 2022 17:11:30 +0000 (18:11 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:05:05 +0000 (11:05 +0100)
commit85b3b307471ef1f9fa093ada115a67373952b6ac
treea7f954d273ed295ac43c07f2aee70ab166a05642
parentbcb86df40f96b90fbbd5c96cfbcc744ee4a362d1
seg6: export get_srh() for ICMP handling

[ Upstream commit fa55a7d745de2d10489295b0674a403e2a5d490d ]

An ICMP error message can contain in its message body part of an IPv6
packet which invoked the error. Such a packet might contain a segment
router header. Export get_srh() so the ICMP code can make use of it.

Since his changes the scope of the function from local to global, add
the seg6_ prefix to keep the namespace clean. And move it into seg6.c
so it is always available, not just when IPV6_SEG6_LWTUNNEL is
enabled.

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/seg6.c
net/ipv6/seg6_local.c