All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: David Miller <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	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>
Subject: Re: [patch RFC net-next v2 3/3] udp6: Use Segment Routing Header for dest address if present
Date: Thu, 2 Dec 2021 09:40:33 -0700	[thread overview]
Message-ID: <9dcf55f7-9dde-5d76-a731-328462c393df@gmail.com> (raw)
In-Reply-To: <20211201202519.3637005-4-andrew@lunn.ch>

On 12/1/21 1:25 PM, Andrew Lunn wrote:
> @@ -563,12 +564,18 @@ int __udp6_lib_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
>  	const struct in6_addr *saddr = &hdr->saddr;
>  	const struct in6_addr *daddr = &hdr->daddr;
>  	struct udphdr *uh = (struct udphdr *)(skb->data+offset);
> +	struct ipv6_sr_hdr *srh;
>  	bool tunnel = false;
>  	struct sock *sk;
>  	int harderr;
>  	int err;
>  	struct net *net = dev_net(skb->dev);
>  
> +	if (opt->flags & IP6SKB_SEG6) {
> +		srh = (struct ipv6_sr_hdr *)(skb->data + opt->srhoff);
> +		daddr = &srh->segments[0];
> +	}
> +
>  	sk = __udp6_lib_lookup(net, daddr, uh->dest, saddr, uh->source,
>  			       inet6_iif(skb), inet6_sdif(skb), udptable, NULL);
>  

similarly for this one, have a helper in seg6.h that returns in6_addr
pointer. It will be referencing within skb->data so should be fine.

      reply	other threads:[~2021-12-02 16:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-01 20:25 [patch RFC net-next 0/3 v2] Fix traceroute in the presence of SRv6 Andrew Lunn
2021-12-01 20:25 ` [patch RFC net-next v2 1/3] seg6: export get_srh() for ICMP handling Andrew Lunn
2021-12-01 20:25 ` [patch RFC net-next v2 2/3] icmp: ICMPV6: Examine invoking packet for Segment Route Headers Andrew Lunn
2021-12-02 16:38   ` David Ahern
2021-12-02 19:11     ` Andrew Lunn
2021-12-01 20:25 ` [patch RFC net-next v2 3/3] udp6: Use Segment Routing Header for dest address if present Andrew Lunn
2021-12-02 16:40   ` David Ahern [this message]

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=9dcf55f7-9dde-5d76-a731-328462c393df@gmail.com \
    --to=dsahern@gmail.com \
    --cc=Jason@zx2c4.com \
    --cc=andrew@lunn.ch \
    --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.