diff options
| author | Simon Horman <[email protected]> | 2013-03-28 04:38:25 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2013-03-28 05:20:42 +0000 |
| commit | e5c5d22e8dcf7c2d430336cbf8e180bd38e8daf1 (patch) | |
| tree | 085634668082dc359bad9ff504f725423e947bb8 /net/openvswitch/flow.c | |
| parent | bnx2x: fix compilation without CONFIG_BNX2X_SRIOV (diff) | |
| download | kernel-e5c5d22e8dcf7c2d430336cbf8e180bd38e8daf1.tar.gz kernel-e5c5d22e8dcf7c2d430336cbf8e180bd38e8daf1.zip | |
net: add ETH_P_802_3_MIN
Add a new constant ETH_P_802_3_MIN, the minimum ethernet type for
an 802.3 frame. Frames with a lower value in the ethernet type field
are Ethernet II.
Also update all the users of this value that David Miller and
I could find to use the new constant.
Also correct a bug in util.c. The comparison with ETH_P_802_3_MIN
should be >= not >.
As suggested by Jesse Gross.
Compile tested only.
Cc: David Miller <[email protected]>
Cc: Jesse Gross <[email protected]>
Cc: Karsten Keil <[email protected]>
Cc: John W. Linville <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Bart De Schuymer <[email protected]>
Cc: Stephen Hemminger <[email protected]>
Cc: Patrick McHardy <[email protected]>
Cc: Marcel Holtmann <[email protected]>
Cc: Gustavo Padovan <[email protected]>
Cc: Johan Hedberg <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Acked-by: Mauro Carvalho Chehab <[email protected]>
Acked-by: Stefan Richter <[email protected]>
Signed-off-by: Simon Horman <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/openvswitch/flow.c')
| -rw-r--r-- | net/openvswitch/flow.c | 6 |
1 files changed, 3 insertions, 3 deletions
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) proto = *(__be16 *) skb->data; __skb_pull(skb, sizeof(__be16)); - if (ntohs(proto) >= 1536) + if (ntohs(proto) >= ETH_P_802_3_MIN) return proto; if (skb->len < sizeof(struct llc_snap_hdr)) @@ -483,7 +483,7 @@ static __be16 parse_ethertype(struct sk_buff *skb) __skb_pull(skb, sizeof(struct llc_snap_hdr)); - if (ntohs(llc->ethertype) >= 1536) + if (ntohs(llc->ethertype) >= ETH_P_802_3_MIN) return llc->ethertype; return htons(ETH_P_802_2); @@ -1038,7 +1038,7 @@ int ovs_flow_from_nlattrs(struct sw_flow_key *swkey, int *key_lenp, if (attrs & (1 << OVS_KEY_ATTR_ETHERTYPE)) { swkey->eth.type = nla_get_be16(a[OVS_KEY_ATTR_ETHERTYPE]); - if (ntohs(swkey->eth.type) < 1536) + if (ntohs(swkey->eth.type) < ETH_P_802_3_MIN) return -EINVAL; attrs &= ~(1 << OVS_KEY_ATTR_ETHERTYPE); } else { |
