diff options
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) | |||
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 { |