[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADvbK_cPp9Md06wXG19fF2jxFr7v07rnCNa5tmXGHOjNM9Ew1g@mail.gmail.com>
Date: Sun, 19 Apr 2020 15:27:42 +0800
From: Xin Long <lucien.xin@...il.com>
To: network dev <netdev@...r.kernel.org>
Cc: Steffen Klassert <steffen.klassert@...unet.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
"David S. Miller" <davem@...emloft.net>,
Sabrina Dubroca <sd@...asysnail.net>
Subject: Re: [PATCH ipsec] esp4: support ipv6 nexthdrs process for beet gso segment
On Fri, Apr 10, 2020 at 5:08 PM Xin Long <lucien.xin@...il.com> wrote:
>
> For beet mode, when it's ipv6 inner address with nexthdrs set,
> the packet format might be:
>
> ----------------------------------------------------
> | outer | | dest | | | ESP | ESP |
> | IP hdr | ESP | opts.| TCP | Data | Trailer | ICV |
> ----------------------------------------------------
>
> Before doing gso segment in xfrm4_beet_gso_segment(), the same
> thing is needed as it does in xfrm6_beet_gso_segment() in last
> patch 'esp6: support ipv6 nexthdrs process for beet gso segment'.
>
> Fixes: 384a46ea7bdc ("esp4: add gso_segment for esp4 beet mode")
> Signed-off-by: Xin Long <lucien.xin@...il.com>
> ---
> net/ipv4/esp4_offload.c | 14 ++++++++++----
> 1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/net/ipv4/esp4_offload.c b/net/ipv4/esp4_offload.c
> index 731022c..9dde4e3 100644
> --- a/net/ipv4/esp4_offload.c
> +++ b/net/ipv4/esp4_offload.c
> @@ -139,7 +139,7 @@ static struct sk_buff *xfrm4_beet_gso_segment(struct xfrm_state *x,
> struct xfrm_offload *xo = xfrm_offload(skb);
> struct sk_buff *segs = ERR_PTR(-EINVAL);
> const struct net_offload *ops;
> - int proto = xo->proto;
> + u8 proto = xo->proto;
>
> skb->transport_header += x->props.header_len;
>
> @@ -148,10 +148,16 @@ static struct sk_buff *xfrm4_beet_gso_segment(struct xfrm_state *x,
>
> skb->transport_header += ph->hdrlen * 8;
> proto = ph->nexthdr;
> - } else if (x->sel.family != AF_INET6) {
> + } else if (x->sel.family == AF_INET6) {
> + int offset = skb_transport_offset(skb);
> + __be16 frag;
> +
> + offset = ipv6_skip_exthdr(skb, offset, &proto, &frag);
> + skb->transport_header += offset;
And this one too.
> + if (proto == IPPROTO_TCP)
> + skb_shinfo(skb)->gso_type |= SKB_GSO_TCPV4;
> + } else {
> skb->transport_header -= IPV4_BEET_PHMAXLEN;
> - } else if (proto == IPPROTO_TCP) {
> - skb_shinfo(skb)->gso_type |= SKB_GSO_TCPV4;
> }
>
> __skb_pull(skb, skb_transport_offset(skb));
> --
> 2.1.0
>
Powered by blists - more mailing lists