diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 4846032bf4ff..975892367136 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h @@ -698,7 +698,6 @@ static inline void vlan_set_encap_proto(struct sk_buff *skb, struct vlan_hdr *vhdr) { __be16 proto; - unsigned short *rawp; /* * Was a VLAN packet, grab the encapsulated protocol, which the layer @@ -711,21 +710,8 @@ static inline void vlan_set_encap_proto(struct sk_buff *skb, return; } - rawp = (unsigned short *)(vhdr + 1); - if (*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); + /* No ethertype: this is an 802.2 LLC frame (length field). */ + skb->protocol = htons(ETH_P_802_2); } /** diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 5c4024a03e10..43ebe61c7fc4 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -6355,8 +6355,7 @@ struct sk_buff *skb_vlan_untag(struct sk_buff *skb) skb = skb_share_check(skb, GFP_ATOMIC); if (unlikely(!skb)) goto err_free; - /* We may access the two bytes after vlan_hdr in vlan_set_encap_proto(). */ - if (unlikely(!pskb_may_pull(skb, VLAN_HLEN + sizeof(unsigned short)))) + if (unlikely(!pskb_may_pull(skb, VLAN_HLEN))) goto err_free; vhdr = (struct vlan_hdr *)skb->data; diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c index d9faadbe9b6c..39aab0f8035a 100644 --- a/net/ethernet/eth.c +++ b/net/ethernet/eth.c @@ -154,9 +154,7 @@ EXPORT_SYMBOL(eth_get_headlen); */ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev) { - const unsigned short *sap; const struct ethhdr *eth; - __be16 res; skb->dev = dev; skb_reset_mac_header(skb); @@ -176,20 +174,8 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev) if (likely(eth_proto_is_802_3(eth->h_proto))) return eth->h_proto; - /* - * 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. - * We use skb->dev as temporary storage to not hit - * CONFIG_STACKPROTECTOR_STRONG=y costs on some platforms. - */ - sap = skb_header_pointer(skb, 0, sizeof(*sap), &skb->dev); - res = (sap && *sap == 0xFFFF) ? htons(ETH_P_802_3) : htons(ETH_P_802_2); - - /* restore skb->dev in case it was mangled by skb_header_pointer(). */ - skb->dev = dev; - return res; + /* No ethertype: this is an 802.2 LLC frame (length field). */ + return htons(ETH_P_802_2); } EXPORT_SYMBOL(eth_type_trans);