Skip to contentSkip to conversation

: Fix TX bug VLAN in VLAN

PATCH Applied Joonwoo Park 2 participants 6 messages Nov 23, 2007 – Nov 29, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : Fix TX bug VLAN in VLAN

This patch fixes http://bugzilla.kernel.org/show_bug.cgi?id=8766

Is it possible?
BUG((veth->h_vlan_proto != htons(ETH_P_8021Q)) && !(VLAN_DEV_INFO(dev)->flags & VLAN_FLAG_REORDER_HDR)) I'm afraid, queued packet before vconfig set_flag would do that.

Thanks.
Joonwoo

[NET]: Fix TX bug VLAN in VLAN
Fix misbehavior of vlan_dev_hard_start_xmit() for recursive encapsulations.

---

net/8021q/vlan_dev.c +3 -1
index 7a36878..3e34990 100644
@@ -454,7 +454,9 @@ int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
 int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
 	struct net_device_stats *stats = vlan_dev_get_stats(dev);
+#ifdef VLAN_DEBUG
 	struct vlan_ethhdr *veth = (struct vlan_ethhdr *)(skb->data);
+#endif
 
 	/* Handle non-VLAN frames if they are sent to us, for example by DHCP.
 	 *
@@ -462,7 +464,7 @@ int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	 * OTHER THINGS LIKE FDDI/TokenRing/802.3 SNAPs...
 	 */
 
-	if (veth->h_vlan_proto != htons(ETH_P_8021Q)) {
+	if (VLAN_DEV_INFO(dev)->flags & VLAN_FLAG_REORDER_HDR) {
 		int orig_headroom = skb_headroom(skb);
 		unsigned short veth_TCI;
 

---

#1 lore raw
Quoted 5 lines · Joonwoo Park

This patch fixes http://bugzilla.kernel.org/show_bug.cgi?id=8766

Is it possible?
BUG((veth->h_vlan_proto != htons(ETH_P_8021Q)) && !(VLAN_DEV_INFO(dev)->flags & VLAN_FLAG_REORDER_HDR)) I'm afraid, queued packet before vconfig set_flag would do that.

Yes, AF_PACKET would do that. So you should check both.

Thanks,

Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
#2 lore raw

2007/11/26, Herbert Xu <[email protected]>:

Quoted 9 lines · Joonwoo Park
Quoted 5 lines

This patch fixes http://bugzilla.kernel.org/show_bug.cgi?id=8766

Is it possible?
BUG((veth->h_vlan_proto != htons(ETH_P_8021Q)) && !(VLAN_DEV_INFO(dev)->flags & VLAN_FLAG_REORDER_HDR)) I'm afraid, queued packet before vconfig set_flag would do that.

Yes, AF_PACKET would do that. So you should check both.

Thanks Herbert.
Well.. I think patch would work propely for AF_PACKET also. (I did not insert BUG() macro in my patch)
How do you think?

Thanks
Joonwoo

#3 lore raw
Quoted 5 lines · Joonwoo Park

Thanks Herbert.
Well.. I think patch would work propely for AF_PACKET also. (I did not insert BUG() macro in my patch)
How do you think?

Are you sure? I thought you need to check both in the xmit function. That is,

	if (veth->h_vlan_proto != htons(ETH_P_8021Q) ||
	    VLAN_DEV_INFO(dev)->flags & VLAN_FLAG_REORDER_HDR) {

Otherwise you'll miss AF_PACKET packets when REORDER is off.

Thanks,

Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
#4 lore raw

2007/11/27, Herbert Xu <[email protected]>:

Quoted 7 lines · Joonwoo Park
Quoted 5 lines

Thanks Herbert.
Well.. I think patch would work propely for AF_PACKET also. (I did not insert BUG() macro in my patch)
How do you think?

Quoted 7 lines

Are you sure? I thought you need to check both in the xmit function. That is,

       if (veth->h_vlan_proto != htons(ETH_P_8021Q) ||
           VLAN_DEV_INFO(dev)->flags & VLAN_FLAG_REORDER_HDR) {

Otherwise you'll miss AF_PACKET packets when REORDER is off.

Thanks Herbert!
I agree with you.

Thanks.
Joonwoo

[NET]: Fix TX bug VLAN in VLAN
Fix misbehavior of vlan_dev_hard_start_xmit() for recursive encapsulations.

---

net/8021q/vlan_dev.c +2 -1
index 7a36878..4f99bb8 100644
@@ -462,7 +462,8 @@ int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	 * OTHER THINGS LIKE FDDI/TokenRing/802.3 SNAPs...
 	 */
 
-	if (veth->h_vlan_proto != htons(ETH_P_8021Q)) {
+	if (veth->h_vlan_proto != htons(ETH_P_8021Q) ||
+		VLAN_DEV_INFO(dev)->flags & VLAN_FLAG_REORDER_HDR) {
 		int orig_headroom = skb_headroom(skb);
 		unsigned short veth_TCI;
 

---

Applied
#5 lore raw
Quoted 5 lines · Joonwoo Park

[NET]: Fix TX bug VLAN in VLAN
Fix misbehavior of vlan_dev_hard_start_xmit() for recursive encapsulations.

Applied to net-2.6. Thanks!

Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt