A masked NSH set action has mdtype 0 because the mdtype is not being
changed, but odp_nsh_key_from_attr() rejects this because mdtype 0 does
not match up with the OVS_NSH_KEY_ATTR_MD1 attribute being present.  This
fixes the problem.

The kernel datapath in flow_netlink function nsh_key_put_from_nlattr() has
a similar exception.

Signed-off-by: Ben Pfaff <[email protected]>
---
 lib/odp-util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/odp-util.c b/lib/odp-util.c
index 6726869729e7..a3d0ab9362c1 100644
--- a/lib/odp-util.c
+++ b/lib/odp-util.c
@@ -2712,7 +2712,7 @@ odp_nsh_key_from_attr(const struct nlattr *attr, struct 
ovs_key_nsh *nsh,
         return ODP_FIT_TOO_MUCH;
     }
 
-    if (has_md1 && nsh->mdtype != NSH_M_TYPE1) {
+    if (has_md1 && nsh->mdtype != NSH_M_TYPE1 && !nsh_mask) {
         return ODP_FIT_ERROR;
     }
 
-- 
2.16.1

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to