[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1383670903.4291.142.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Tue, 05 Nov 2013 09:01:43 -0800
From: Eric Dumazet <eric.dumazet@...il.com>
To: Christophe Gouault <christophe.gouault@...nd.com>
Cc: Steffen Klassert <steffen.klassert@...unet.com>,
"David S. Miller" <davem@...emloft.net>,
Herbert Xu <herbert@...dor.apana.org.au>,
netdev@...r.kernel.org, Saurabh Mohan <saurabh.mohan@...tta.com>,
Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
Subject: Re: [PATCH net v2] vti: fix spd lookup: match plaintext pkt, not
ipsec pkt
On Tue, 2013-11-05 at 16:58 +0100, Christophe Gouault wrote:
> diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c
> index 6e87f85..bcd85be 100644
> --- a/net/ipv4/ip_vti.c
> +++ b/net/ipv4/ip_vti.c
> @@ -126,6 +126,7 @@ static int vti_rcv(struct sk_buff *skb)
> if (tunnel != NULL) {
> struct pcpu_tstats *tstats;
> u32 oldmark = skb->mark;
> + u16 netoff = skb_network_header(skb) - skb->data;
unsigned int nhoff = skb_network_offset(skb);
There is no need to assume u16 here, even if the implementation
currently has this assumption.
You also could just use faster operation (no need to access
skb->data/head)
unsigned int old_nh = skb->network_header;
...
at restore, use :
skb->network_header = old_nh;
instead of the more expensive skb_set_network_header()
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists