summaryrefslogtreecommitdiffstats
path: root/include/net/genetlink.h
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2020-10-02 23:49:57 +0200
committerDavid S. Miller <davem@davemloft.net>2020-10-03 04:11:12 +0200
commit48526a0f4ca2b484cab4318dc0b2c2be1d8685b7 (patch)
tree4f3c795650dde693e5238ec4ffde5aa80c343d4f /include/net/genetlink.h
parentgenetlink: use .start callback for dumppolicy (diff)
downloadlinux-48526a0f4ca2b484cab4318dc0b2c2be1d8685b7.tar.xz
linux-48526a0f4ca2b484cab4318dc0b2c2be1d8685b7.zip
genetlink: bring back per op policy
Add policy to the struct genl_ops structure, this time with maxattr, so it can be used properly. Propagate .policy and .maxattr from the family in genl_get_cmd() if needed, this way the rest of the code does not have to worry if the policy is per op or global. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Reviewed-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/genetlink.h')
-rw-r--r--include/net/genetlink.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index 8ea1fc1ed1c7..cb35625d001e 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -137,6 +137,8 @@ struct genl_small_ops {
* @cmd: command identifier
* @internal_flags: flags used by the family
* @flags: flags
+ * @maxattr: maximum number of attributes supported
+ * @policy: netlink policy (takes precedence over family policy)
* @doit: standard command callback
* @start: start callback for dumps
* @dumpit: callback for dumpers
@@ -149,6 +151,8 @@ struct genl_ops {
int (*dumpit)(struct sk_buff *skb,
struct netlink_callback *cb);
int (*done)(struct netlink_callback *cb);
+ const struct nla_policy *policy;
+ unsigned int maxattr;
u8 cmd;
u8 internal_flags;
u8 flags;