diff options
author | Rich Lane <rlane@bigswitch.com> | 2013-02-19 14:10:30 -0500 |
---|---|---|
committer | Jesse Gross <jesse@nicira.com> | 2013-02-22 20:02:28 -0500 |
commit | 17b682a04841233f827073b327c6533e478dfcd4 (patch) | |
tree | 8ae17d165f5cec82ccf3d5a012c6fca3d585100f /net/openvswitch/flow.c | |
parent | a15ff76c955d17cf58313097e4a24124da022b1d (diff) |
openvswitch: Fix parsing invalid LLC/SNAP ethertypes
Before this patch, if an LLC/SNAP packet with OUI 00:00:00 had an
ethertype less than 1536 the flow key given to userspace in the upcall
would contain the invalid ethertype (for example, 3). If userspace
attempted to insert a kernel flow for this key it would be rejected
by ovs_flow_from_nlattrs.
This patch allows OVS to pass the OFTest pktact.DirectBadLlcPackets.
Signed-off-by: Rich Lane <rlane@bigswitch.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Diffstat (limited to 'net/openvswitch/flow.c')
-rw-r--r-- | net/openvswitch/flow.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c index c3294cebc4f2..0c98d406124b 100644 --- a/net/openvswitch/flow.c +++ b/net/openvswitch/flow.c | |||
@@ -484,7 +484,11 @@ static __be16 parse_ethertype(struct sk_buff *skb) | |||
484 | return htons(ETH_P_802_2); | 484 | return htons(ETH_P_802_2); |
485 | 485 | ||
486 | __skb_pull(skb, sizeof(struct llc_snap_hdr)); | 486 | __skb_pull(skb, sizeof(struct llc_snap_hdr)); |
487 | return llc->ethertype; | 487 | |
488 | if (ntohs(llc->ethertype) >= 1536) | ||
489 | return llc->ethertype; | ||
490 | |||
491 | return htons(ETH_P_802_2); | ||
488 | } | 492 | } |
489 | 493 | ||
490 | static int parse_icmpv6(struct sk_buff *skb, struct sw_flow_key *key, | 494 | static int parse_icmpv6(struct sk_buff *skb, struct sw_flow_key *key, |