diff mbox

[1/2] vlan: Calling vlan_hwaccel_do_receive() is always valid.

Message ID 1287696643-9695-1-git-send-email-jesse@nicira.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Jesse Gross Oct. 21, 2010, 9:30 p.m. UTC
It is now acceptable to receive vlan tagged packets at any time,
even if CONFIG_VLAN_8021Q is not set.  This means that calling
vlan_hwaccel_do_receive() should not result in BUG() but rather just
behave as if there were no vlan devices configured.

Reported-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
---
 include/linux/if_vlan.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Comments

David Miller Oct. 22, 2010, 3 a.m. UTC | #1
From: Jesse Gross <jesse@nicira.com>
Date: Thu, 21 Oct 2010 14:30:42 -0700

> It is now acceptable to receive vlan tagged packets at any time,
> even if CONFIG_VLAN_8021Q is not set.  This means that calling
> vlan_hwaccel_do_receive() should not result in BUG() but rather just
> behave as if there were no vlan devices configured.
> 
> Reported-by: Vladislav Zolotarov <vladz@broadcom.com>
> Signed-off-by: Jesse Gross <jesse@nicira.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index e607256..cbd3dcd 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -153,7 +153,8 @@  static inline u16 vlan_dev_vlan_id(const struct net_device *dev)
 
 static inline bool vlan_hwaccel_do_receive(struct sk_buff **skb)
 {
-	BUG();
+	if ((*skb)->vlan_tci & VLAN_VID_MASK)
+		(*skb)->pkt_type = PACKET_OTHERHOST;
 	return false;
 }
 #endif