netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: huizhang@marvell.com
Cc: netdev@vger.kernel.org, alan@lxorguk.ukuu.org.uk,
	nickcave.zhang@gmail.com
Subject: Re: [PATCH] net: ipv6: Fixed up ipsec packet be re-routing issue
Date: Thu, 22 May 2014 12:12:15 -0400 (EDT)	[thread overview]
Message-ID: <20140522.121215.16105419184813584.davem@davemloft.net> (raw)
In-Reply-To: <1400742346-24727-1-git-send-email-huizhang@marvell.com>

From: huizhang <huizhang@marvell.com>
Date: Thu, 22 May 2014 15:05:46 +0800

> diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
> index 5f8e128..869b68b 100644
> --- a/net/ipv6/xfrm6_policy.c
> +++ b/net/ipv6/xfrm6_policy.c
> @@ -134,6 +134,8 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
>  	const struct ipv6hdr *hdr = ipv6_hdr(skb);
>  	struct ipv6_opt_hdr *exthdr;
>  	const unsigned char *nh = skb_network_header(skb);
> +	if(IP6CB(skb)->nhoff==0)
> +		IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr);
>  	u8 nexthdr = nh[IP6CB(skb)->nhoff];
>  	int oif = 0;

Never put actual statements in the middle of a series of variable
declarations.

Also, it would probably be better to do this assignment in
__ip_local_out().

That's the bug, we only set nhoff in the input paths, we need
to set it in the output paths too if reaching _decode_session6
is possible for output packets.

  parent reply	other threads:[~2014-05-22 16:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-22  7:05 [PATCH] net: ipv6: Fixed up ipsec packet be re-routing issue huizhang
2014-05-22 12:21 ` Sergei Shtylyov
2014-05-22 16:12 ` David Miller [this message]
2014-05-26  4:38   ` nickcave
  -- strict thread matches above, loose matches on Subject: below --
2014-06-09  4:37 Hui Zhang
2014-06-11  7:47 ` David Miller

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=20140522.121215.16105419184813584.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=huizhang@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=nickcave.zhang@gmail.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).