summaryrefslogtreecommitdiffstats
path: root/net/openvswitch/flow_netlink.c
diff options
context:
space:
mode:
authorDaniele Di Proietto <ddiproietto@vmware.com>2014-11-11 23:51:22 +0100
committerPravin B Shelar <pshelar@nicira.com>2014-11-15 00:13:26 +0100
commit19e7a3df7261c9b7ebced8163c383712d5b6ac6b (patch)
tree528fdd69bfd422bc9d8c0150ed724c0500a07623 /net/openvswitch/flow_netlink.c
parentopenvswitch: Fix checksum calculation when modifying ICMPv6 packets. (diff)
downloadlinux-19e7a3df7261c9b7ebced8163c383712d5b6ac6b.tar.xz
linux-19e7a3df7261c9b7ebced8163c383712d5b6ac6b.zip
openvswitch: Fix NDP flow mask validation
match_validate() enforce that a mask matching on NDP attributes has also an exact match on ICMPv6 type. The ICMPv6 type, which is 8-bit wide, is stored in the 'tp.src' field of 'struct sw_flow_key', which is 16-bit wide. Therefore, an exact match on ICMPv6 type should only check the first 8 bits. This commit fixes a bug that prevented flows with an exact match on NDP field from being installed Introduced by commit 03f0d916aa03 ("openvswitch: Mega flow implementation"). Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com> Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Diffstat (limited to 'net/openvswitch/flow_netlink.c')
-rw-r--r--net/openvswitch/flow_netlink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c
index 939bcb32100f..dda040e693a3 100644
--- a/net/openvswitch/flow_netlink.c
+++ b/net/openvswitch/flow_netlink.c
@@ -145,7 +145,7 @@ static bool match_validate(const struct sw_flow_match *match,
if (match->key->eth.type == htons(ETH_P_ARP)
|| match->key->eth.type == htons(ETH_P_RARP)) {
key_expected |= 1 << OVS_KEY_ATTR_ARP;
- if (match->mask && (match->mask->key.eth.type == htons(0xffff)))
+ if (match->mask && (match->mask->key.tp.src == htons(0xff)))
mask_allowed |= 1 << OVS_KEY_ATTR_ARP;
}