mbox series

[v5,net-next,0/3] Fix traceroute in the presence of SRv6

Message ID 20220103171132.93456-1-andrew@lunn.ch (mailing list archive)
Headers show
Series Fix traceroute in the presence of SRv6 | expand

Message

Andrew Lunn Jan. 3, 2022, 5:11 p.m. UTC
When using SRv6 the destination IP address in the IPv6 header is not
always the true destination, it can be a router along the path that
SRv6 is using.

When ICMP reports an error, e.g, time exceeded, which is what
traceroute uses, it included the packet which invoked the error into
the ICMP message body. Upon receiving such an ICMP packet, the
invoking packet is examined and an attempt is made to find the socket
which sent the packet, so the error can be reported. Lookup is
performed using the source and destination address. If the
intermediary router IP address from the IP header is used, the lookup
fails. It is necessary to dig into the header and find the true
destination address in the Segment Router header, SRH.

v2:
Play games with the skb->network_header rather than clone the skb
v3:
Move helpers into seg6.c
v4:
Move short helper into header file.
Rework getting SRH destination address
v5:
Fix comment to describe function, not caller

Patch 1 exports a helper which can find the SRH in a packet
Patch 2 does the actual examination of the invoking packet
Patch 3 makes use of the results when trying to find the socket.

Andrew Lunn (3):
  seg6: export get_srh() for ICMP handling
  icmp: ICMPV6: Examine invoking packet for Segment Route Headers.
  udp6: Use Segment Routing Header for dest address if present

 include/linux/ipv6.h  |  2 ++
 include/net/seg6.h    | 21 +++++++++++++++
 net/ipv6/icmp.c       |  6 ++++-
 net/ipv6/seg6.c       | 59 +++++++++++++++++++++++++++++++++++++++++++
 net/ipv6/seg6_local.c | 33 ++----------------------
 net/ipv6/udp.c        |  3 ++-
 6 files changed, 91 insertions(+), 33 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Jan. 4, 2022, 12:40 p.m. UTC | #1
Hello:

This series was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Mon,  3 Jan 2022 18:11:29 +0100 you wrote:
> When using SRv6 the destination IP address in the IPv6 header is not
> always the true destination, it can be a router along the path that
> SRv6 is using.
> 
> When ICMP reports an error, e.g, time exceeded, which is what
> traceroute uses, it included the packet which invoked the error into
> the ICMP message body. Upon receiving such an ICMP packet, the
> invoking packet is examined and an attempt is made to find the socket
> which sent the packet, so the error can be reported. Lookup is
> performed using the source and destination address. If the
> intermediary router IP address from the IP header is used, the lookup
> fails. It is necessary to dig into the header and find the true
> destination address in the Segment Router header, SRH.
> 
> [...]

Here is the summary with links:
  - [v5,net-next,1/3] seg6: export get_srh() for ICMP handling
    https://git.kernel.org/netdev/net/c/fa55a7d745de
  - [v5,net-next,2/3] icmp: ICMPV6: Examine invoking packet for Segment Route Headers.
    https://git.kernel.org/netdev/net/c/e41294408c56
  - [v5,net-next,3/3] udp6: Use Segment Routing Header for dest address if present
    https://git.kernel.org/netdev/net/c/222a011efc83

You are awesome, thank you!