diff options
author | jauge-technica <102538870+jauge-technica@users.noreply.github.com> | 2022-03-28 17:37:52 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2022-03-28 17:47:24 +0200 |
commit | 7e96356b51a13940499358d94c1cbc085c5beb0a (patch) | |
tree | fdfa3f5f88ef12638ab184976c2c23663f347c04 /lib/route/link | |
parent | 4e153bc272e52c7b759ab124ec17b7fe95a496a4 (diff) | |
download | libnl-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.c | 2 |
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; |