netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ying Cai <ycai@google.com>
To: netdev <netdev@vger.kernel.org>,
	Neal Cardwell <ncardwell@google.com>,
	Eric Dumazet <edumazet@google.com>,
	pshelar@nicira.com
Subject: [PATCH net v2] ip_tunnel: Set network header properly for IP_ECN_decapsulate()
Date: Sat, 3 May 2014 22:40:03 -0700	[thread overview]
Message-ID: <CAL1qit8cy1GOfpdu+LxrFuvegSoC_GFvE67gnfFMBW224hhNAQ@mail.gmail.com> (raw)

In ip_tunnel_rcv(), set skb->network_header to inner IP header
before IP_ECN_decapsulate().

Without the fix, IP_ECN_decapsulate() takes outer IP header as
inner IP header, possibly causing error messages or packet drops.

Note that this skb_reset_network_header() call was in this spot when
the original feature for checking consistency of ECN bits through
tunnels was added in eccc1bb8d4b4 ("tunnel: drop packet if ECN present
with not-ECT"). It was only removed from this spot in 3d7b46cd20e3
("ip_tunnel: push generic protocol handling to ip_tunnel module.").

Fixes: 3d7b46cd20e3 ("ip_tunnel: push generic protocol handling to
ip_tunnel module.")
Reported-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Ying Cai <ycai@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
---
 net/ipv4/ip_tunnel.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index fa5b751..b3f8597 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -442,6 +442,8 @@ int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct
sk_buff *skb,
  tunnel->i_seqno = ntohl(tpi->seq) + 1;
  }

+ skb_reset_network_header(skb);
+
  err = IP_ECN_decapsulate(iph, skb);
  if (unlikely(err)) {
  if (log_ecn_error)
-- 
1.9.1.423.g4596e3a

             reply	other threads:[~2014-05-04  5:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-04  5:40 Ying Cai [this message]
2014-05-04 15:13 ` [PATCH net v2] ip_tunnel: Set network header properly for IP_ECN_decapsulate() Sergei Shtylyov
2014-05-05 23:46 ` 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=CAL1qit8cy1GOfpdu+LxrFuvegSoC_GFvE67gnfFMBW224hhNAQ@mail.gmail.com \
    --to=ycai@google.com \
    --cc=edumazet@google.com \
    --cc=ncardwell@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 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).