From 2792e9984619bb0437d32ddaccf1388be301da60 Mon Sep 17 00:00:00 2001 From: Pravin B Shelar Date: Fri, 18 Nov 2011 13:15:54 -0800 Subject: [PATCH] --- yaml --- r: 278335 b: refs/heads/master c: 396cf9430505cfba529a2f2a037d782719fa5844 h: refs/heads/master i: 278333: 466cb7d90d79215aad12241739678e65e294e9cf 278331: 01f1fd720d83ddd85ee829bb4c13d4ff431d2e18 278327: 83400a3e41e4a6d30ea1c28ef568ae1b49116409 278319: bac4b761d9030b6672583b06c411bf23bcd10e5e 278303: 396b7be6d5c0a6aa676695ae576a36d56a5e5b3b 278271: 218f0885c0ee681f30bd4709b939bf3224d61c47 v: v3 --- [refs] | 2 +- trunk/include/linux/if_vlan.h | 34 ++++++++++++++++++++++++++++++++++ trunk/net/8021q/vlan_core.c | 33 --------------------------------- 3 files changed, 35 insertions(+), 34 deletions(-) diff --git a/[refs] b/[refs] index 44254764cb32..6252720a69df 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b4e16611c4e1cd98765269c8fdaf43f96baa57b1 +refs/heads/master: 396cf9430505cfba529a2f2a037d782719fa5844 diff --git a/trunk/include/linux/if_vlan.h b/trunk/include/linux/if_vlan.h index 12d5543b14f2..070ac50c1d2d 100644 --- a/trunk/include/linux/if_vlan.h +++ b/trunk/include/linux/if_vlan.h @@ -310,6 +310,40 @@ static inline __be16 vlan_get_protocol(const struct sk_buff *skb) return protocol; } + +static inline void vlan_set_encap_proto(struct sk_buff *skb, + struct vlan_hdr *vhdr) +{ + __be16 proto; + unsigned char *rawp; + + /* + * Was a VLAN packet, grab the encapsulated protocol, which the layer + * three protocols care about. + */ + + proto = vhdr->h_vlan_encapsulated_proto; + if (ntohs(proto) >= 1536) { + skb->protocol = proto; + return; + } + + rawp = skb->data; + if (*(unsigned short *) rawp == 0xFFFF) + /* + * This is a magic hack to spot IPX packets. Older Novell + * breaks the protocol design and runs IPX over 802.3 without + * an 802.2 LLC layer. We look for FFFF which isn't a used + * 802.2 SSAP/DSAP. This won't work for fault tolerant netware + * but does for the rest. + */ + skb->protocol = htons(ETH_P_802_3); + else + /* + * Real 802.2 LLC + */ + skb->protocol = htons(ETH_P_802_2); +} #endif /* __KERNEL__ */ /* VLAN IOCTLs are found in sockios.h */ diff --git a/trunk/net/8021q/vlan_core.c b/trunk/net/8021q/vlan_core.c index f5ffc02729d6..9c95e8e054f9 100644 --- a/trunk/net/8021q/vlan_core.c +++ b/trunk/net/8021q/vlan_core.c @@ -110,39 +110,6 @@ static struct sk_buff *vlan_reorder_header(struct sk_buff *skb) return skb; } -static void vlan_set_encap_proto(struct sk_buff *skb, struct vlan_hdr *vhdr) -{ - __be16 proto; - unsigned char *rawp; - - /* - * Was a VLAN packet, grab the encapsulated protocol, which the layer - * three protocols care about. - */ - - proto = vhdr->h_vlan_encapsulated_proto; - if (ntohs(proto) >= 1536) { - skb->protocol = proto; - return; - } - - rawp = skb->data; - if (*(unsigned short *) rawp == 0xFFFF) - /* - * This is a magic hack to spot IPX packets. Older Novell - * breaks the protocol design and runs IPX over 802.3 without - * an 802.2 LLC layer. We look for FFFF which isn't a used - * 802.2 SSAP/DSAP. This won't work for fault tolerant netware - * but does for the rest. - */ - skb->protocol = htons(ETH_P_802_3); - else - /* - * Real 802.2 LLC - */ - skb->protocol = htons(ETH_P_802_2); -} - struct sk_buff *vlan_untag(struct sk_buff *skb) { struct vlan_hdr *vhdr;