aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/firewire/net.c2
-rw-r--r--drivers/isdn/i4l/isdn_net.c2
-rw-r--r--drivers/media/dvb-core/dvb_net.c10
-rw-r--r--drivers/net/ethernet/sun/niu.c2
-rw-r--r--drivers/net/plip/plip.c2
-rw-r--r--drivers/net/wireless/ray_cs.c2
-rw-r--r--include/linux/if_vlan.h2
-rw-r--r--include/uapi/linux/if_ether.h3
-rw-r--r--net/atm/lec.h2
-rw-r--r--net/bluetooth/bnep/netdev.c2
-rw-r--r--net/bridge/netfilter/ebtables.c2
-rw-r--r--net/ethernet/eth.c2
-rw-r--r--net/mac80211/tx.c2
-rw-r--r--net/openvswitch/datapath.c2
-rw-r--r--net/openvswitch/flow.c6
-rw-r--r--net/wireless/util.c2
16 files changed, 24 insertions, 21 deletions
diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c
index 56796330a162..4d565365e476 100644
--- a/drivers/firewire/net.c
+++ b/drivers/firewire/net.c
@@ -547,7 +547,7 @@ static int fwnet_finish_incoming_packet(struct net_device *net,
547 if (memcmp(eth->h_dest, net->dev_addr, net->addr_len)) 547 if (memcmp(eth->h_dest, net->dev_addr, net->addr_len))
548 skb->pkt_type = PACKET_OTHERHOST; 548 skb->pkt_type = PACKET_OTHERHOST;
549 } 549 }
550 if (ntohs(eth->h_proto) >= 1536) { 550 if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN) {
551 protocol = eth->h_proto; 551 protocol = eth->h_proto;
552 } else { 552 } else {
553 rawp = (u16 *)skb->data; 553 rawp = (u16 *)skb->data;
diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c
index babc621a07fb..88d657dff474 100644
--- a/drivers/isdn/i4l/isdn_net.c
+++ b/drivers/isdn/i4l/isdn_net.c
@@ -1385,7 +1385,7 @@ isdn_net_type_trans(struct sk_buff *skb, struct net_device *dev)
1385 if (memcmp(eth->h_dest, dev->dev_addr, ETH_ALEN)) 1385 if (memcmp(eth->h_dest, dev->dev_addr, ETH_ALEN))
1386 skb->pkt_type = PACKET_OTHERHOST; 1386 skb->pkt_type = PACKET_OTHERHOST;
1387 } 1387 }
1388 if (ntohs(eth->h_proto) >= 1536) 1388 if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN)
1389 return eth->h_proto; 1389 return eth->h_proto;
1390 1390
1391 rawp = skb->data; 1391 rawp = skb->data;
diff --git a/drivers/media/dvb-core/dvb_net.c b/drivers/media/dvb-core/dvb_net.c
index 44225b186f6d..83a23afb13ab 100644
--- a/drivers/media/dvb-core/dvb_net.c
+++ b/drivers/media/dvb-core/dvb_net.c
@@ -185,7 +185,7 @@ static __be16 dvb_net_eth_type_trans(struct sk_buff *skb,
185 skb->pkt_type=PACKET_MULTICAST; 185 skb->pkt_type=PACKET_MULTICAST;
186 } 186 }
187 187
188 if (ntohs(eth->h_proto) >= 1536) 188 if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN)
189 return eth->h_proto; 189 return eth->h_proto;
190 190
191 rawp = skb->data; 191 rawp = skb->data;
@@ -228,9 +228,9 @@ static int ule_test_sndu( struct dvb_net_priv *p )
228static int ule_bridged_sndu( struct dvb_net_priv *p ) 228static int ule_bridged_sndu( struct dvb_net_priv *p )
229{ 229{
230 struct ethhdr *hdr = (struct ethhdr*) p->ule_next_hdr; 230 struct ethhdr *hdr = (struct ethhdr*) p->ule_next_hdr;
231 if(ntohs(hdr->h_proto) < 1536) { 231 if(ntohs(hdr->h_proto) < ETH_P_802_3_MIN) {
232 int framelen = p->ule_sndu_len - ((p->ule_next_hdr+sizeof(struct ethhdr)) - p->ule_skb->data); 232 int framelen = p->ule_sndu_len - ((p->ule_next_hdr+sizeof(struct ethhdr)) - p->ule_skb->data);
233 /* A frame Type < 1536 for a bridged frame, introduces a LLC Length field. */ 233 /* A frame Type < ETH_P_802_3_MIN for a bridged frame, introduces a LLC Length field. */
234 if(framelen != ntohs(hdr->h_proto)) { 234 if(framelen != ntohs(hdr->h_proto)) {
235 return -1; 235 return -1;
236 } 236 }
@@ -320,7 +320,7 @@ static int handle_ule_extensions( struct dvb_net_priv *p )
320 (int) p->ule_sndu_type, l, total_ext_len); 320 (int) p->ule_sndu_type, l, total_ext_len);
321#endif 321#endif
322 322
323 } while (p->ule_sndu_type < 1536); 323 } while (p->ule_sndu_type < ETH_P_802_3_MIN);
324 324
325 return total_ext_len; 325 return total_ext_len;
326} 326}
@@ -712,7 +712,7 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
712 } 712 }
713 713
714 /* Handle ULE Extension Headers. */ 714 /* Handle ULE Extension Headers. */
715 if (priv->ule_sndu_type < 1536) { 715 if (priv->ule_sndu_type < ETH_P_802_3_MIN) {
716 /* There is an extension header. Handle it accordingly. */ 716 /* There is an extension header. Handle it accordingly. */
717 int l = handle_ule_extensions(priv); 717 int l = handle_ule_extensions(priv);
718 if (l < 0) { 718 if (l < 0) {
diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c
index e4c1c88e4c2a..95cff98d8a34 100644
--- a/drivers/net/ethernet/sun/niu.c
+++ b/drivers/net/ethernet/sun/niu.c
@@ -6618,7 +6618,7 @@ static u64 niu_compute_tx_flags(struct sk_buff *skb, struct ethhdr *ehdr,
6618 (len << TXHDR_LEN_SHIFT) | 6618 (len << TXHDR_LEN_SHIFT) |
6619 ((l3off / 2) << TXHDR_L3START_SHIFT) | 6619 ((l3off / 2) << TXHDR_L3START_SHIFT) |
6620 (ihl << TXHDR_IHL_SHIFT) | 6620 (ihl << TXHDR_IHL_SHIFT) |
6621 ((eth_proto_inner < 1536) ? TXHDR_LLC : 0) | 6621 ((eth_proto_inner < ETH_P_802_3_MIN) ? TXHDR_LLC : 0) |
6622 ((eth_proto == ETH_P_8021Q) ? TXHDR_VLAN : 0) | 6622 ((eth_proto == ETH_P_8021Q) ? TXHDR_VLAN : 0) |
6623 (ipv6 ? TXHDR_IP_VER : 0) | 6623 (ipv6 ? TXHDR_IP_VER : 0) |
6624 csum_bits); 6624 csum_bits);
diff --git a/drivers/net/plip/plip.c b/drivers/net/plip/plip.c
index bed62d9c53c8..1f7bef90b467 100644
--- a/drivers/net/plip/plip.c
+++ b/drivers/net/plip/plip.c
@@ -560,7 +560,7 @@ static __be16 plip_type_trans(struct sk_buff *skb, struct net_device *dev)
560 * so don't forget to remove it. 560 * so don't forget to remove it.
561 */ 561 */
562 562
563 if (ntohs(eth->h_proto) >= 1536) 563 if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN)
564 return eth->h_proto; 564 return eth->h_proto;
565 565
566 rawp = skb->data; 566 rawp = skb->data;
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 4775b5d172d5..ebada812b3a5 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -953,7 +953,7 @@ static int translate_frame(ray_dev_t *local, struct tx_msg __iomem *ptx,
953 unsigned char *data, int len) 953 unsigned char *data, int len)
954{ 954{
955 __be16 proto = ((struct ethhdr *)data)->h_proto; 955 __be16 proto = ((struct ethhdr *)data)->h_proto;
956 if (ntohs(proto) >= 1536) { /* DIX II ethernet frame */ 956 if (ntohs(proto) >= ETH_P_802_3_MIN) { /* DIX II ethernet frame */
957 pr_debug("ray_cs translate_frame DIX II\n"); 957 pr_debug("ray_cs translate_frame DIX II\n");
958 /* Copy LLC header to card buffer */ 958 /* Copy LLC header to card buffer */
959 memcpy_toio(&ptx->var, eth2_llc, sizeof(eth2_llc)); 959 memcpy_toio(&ptx->var, eth2_llc, sizeof(eth2_llc));
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 218a3b686d90..70962f3fdb79 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -339,7 +339,7 @@ static inline void vlan_set_encap_proto(struct sk_buff *skb,
339 */ 339 */
340 340
341 proto = vhdr->h_vlan_encapsulated_proto; 341 proto = vhdr->h_vlan_encapsulated_proto;
342 if (ntohs(proto) >= 1536) { 342 if (ntohs(proto) >= ETH_P_802_3_MIN) {
343 skb->protocol = proto; 343 skb->protocol = proto;
344 return; 344 return;
345 } 345 }
diff --git a/include/uapi/linux/if_ether.h b/include/uapi/linux/if_ether.h
index 798032d01112..ade07f1c491a 100644
--- a/include/uapi/linux/if_ether.h
+++ b/include/uapi/linux/if_ether.h
@@ -94,6 +94,9 @@
94#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */ 94#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
95#define ETH_P_AF_IUCV 0xFBFB /* IBM af_iucv [ NOT AN OFFICIALLY REGISTERED ID ] */ 95#define ETH_P_AF_IUCV 0xFBFB /* IBM af_iucv [ NOT AN OFFICIALLY REGISTERED ID ] */
96 96
97#define ETH_P_802_3_MIN 0x0600 /* If the value in the ethernet type is less than this value
98 * then the frame is Ethernet II. Else it is 802.3 */
99
97/* 100/*
98 * Non DIX types. Won't clash for 1500 types. 101 * Non DIX types. Won't clash for 1500 types.
99 */ 102 */
diff --git a/net/atm/lec.h b/net/atm/lec.h
index a86aff9a3c04..4149db1b7885 100644
--- a/net/atm/lec.h
+++ b/net/atm/lec.h
@@ -58,7 +58,7 @@ struct lane2_ops {
58 * field in h_type field. Data follows immediately after header. 58 * field in h_type field. Data follows immediately after header.
59 * 2. LLC Data frames whose total length, including LLC field and data, 59 * 2. LLC Data frames whose total length, including LLC field and data,
60 * but not padding required to meet the minimum data frame length, 60 * but not padding required to meet the minimum data frame length,
61 * is less than 1536(0x0600) MUST be encoded by placing that length 61 * is less than ETH_P_802_3_MIN MUST be encoded by placing that length
62 * in the h_type field. The LLC field follows header immediately. 62 * in the h_type field. The LLC field follows header immediately.
63 * 3. LLC data frames longer than this maximum MUST be encoded by placing 63 * 3. LLC data frames longer than this maximum MUST be encoded by placing
64 * the value 0 in the h_type field. 64 * the value 0 in the h_type field.
diff --git a/net/bluetooth/bnep/netdev.c b/net/bluetooth/bnep/netdev.c
index e58c8b32589c..4b488ec26105 100644
--- a/net/bluetooth/bnep/netdev.c
+++ b/net/bluetooth/bnep/netdev.c
@@ -136,7 +136,7 @@ static u16 bnep_net_eth_proto(struct sk_buff *skb)
136 struct ethhdr *eh = (void *) skb->data; 136 struct ethhdr *eh = (void *) skb->data;
137 u16 proto = ntohs(eh->h_proto); 137 u16 proto = ntohs(eh->h_proto);
138 138
139 if (proto >= 1536) 139 if (proto >= ETH_P_802_3_MIN)
140 return proto; 140 return proto;
141 141
142 if (get_unaligned((__be16 *) skb->data) == htons(0xFFFF)) 142 if (get_unaligned((__be16 *) skb->data) == htons(0xFFFF))
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
index 8d493c91a562..3d110c4fc787 100644
--- a/net/bridge/netfilter/ebtables.c
+++ b/net/bridge/netfilter/ebtables.c
@@ -138,7 +138,7 @@ ebt_basic_match(const struct ebt_entry *e, const struct sk_buff *skb,
138 ethproto = h->h_proto; 138 ethproto = h->h_proto;
139 139
140 if (e->bitmask & EBT_802_3) { 140 if (e->bitmask & EBT_802_3) {
141 if (FWINV2(ntohs(ethproto) >= 1536, EBT_IPROTO)) 141 if (FWINV2(ntohs(ethproto) >= ETH_P_802_3_MIN, EBT_IPROTO))
142 return 1; 142 return 1;
143 } else if (!(e->bitmask & EBT_NOPROTO) && 143 } else if (!(e->bitmask & EBT_NOPROTO) &&
144 FWINV2(e->ethproto != ethproto, EBT_IPROTO)) 144 FWINV2(e->ethproto != ethproto, EBT_IPROTO))
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index a36c85eab5b4..5359560926bc 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -195,7 +195,7 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
195 if (netdev_uses_trailer_tags(dev)) 195 if (netdev_uses_trailer_tags(dev))
196 return htons(ETH_P_TRAILER); 196 return htons(ETH_P_TRAILER);
197 197
198 if (ntohs(eth->h_proto) >= 1536) 198 if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN)
199 return eth->h_proto; 199 return eth->h_proto;
200 200
201 /* 201 /*
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 8914d2d2881a..4e8a86163fc7 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2085,7 +2085,7 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
2085 encaps_data = bridge_tunnel_header; 2085 encaps_data = bridge_tunnel_header;
2086 encaps_len = sizeof(bridge_tunnel_header); 2086 encaps_len = sizeof(bridge_tunnel_header);
2087 skip_header_bytes -= 2; 2087 skip_header_bytes -= 2;
2088 } else if (ethertype >= 0x600) { 2088 } else if (ethertype >= ETH_P_802_3_MIN) {
2089 encaps_data = rfc1042_header; 2089 encaps_data = rfc1042_header;
2090 encaps_len = sizeof(rfc1042_header); 2090 encaps_len = sizeof(rfc1042_header);
2091 skip_header_bytes -= 2; 2091 skip_header_bytes -= 2;
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index d61cd9971808..8759265a3e46 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -681,7 +681,7 @@ static int ovs_packet_cmd_execute(struct sk_buff *skb, struct genl_info *info)
681 /* Normally, setting the skb 'protocol' field would be handled by a 681 /* Normally, setting the skb 'protocol' field would be handled by a
682 * call to eth_type_trans(), but it assumes there's a sending 682 * call to eth_type_trans(), but it assumes there's a sending
683 * device, which we may not have. */ 683 * device, which we may not have. */
684 if (ntohs(eth->h_proto) >= 1536) 684 if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN)
685 packet->protocol = eth->h_proto; 685 packet->protocol = eth->h_proto;
686 else 686 else
687 packet->protocol = htons(ETH_P_802_2); 687 packet->protocol = htons(ETH_P_802_2);
diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c
index fe0e4215c73d..332486839347 100644
--- a/net/openvswitch/flow.c
+++ b/net/openvswitch/flow.c
@@ -466,7 +466,7 @@ static __be16 parse_ethertype(struct sk_buff *skb)
466 proto = *(__be16 *) skb->data; 466 proto = *(__be16 *) skb->data;
467 __skb_pull(skb, sizeof(__be16)); 467 __skb_pull(skb, sizeof(__be16));
468 468
469 if (ntohs(proto) >= 1536) 469 if (ntohs(proto) >= ETH_P_802_3_MIN)
470 return proto; 470 return proto;
471 471
472 if (skb->len < sizeof(struct llc_snap_hdr)) 472 if (skb->len < sizeof(struct llc_snap_hdr))
@@ -483,7 +483,7 @@ static __be16 parse_ethertype(struct sk_buff *skb)
483 483
484 __skb_pull(skb, sizeof(struct llc_snap_hdr)); 484 __skb_pull(skb, sizeof(struct llc_snap_hdr));
485 485
486 if (ntohs(llc->ethertype) >= 1536) 486 if (ntohs(llc->ethertype) >= ETH_P_802_3_MIN)
487 return llc->ethertype; 487 return llc->ethertype;
488 488
489 return htons(ETH_P_802_2); 489 return htons(ETH_P_802_2);
@@ -1038,7 +1038,7 @@ int ovs_flow_from_nlattrs(struct sw_flow_key *swkey, int *key_lenp,
1038 1038
1039 if (attrs & (1 << OVS_KEY_ATTR_ETHERTYPE)) { 1039 if (attrs & (1 << OVS_KEY_ATTR_ETHERTYPE)) {
1040 swkey->eth.type = nla_get_be16(a[OVS_KEY_ATTR_ETHERTYPE]); 1040 swkey->eth.type = nla_get_be16(a[OVS_KEY_ATTR_ETHERTYPE]);
1041 if (ntohs(swkey->eth.type) < 1536) 1041 if (ntohs(swkey->eth.type) < ETH_P_802_3_MIN)
1042 return -EINVAL; 1042 return -EINVAL;
1043 attrs &= ~(1 << OVS_KEY_ATTR_ETHERTYPE); 1043 attrs &= ~(1 << OVS_KEY_ATTR_ETHERTYPE);
1044 } else { 1044 } else {
diff --git a/net/wireless/util.c b/net/wireless/util.c
index 37a56ee1e1ed..6cbac99ae03d 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -511,7 +511,7 @@ int ieee80211_data_from_8023(struct sk_buff *skb, const u8 *addr,
511 encaps_data = bridge_tunnel_header; 511 encaps_data = bridge_tunnel_header;
512 encaps_len = sizeof(bridge_tunnel_header); 512 encaps_len = sizeof(bridge_tunnel_header);
513 skip_header_bytes -= 2; 513 skip_header_bytes -= 2;
514 } else if (ethertype > 0x600) { 514 } else if (ethertype >= ETH_P_802_3_MIN) {
515 encaps_data = rfc1042_header; 515 encaps_data = rfc1042_header;
516 encaps_len = sizeof(rfc1042_header); 516 encaps_len = sizeof(rfc1042_header);
517 skip_header_bytes -= 2; 517 skip_header_bytes -= 2;