All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, Patrick McHardy <kaber@trash.net>
Subject: vlan 01/07: fix network_header/mac_header adjustments
Date: Mon,  7 Jul 2008 14:35:59 +0200 (MEST)	[thread overview]
Message-ID: <20080707123558.23947.97974.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20080707123557.23947.70114.sendpatchset@localhost.localdomain>

vlan: fix network_header/mac_header adjustments

Lennert Buytenhek points out that the VLAN code incorrectly adjusts
skb->network_header to point in the middle of the VLAN header and
additionally tries to adjust skb->mac_header without checking for
validity.

The network_header should not be touched at all since we're only
adding headers in front of it, mac_header adjustments are not
necessary at all.

Based on patch by Lennert Buytenhek <buytenh@wantstofly.org>.

Signed-off-by: Patrick McHardy <kaber@trash.net>

---
commit 12680f9e7c4d8c1d4dd89569e63f4f74d57243b0
tree 1ea90c61f99c3fba4ca3cac1729dd550ee98274a
parent 768cea593522d816b374149f3bf35e7c246fc8d0
author Patrick McHardy <kaber@trash.net> Mon, 07 Jul 2008 14:26:42 +0200
committer Patrick McHardy <kaber@trash.net> Mon, 07 Jul 2008 14:26:42 +0200

 include/linux/if_vlan.h |    2 --
 net/8021q/vlan_dev.c    |    1 -
 2 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 5190452..8f5bf9b 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -279,8 +279,6 @@ static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, unsigned short
 	veth->h_vlan_TCI = htons(tag);
 
 	skb->protocol = htons(ETH_P_8021Q);
-	skb->mac_header -= VLAN_HLEN;
-	skb->network_header -= VLAN_HLEN;
 
 	return skb;
 }
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index a0617bf..4a85259 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -308,7 +308,6 @@ static int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
 			vhdr->h_vlan_encapsulated_proto = htons(len);
 
 		skb->protocol = htons(ETH_P_8021Q);
-		skb_reset_network_header(skb);
 	}
 
 	/* Before delegating work to the lower layer, enter our MAC-address */

  reply	other threads:[~2008-07-07 12:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-07 12:35 vlan 00/07: VLAN update part 1 Patrick McHardy
2008-07-07 12:35 ` Patrick McHardy [this message]
2008-07-07 12:36 ` vlan 02/07: Use is_vlan_dev() Patrick McHardy
2008-07-07 12:36 ` vlan 03/07: Add ethtool support Patrick McHardy
2008-07-07 16:52   ` Ben Hutchings
2008-07-07 16:59     ` Patrick McHardy
2008-07-07 17:21       ` Ben Hutchings
2008-07-07 17:47         ` Patrick McHardy
2008-07-08 13:54           ` Ben Hutchings
2008-07-08 14:01             ` Patrick McHardy
2008-07-07 12:36 ` vlan 04/07: uninline __vlan_hwaccel_rx Patrick McHardy
2008-07-07 12:36 ` vlan 05/07: move struct vlan_dev_info to private header Patrick McHardy
2008-07-07 12:36 ` vlan 06/07: remove useless struct hlist_node declaration from if_vlan.h Patrick McHardy
2008-07-07 12:36 ` vlan 07/07: TCI related type and naming cleanups Patrick McHardy
2008-07-08 10:44 ` vlan 00/07: VLAN update part 1 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=20080707123558.23947.97974.sendpatchset@localhost.localdomain \
    --to=kaber@trash.net \
    --cc=davem@davemloft.net \
    --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 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.