summaryrefslogtreecommitdiff
path: root/lib/route/link
diff options
context:
space:
mode:
authorjauge-technica <102538870+jauge-technica@users.noreply.github.com>2022-03-28 17:37:52 +0200
committerThomas Haller <thaller@redhat.com>2022-03-28 17:47:24 +0200
commit7e96356b51a13940499358d94c1cbc085c5beb0a (patch)
treefdfa3f5f88ef12638ab184976c2c23663f347c04 /lib/route/link
parent4e153bc272e52c7b759ab124ec17b7fe95a496a4 (diff)
downloadlibnl-7e96356b51a13940499358d94c1cbc085c5beb0a.tar.gz
Check validation type against end of enum
The enum macsec_validation_type in the Linux Kernel has values 0-2. With the existing check >1, value STRICT (2) cannot be set. The check should be done against the end marker of the enum instead. https://github.com/thom311/libnl/pull/304
Diffstat (limited to 'lib/route/link')
-rw-r--r--lib/route/link/macsec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/route/link/macsec.c b/lib/route/link/macsec.c
index 4d26673d..04edc350 100644
--- a/lib/route/link/macsec.c
+++ b/lib/route/link/macsec.c
@@ -708,7 +708,7 @@ int rtnl_link_macsec_set_validation_type(struct rtnl_link *link, enum macsec_val
IS_MACSEC_LINK_ASSERT(link);
- if (validate > 1)
+ if (validate > MACSEC_VALIDATE_MAX)
return -NLE_INVAL;
info->validate = validate;