]> git.baikalelectronics.ru Git - kernel.git/commit
genetlink: properly support per-op policy dumping
authorJohannes Berg <johannes.berg@intel.com>
Sat, 3 Oct 2020 08:44:45 +0000 (10:44 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 3 Oct 2020 21:18:29 +0000 (14:18 -0700)
commit64a54c9a8e3a8333f435af2258d21912c65259a6
tree7ae6b7762283c2884046f05f5b277db61c773077
parente66eea3f52776f01eea5210662d6d977a5ad9f76
genetlink: properly support per-op policy dumping

Add support for per-op policy dumping. The data is pretty much
as before, except that now the assumption that the policy with
index 0 is "the" policy no longer holds - you now need to look
at the new CTRL_ATTR_OP_POLICY attribute which is a nested attr
(indexed by op) containing attributes for do and dump policies.

When a single op is requested, the CTRL_ATTR_OP_POLICY will be
added in the same way, since do and dump policies may differ.

v2:
 - conditionally advertise per-command policies only if there
   actually is a policy being used for the do/dump and it's
   present at all

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