summaryrefslogtreecommitdiff
path: root/lib/nlattr.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2020-04-30 22:13:09 +0200
committerDavid S. Miller <davem@davemloft.net>2020-04-30 17:51:42 -0700
commitda4063bdfcfa70ec57a6c25f772ac6378b1584ad (patch)
tree5c696cde25b78db8ee4437f71d27709296213ffe /lib/nlattr.c
parentd06a09b94c618c96ced584dd4611a888c8856b8d (diff)
netlink: allow NLA_MSECS to have range validation
Since NLA_MSECS is really equivalent to NLA_U64, allow it to have range validation as well. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib/nlattr.c')
-rw-r--r--lib/nlattr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/nlattr.c b/lib/nlattr.c
index a8beb173f558..21ef3998b9d9 100644
--- a/lib/nlattr.c
+++ b/lib/nlattr.c
@@ -151,6 +151,7 @@ static int nla_validate_int_range_unsigned(const struct nla_policy *pt,
value = nla_get_u32(nla);
break;
case NLA_U64:
+ case NLA_MSECS:
value = nla_get_u64(nla);
break;
default:
@@ -227,6 +228,7 @@ static int nla_validate_int_range(const struct nla_policy *pt,
case NLA_U16:
case NLA_U32:
case NLA_U64:
+ case NLA_MSECS:
return nla_validate_int_range_unsigned(pt, nla, extack);
case NLA_S8:
case NLA_S16: