diff options
author | Johannes Berg <johannes.berg@intel.com> | 2017-04-12 14:34:05 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-04-13 13:58:21 -0400 |
commit | 7ab606d1609dd6dfeae9c8ad0a8a4e051d831e46 (patch) | |
tree | 728e0cb253e015687ce18a153eca94f6b99f153b /include/net | |
parent | 2d4bc93368f5a0ddb57c8c885cdad9c9b7a10ed5 (diff) | |
download | linux-7ab606d1609dd6dfeae9c8ad0a8a4e051d831e46.tar.bz2 |
genetlink: pass extended ACK report down
Pass the extended ACK reporting struct down from generic netlink to
the families, using the existing struct genl_info for simplicity.
Also add support to set the extended ACK information from generic
netlink users.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/genetlink.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index a34275be3600..f18db6570f52 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h @@ -84,6 +84,7 @@ struct nlattr **genl_family_attrbuf(const struct genl_family *family); * @attrs: netlink attributes * @_net: network namespace * @user_ptr: user pointers + * @extack: extended ACK report struct */ struct genl_info { u32 snd_seq; @@ -94,6 +95,7 @@ struct genl_info { struct nlattr ** attrs; possible_net_t _net; void * user_ptr[2]; + struct netlink_ext_ack *extack; }; static inline struct net *genl_info_net(struct genl_info *info) @@ -106,6 +108,16 @@ static inline void genl_info_net_set(struct genl_info *info, struct net *net) write_pnet(&info->_net, net); } +#define GENL_SET_ERR_MSG(info, msg) NL_SET_ERR_MSG((info)->extack, msg) + +static inline int genl_err_attr(struct genl_info *info, int err, + struct nlattr *attr) +{ + info->extack->bad_attr = attr; + + return err; +} + /** * struct genl_ops - generic netlink operations * @cmd: command identifier |