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

Signed-off-by: Daniele Di Proietto <ddiproie...@vmware.com>
---
 datapath/flow_netlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/datapath/flow_netlink.c b/datapath/flow_netlink.c
index 6ae69e9..f0cf2ed 100644
--- a/datapath/flow_netlink.c
+++ b/datapath/flow_netlink.c
@@ -222,7 +222,7 @@ static bool match_validate(const struct sw_flow_match 
*match,
                                                
htons(NDISC_NEIGHBOUR_SOLICITATION) ||
                                    match->key->tp.src == 
htons(NDISC_NEIGHBOUR_ADVERTISEMENT)) {
                                        key_expected |= 1ULL << OVS_KEY_ATTR_ND;
-                                       if (match->mask && 
(match->mask->key.tp.src == htons(0xffff)))
+                                       if (match->mask && 
(match->mask->key.tp.src == htons(0xff)))
                                                mask_allowed |= 1ULL << 
OVS_KEY_ATTR_ND;
                                }
                        }
-- 
2.0.0

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to