]> git.baikalelectronics.ru Git - kernel.git/commit
netlink: allow NLA_NESTED to specify nested policy to validate
authorJohannes Berg <johannes.berg@intel.com>
Wed, 26 Sep 2018 09:15:33 +0000 (11:15 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 28 Sep 2018 17:24:39 +0000 (10:24 -0700)
commitd71a3e1a2ce3d7bc19fc9ec35038fc209fc35d86
tree0a551784a6b946553793306790e75e1bb69d4f83
parent1f00203d3c9282d9594bcfc45c3dc9a6fb5ebf63
netlink: allow NLA_NESTED to specify nested policy to validate

Now that we have a validation_data pointer, and the len field in
the policy is unused for NLA_NESTED, we can allow using them both
to have nested validation. This can be nice in code, although we
still have to use nla_parse_nested() or similar which would also
take a policy; however, it also serves as documentation in the
policy without requiring a look at the code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/netlink.h
lib/nlattr.c