Skip to content

Commit

Permalink
odp-util: Avoid revalidation error for masked NSH set action.
Browse files Browse the repository at this point in the history
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.

Acked-by: Justin Pettit <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
blp committed Jan 18, 2019
1 parent 29b5c0c commit 3c61cc7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/odp-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 3c61cc7

Please sign in to comment.