netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shmulik Ladkani <shmulik.ladkani@gmail.com>
To: Tom Herbert <tom@herbertland.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>,
	Kernel Team <kernel-team@fb.com>
Subject: Re: [PATCH net-next 06/13] ipv6: Fix nexthdr for reinjection
Date: Fri, 13 May 2016 09:28:50 +0300	[thread overview]
Message-ID: <20160513092850.1868a828@halley> (raw)
In-Reply-To: <CALx6S34BHQnxSBAW4n4k+pf0Zey+XaiLAVvU5k_zVVRz=jAJvw@mail.gmail.com>

Hi,

On Thu, 12 May 2016 14:45:36 -0700 Tom Herbert <tom@herbertland.com> wrote:
> On Thu, May 12, 2016 at 1:23 PM, Shmulik Ladkani
> <shmulik.ladkani@gmail.com> wrote:
> >> @@ -222,13 +222,14 @@ static int ip6_input_finish(struct net *net, struct sock *sk, struct sk_buff *sk
> >>        */
> >>
> >>       rcu_read_lock();
> >> -resubmit:
> >> +
> >>       idev = ip6_dst_idev(skb_dst(skb));
> >>       if (!pskb_pull(skb, skb_transport_offset(skb)))
> >>               goto discard;
> >>       nhoff = IP6CB(skb)->nhoff;
> >>       nexthdr = skb_network_header(skb)[nhoff];
> >>
> >> +resubmit:  
> >
> > This has already been attempted in 0243508edd "ipv6: Fix protocol
> > resubmission" and reverted in 1b0ccfe54a.
> >
> > It looks that in some genuine extension header handling cases of ipv6
> > (not related to encapsulation), the original resubmission code REALLY
> > requires one to re-read IP6CB(skb)->nhoff and refetch the nexthdr.
> >  
> Is there any reason why the EH handlers can't read the nexthdr and return that?

One additional thing:

Seems the

    if (!pskb_pull(skb, skb_transport_offset(skb)))

located at the original resubmit label was also necessary, as the EH
handlers may increment skb->transport_header (both ipv6_destopt_rcv and
ipv6_rthdr_rcv do so).

So if we'd like to read the nexthdr at the EH handlers we should repeat
the "skb pull; read nexthdr from skb_network_header(skb)[new nhoff];
return nexhdr;" prior each positive return from EH handlers.

Thanks
Shmulik

  parent reply	other threads:[~2016-05-13  6:28 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-11 16:47 [PATCH net-next 00/13] ipv6: Enable GUEoIPv6 and more fixes for v6 tunneling Tom Herbert
2016-05-11 16:47 ` [PATCH net-next 01/13] gso: Remove arbitrary checks for unsupported GSO Tom Herbert
2016-05-11 16:47 ` [PATCH net-next 02/13] net: define gso types for IPx over IPv4 and IPv6 Tom Herbert
2016-05-11 16:47 ` [PATCH net-next 03/13] fou: Call setup_udp_tunnel_sock Tom Herbert
2016-05-11 16:47 ` [PATCH net-next 04/13] fou: Split out {fou,gue}_build_header Tom Herbert
2016-05-12 18:55   ` Shmulik Ladkani
2016-05-11 16:47 ` [PATCH net-next 05/13] fou: Add encap ops for IPv6 tunnels Tom Herbert
2016-05-12 19:26   ` Shmulik Ladkani
2016-05-11 16:47 ` [PATCH net-next 06/13] ipv6: Fix nexthdr for reinjection Tom Herbert
2016-05-12 20:23   ` Shmulik Ladkani
2016-05-12 21:45     ` Tom Herbert
2016-05-13  4:16       ` Shmulik Ladkani
2016-05-13  6:28       ` Shmulik Ladkani [this message]
2016-05-13 11:00         ` Shmulik Ladkani
2016-05-11 16:47 ` [PATCH net-next 07/13] ipv6: Change "final" protocol processing for encapsulation Tom Herbert
2016-05-13  6:51   ` Shmulik Ladkani
2016-05-11 16:47 ` [PATCH net-next 08/13] fou: Support IPv6 in fou Tom Herbert
2016-05-11 16:47 ` [PATCH net-next 09/13] ip6_tun: Add infrastructure for doing encapsulation Tom Herbert
2016-05-11 16:47 ` [PATCH net-next 10/13] ip6_gre: Add support for fou/gue encapsulation Tom Herbert
2016-05-11 16:47 ` [PATCH net-next 11/13] ip6_tunnel: " Tom Herbert
2016-05-11 16:47 ` [PATCH net-next 12/13] ip6ip6: Support for GSO/GRO Tom Herbert
2016-05-11 16:47 ` [PATCH net-next 13/13] ip4ip6: " Tom Herbert

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=20160513092850.1868a828@halley \
    --to=shmulik.ladkani@gmail.com \
    --cc=davem@davemloft.net \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=tom@herbertland.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).