All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: David Miller <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>
Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
	David Ahern <dsahern@kernel.org>,
	Willem de Bruijn <willemb@google.com>,
	James Prestwood <prestwoj@gmail.com>,
	Justin Iurman <justin.iurman@uliege.be>,
	Praveen Chaudhary <praveen5582@gmail.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Eric Dumazet <edumazet@google.com>,
	netdev <netdev@vger.kernel.org>, Andrew Lunn <andrew@lunn.ch>
Subject: [PATCH v5 net-next 0/3] Fix traceroute in the presence of SRv6
Date: Mon,  3 Jan 2022 18:11:29 +0100	[thread overview]
Message-ID: <20220103171132.93456-1-andrew@lunn.ch> (raw)

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(-)

-- 
2.34.1


             reply	other threads:[~2022-01-03 17:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-03 17:11 Andrew Lunn [this message]
2022-01-03 17:11 ` [PATCH v5 net-next 1/3] seg6: export get_srh() for ICMP handling Andrew Lunn
2022-01-03 17:31   ` David Ahern
2022-01-03 20:52     ` Willem de Bruijn
2022-01-03 17:11 ` [PATCH v5 net-next 2/3] icmp: ICMPV6: Examine invoking packet for Segment Route Headers Andrew Lunn
2022-01-03 17:34   ` David Ahern
2022-01-03 20:55     ` Willem de Bruijn
2022-01-03 17:11 ` [PATCH v5 net-next 3/3] udp6: Use Segment Routing Header for dest address if present Andrew Lunn
2022-01-03 17:35   ` David Ahern
2022-01-03 20:55     ` Willem de Bruijn
2022-01-04 12:40 ` [PATCH v5 net-next 0/3] Fix traceroute in the presence of SRv6 patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220103171132.93456-1-andrew@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=Jason@zx2c4.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=justin.iurman@uliege.be \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=praveen5582@gmail.com \
    --cc=prestwoj@gmail.com \
    --cc=willemb@google.com \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.