[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9dcf55f7-9dde-5d76-a731-328462c393df@gmail.com>
Date: Thu, 2 Dec 2021 09:40:33 -0700
From: David Ahern <dsahern@...il.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: David Miller <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
David Ahern <dsahern@...nel.org>,
Willem de Bruijn <willemb@...gle.com>,
James Prestwood <prestwoj@...il.com>,
Justin Iurman <justin.iurman@...ege.be>,
Praveen Chaudhary <praveen5582@...il.com>,
"Jason A . Donenfeld" <Jason@...c4.com>,
Eric Dumazet <edumazet@...gle.com>,
netdev <netdev@...r.kernel.org>
Subject: Re: [patch RFC net-next v2 3/3] udp6: Use Segment Routing Header for
dest address if present
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.
Powered by blists - more mailing lists