The 'type' verification is incorrect, leading to a dead code warning.
The value OVS_NSH_KEY_ATTR_MAX represents the maximum value, not the
maximum plus one. This fix ensures that the OVS_NSH_KEY_ATTR_MD2 case
is reachable by changing the condition from 'greater than or equal'
to 'greater than'."
Fixes: 81fdabb94dd7 ("nsh: fix nested mask for OVS_KEY_ATTR_NSH")
Signed-off-by: Eelco Chaudron <[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 d3245223d..7c80a7e88 100644
--- a/lib/odp-util.c
+++ b/lib/odp-util.c
@@ -1056,7 +1056,7 @@ format_odp_set_nsh(struct ds *ds, const struct nlattr
*attr)
enum ovs_nsh_key_attr type = nl_attr_type(a);
size_t len = nl_attr_get_size(a);
- if (type >= OVS_NSH_KEY_ATTR_MAX) {
+ if (type > OVS_NSH_KEY_ATTR_MAX) {
return;
}
--
2.46.0
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev