All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Cong Wang <amwang@redhat.com>
Cc: netdev@vger.kernel.org, Pravin B Shelar <pshelar@nicira.com>,
	Eric Dumazet <edumazet@google.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH net-next] ip_gre: increase inner ip header ID only for IPv4
Date: Sat, 23 Mar 2013 19:10:46 +0400	[thread overview]
Message-ID: <514DC5F6.9060904@cogentembedded.com> (raw)
In-Reply-To: <1364016584-7189-1-git-send-email-amwang@redhat.com>

Hello.

On 23-03-2013 9:29, Cong Wang wrote:

> From: Cong Wang <amwang@redhat.com>

> Pravin pointed out the inner network header of a GRE tunnel packet
> could be IPv6, where there is no ID. So we should check the version.

> Cc: Pravin B Shelar <pshelar@nicira.com>
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: "David S. Miller" <davem@davemloft.net>
> Signed-off-by: Cong Wang <amwang@redhat.com>

> ---
> diff --git a/net/ipv4/gre.c b/net/ipv4/gre.c
> index e20631c..a2516f5 100644
> --- a/net/ipv4/gre.c
> +++ b/net/ipv4/gre.c
[...]
> @@ -172,7 +172,12 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb,
>   	skb->mac_len = skb_inner_network_offset(skb);
>
>   	iph = ip_hdr(skb);
> -	id = ntohs(iph->id);
> +	if (iph->version == 4) {
> +		ipv4 = true;
> +		id = ntohs(iph->id);
> +	} else
> +		ipv4 = false;

    Both arms of *if* statement should have {}, according to 
Documentation/CodingStyle chapter 3.

WBR, Sergei

  reply	other threads:[~2013-03-23 15:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-23  5:29 [PATCH net-next] ip_gre: increase inner ip header ID only for IPv4 Cong Wang
2013-03-23 15:10 ` Sergei Shtylyov [this message]
2013-03-23 23:36 ` Pravin Shelar
2013-03-24  2:37   ` Cong Wang
2013-03-24  4:13     ` Pravin Shelar

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=514DC5F6.9060904@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=amwang@redhat.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pshelar@nicira.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.