netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Timo Teräs" <timo.teras@iki.fi>
To: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
	davem@davemloft.net, netdev@vger.kernel.org
Subject: [PATCH][IPV4] ip_gre: set mac_header correctly in receive path
Date: Wed, 19 Dec 2007 20:10:41 +0200	[thread overview]
Message-ID: <47695EA1.10103@iki.fi> (raw)
In-Reply-To: <4767D249.5050602@iki.fi>

From: Timo Teras <timo.teras@iki.fi>

mac_header update in ipgre_recv() was incorrectly changed to
skb_reset_mac_header() when it was introduced.

Signed-off-by: Timo Teras <timo.teras@iki.fi>
---
This replaces my earlier patch titled "ip_gre: use skb->{mac,
network}_header consistently". Apparently I hadn't done my homework how
to use *_header correctly. And I should have done a bit more testing to
figure out the previous patch does not work.

But the main problem was the receive path in the first place, and this
patch fixes it.

The bug was introduced in commit 459a98ed881802dee55897441bc7f77af614368e.
There might be other similar incorrect replaces.


 net/ipv4/ip_gre.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 02b02a8..4b93f32 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -613,7 +613,7 @@ static int ipgre_rcv(struct sk_buff *skb)
 				offset += 4;
 		}
 
-		skb_reset_mac_header(skb);
+		skb->mac_header = skb->network_header;
 		__pskb_pull(skb, offset);
 		skb_reset_network_header(skb);
 		skb_postpull_rcsum(skb, skb_transport_header(skb), offset);
-- 
1.5.2.5

  reply	other threads:[~2007-12-19 18:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-23 14:31 [PATCH RESEND] ip_gre: sendto/recvfrom NBMA address Timo Teräs
2007-10-23 14:33 ` Patrick McHardy
2007-10-23 15:08   ` Timo Teräs
2007-10-23 15:57   ` Timo Teräs
2007-10-23 16:10     ` Patrick McHardy
2007-10-23 19:03     ` Alexey Kuznetsov
2007-10-24  3:32       ` David Miller
2007-10-23 20:20     ` Alexey Kuznetsov
2007-10-24  5:54       ` Timo Teräs
2007-10-24 10:08         ` Alexey Kuznetsov
2007-12-18 13:59           ` [RFC][PATCH][IPV4] ip_gre: use skb->{mac,network}_header consistently Timo Teräs
2007-12-19 18:10             ` Timo Teräs [this message]
2007-12-20  8:11               ` [PATCH][IPV4] ip_gre: set mac_header correctly in receive path 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=47695EA1.10103@iki.fi \
    --to=timo.teras@iki.fi \
    --cc=davem@davemloft.net \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=netdev@vger.kernel.org \
    /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).