]> git.baikalelectronics.ru Git - kernel.git/commit
netlink: add validation function to policy
authorJohannes Berg <johannes.berg@intel.com>
Thu, 27 Sep 2018 09:28:36 +0000 (11:28 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 2 Oct 2018 06:05:31 +0000 (23:05 -0700)
commit95768b239dfbe7c37007f7e3f025e17155a84dcf
treebd3980a02a9896a5a1d60936b451ce40efc44349
parent1bd1a5ccf98097a9c9182d5554a8a295a7cbd6ff
netlink: add validation function to policy

Add the ability to have an arbitrary validation function attached
to a netlink policy that doesn't already use the validation_data
pointer in another way.

This can be useful to validate for example the content of a binary
attribute, like in nl80211 the "(information) elements", which must
be valid streams of "u8 type, u8 length, u8 value[length]".

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