netlink: pass extended ACK struct to parsing functions
Pass the new extended ACK reporting struct to all of the generic netlink parsing functions. For now, pass NULL in almost all callers (except for some in the core.) Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
ba0dc5f6e0
commit
fceb6435e8
@@ -802,7 +802,7 @@ int tipc_nl_bearer_get(struct sk_buff *skb, struct genl_info *info)
|
||||
|
||||
err = nla_parse_nested(attrs, TIPC_NLA_BEARER_MAX,
|
||||
info->attrs[TIPC_NLA_BEARER],
|
||||
tipc_nl_bearer_policy);
|
||||
tipc_nl_bearer_policy, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -851,7 +851,7 @@ int tipc_nl_bearer_disable(struct sk_buff *skb, struct genl_info *info)
|
||||
|
||||
err = nla_parse_nested(attrs, TIPC_NLA_BEARER_MAX,
|
||||
info->attrs[TIPC_NLA_BEARER],
|
||||
tipc_nl_bearer_policy);
|
||||
tipc_nl_bearer_policy, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -891,7 +891,7 @@ int tipc_nl_bearer_enable(struct sk_buff *skb, struct genl_info *info)
|
||||
|
||||
err = nla_parse_nested(attrs, TIPC_NLA_BEARER_MAX,
|
||||
info->attrs[TIPC_NLA_BEARER],
|
||||
tipc_nl_bearer_policy);
|
||||
tipc_nl_bearer_policy, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -939,7 +939,7 @@ int tipc_nl_bearer_add(struct sk_buff *skb, struct genl_info *info)
|
||||
|
||||
err = nla_parse_nested(attrs, TIPC_NLA_BEARER_MAX,
|
||||
info->attrs[TIPC_NLA_BEARER],
|
||||
tipc_nl_bearer_policy);
|
||||
tipc_nl_bearer_policy, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -982,7 +982,7 @@ int tipc_nl_bearer_set(struct sk_buff *skb, struct genl_info *info)
|
||||
|
||||
err = nla_parse_nested(attrs, TIPC_NLA_BEARER_MAX,
|
||||
info->attrs[TIPC_NLA_BEARER],
|
||||
tipc_nl_bearer_policy);
|
||||
tipc_nl_bearer_policy, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -1104,7 +1104,7 @@ int tipc_nl_media_get(struct sk_buff *skb, struct genl_info *info)
|
||||
|
||||
err = nla_parse_nested(attrs, TIPC_NLA_MEDIA_MAX,
|
||||
info->attrs[TIPC_NLA_MEDIA],
|
||||
tipc_nl_media_policy);
|
||||
tipc_nl_media_policy, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -1152,7 +1152,7 @@ int tipc_nl_media_set(struct sk_buff *skb, struct genl_info *info)
|
||||
|
||||
err = nla_parse_nested(attrs, TIPC_NLA_MEDIA_MAX,
|
||||
info->attrs[TIPC_NLA_MEDIA],
|
||||
tipc_nl_media_policy);
|
||||
tipc_nl_media_policy, NULL);
|
||||
|
||||
if (!attrs[TIPC_NLA_MEDIA_NAME])
|
||||
return -EINVAL;
|
||||
|
@@ -1827,7 +1827,7 @@ int tipc_nl_parse_link_prop(struct nlattr *prop, struct nlattr *props[])
|
||||
int err;
|
||||
|
||||
err = nla_parse_nested(props, TIPC_NLA_PROP_MAX, prop,
|
||||
tipc_nl_prop_policy);
|
||||
tipc_nl_prop_policy, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
|
@@ -211,8 +211,8 @@ int tipc_nl_net_set(struct sk_buff *skb, struct genl_info *info)
|
||||
return -EINVAL;
|
||||
|
||||
err = nla_parse_nested(attrs, TIPC_NLA_NET_MAX,
|
||||
info->attrs[TIPC_NLA_NET],
|
||||
tipc_nl_net_policy);
|
||||
info->attrs[TIPC_NLA_NET], tipc_nl_net_policy,
|
||||
NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
|
@@ -268,7 +268,8 @@ int tipc_nlmsg_parse(const struct nlmsghdr *nlh, struct nlattr ***attr)
|
||||
if (!*attr)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
return nlmsg_parse(nlh, GENL_HDRLEN, *attr, maxattr, tipc_nl_policy);
|
||||
return nlmsg_parse(nlh, GENL_HDRLEN, *attr, maxattr, tipc_nl_policy,
|
||||
NULL);
|
||||
}
|
||||
|
||||
int __init tipc_netlink_start(void)
|
||||
|
@@ -296,7 +296,7 @@ static int __tipc_nl_compat_doit(struct tipc_nl_compat_cmd_doit *cmd,
|
||||
|
||||
err = nla_parse(attrbuf, tipc_genl_family.maxattr,
|
||||
(const struct nlattr *)trans_buf->data,
|
||||
trans_buf->len, NULL);
|
||||
trans_buf->len, NULL, NULL);
|
||||
if (err)
|
||||
goto parse_out;
|
||||
|
||||
@@ -352,7 +352,7 @@ static int tipc_nl_compat_bearer_dump(struct tipc_nl_compat_msg *msg,
|
||||
return -EINVAL;
|
||||
|
||||
err = nla_parse_nested(bearer, TIPC_NLA_BEARER_MAX,
|
||||
attrs[TIPC_NLA_BEARER], NULL);
|
||||
attrs[TIPC_NLA_BEARER], NULL, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -472,7 +472,7 @@ static int tipc_nl_compat_link_stat_dump(struct tipc_nl_compat_msg *msg,
|
||||
return -EINVAL;
|
||||
|
||||
err = nla_parse_nested(link, TIPC_NLA_LINK_MAX, attrs[TIPC_NLA_LINK],
|
||||
NULL);
|
||||
NULL, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -480,7 +480,7 @@ static int tipc_nl_compat_link_stat_dump(struct tipc_nl_compat_msg *msg,
|
||||
return -EINVAL;
|
||||
|
||||
err = nla_parse_nested(prop, TIPC_NLA_PROP_MAX,
|
||||
link[TIPC_NLA_LINK_PROP], NULL);
|
||||
link[TIPC_NLA_LINK_PROP], NULL, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -488,7 +488,7 @@ static int tipc_nl_compat_link_stat_dump(struct tipc_nl_compat_msg *msg,
|
||||
return -EINVAL;
|
||||
|
||||
err = nla_parse_nested(stats, TIPC_NLA_STATS_MAX,
|
||||
link[TIPC_NLA_LINK_STATS], NULL);
|
||||
link[TIPC_NLA_LINK_STATS], NULL, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -598,7 +598,7 @@ static int tipc_nl_compat_link_dump(struct tipc_nl_compat_msg *msg,
|
||||
return -EINVAL;
|
||||
|
||||
err = nla_parse_nested(link, TIPC_NLA_LINK_MAX, attrs[TIPC_NLA_LINK],
|
||||
NULL);
|
||||
NULL, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -795,7 +795,7 @@ static int tipc_nl_compat_name_table_dump(struct tipc_nl_compat_msg *msg,
|
||||
return -EINVAL;
|
||||
|
||||
err = nla_parse_nested(nt, TIPC_NLA_NAME_TABLE_MAX,
|
||||
attrs[TIPC_NLA_NAME_TABLE], NULL);
|
||||
attrs[TIPC_NLA_NAME_TABLE], NULL, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -803,7 +803,7 @@ static int tipc_nl_compat_name_table_dump(struct tipc_nl_compat_msg *msg,
|
||||
return -EINVAL;
|
||||
|
||||
err = nla_parse_nested(publ, TIPC_NLA_PUBL_MAX,
|
||||
nt[TIPC_NLA_NAME_TABLE_PUBL], NULL);
|
||||
nt[TIPC_NLA_NAME_TABLE_PUBL], NULL, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -863,7 +863,7 @@ static int __tipc_nl_compat_publ_dump(struct tipc_nl_compat_msg *msg,
|
||||
return -EINVAL;
|
||||
|
||||
err = nla_parse_nested(publ, TIPC_NLA_PUBL_MAX, attrs[TIPC_NLA_PUBL],
|
||||
NULL);
|
||||
NULL, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -929,7 +929,7 @@ static int tipc_nl_compat_sk_dump(struct tipc_nl_compat_msg *msg,
|
||||
return -EINVAL;
|
||||
|
||||
err = nla_parse_nested(sock, TIPC_NLA_SOCK_MAX, attrs[TIPC_NLA_SOCK],
|
||||
NULL);
|
||||
NULL, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -940,8 +940,8 @@ static int tipc_nl_compat_sk_dump(struct tipc_nl_compat_msg *msg,
|
||||
u32 node;
|
||||
struct nlattr *con[TIPC_NLA_CON_MAX + 1];
|
||||
|
||||
nla_parse_nested(con, TIPC_NLA_CON_MAX, sock[TIPC_NLA_SOCK_CON],
|
||||
NULL);
|
||||
nla_parse_nested(con, TIPC_NLA_CON_MAX,
|
||||
sock[TIPC_NLA_SOCK_CON], NULL, NULL);
|
||||
|
||||
node = nla_get_u32(con[TIPC_NLA_CON_NODE]);
|
||||
tipc_tlv_sprintf(msg->rep, " connected to <%u.%u.%u:%u>",
|
||||
@@ -977,8 +977,8 @@ static int tipc_nl_compat_media_dump(struct tipc_nl_compat_msg *msg,
|
||||
if (!attrs[TIPC_NLA_MEDIA])
|
||||
return -EINVAL;
|
||||
|
||||
err = nla_parse_nested(media, TIPC_NLA_MEDIA_MAX, attrs[TIPC_NLA_MEDIA],
|
||||
NULL);
|
||||
err = nla_parse_nested(media, TIPC_NLA_MEDIA_MAX,
|
||||
attrs[TIPC_NLA_MEDIA], NULL, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -998,7 +998,7 @@ static int tipc_nl_compat_node_dump(struct tipc_nl_compat_msg *msg,
|
||||
return -EINVAL;
|
||||
|
||||
err = nla_parse_nested(node, TIPC_NLA_NODE_MAX, attrs[TIPC_NLA_NODE],
|
||||
NULL);
|
||||
NULL, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -1045,7 +1045,7 @@ static int tipc_nl_compat_net_dump(struct tipc_nl_compat_msg *msg,
|
||||
return -EINVAL;
|
||||
|
||||
err = nla_parse_nested(net, TIPC_NLA_NET_MAX, attrs[TIPC_NLA_NET],
|
||||
NULL);
|
||||
NULL, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
|
@@ -1607,8 +1607,8 @@ int tipc_nl_peer_rm(struct sk_buff *skb, struct genl_info *info)
|
||||
return -EINVAL;
|
||||
|
||||
err = nla_parse_nested(attrs, TIPC_NLA_NET_MAX,
|
||||
info->attrs[TIPC_NLA_NET],
|
||||
tipc_nl_net_policy);
|
||||
info->attrs[TIPC_NLA_NET], tipc_nl_net_policy,
|
||||
NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -1774,7 +1774,7 @@ int tipc_nl_node_set_link(struct sk_buff *skb, struct genl_info *info)
|
||||
|
||||
err = nla_parse_nested(attrs, TIPC_NLA_LINK_MAX,
|
||||
info->attrs[TIPC_NLA_LINK],
|
||||
tipc_nl_link_policy);
|
||||
tipc_nl_link_policy, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -1902,7 +1902,7 @@ int tipc_nl_node_reset_link_stats(struct sk_buff *skb, struct genl_info *info)
|
||||
|
||||
err = nla_parse_nested(attrs, TIPC_NLA_LINK_MAX,
|
||||
info->attrs[TIPC_NLA_LINK],
|
||||
tipc_nl_link_policy);
|
||||
tipc_nl_link_policy, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -2042,7 +2042,7 @@ int tipc_nl_node_set_monitor(struct sk_buff *skb, struct genl_info *info)
|
||||
|
||||
err = nla_parse_nested(attrs, TIPC_NLA_MON_MAX,
|
||||
info->attrs[TIPC_NLA_MON],
|
||||
tipc_nl_monitor_policy);
|
||||
tipc_nl_monitor_policy, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -2163,7 +2163,7 @@ int tipc_nl_node_dump_monitor_peer(struct sk_buff *skb,
|
||||
|
||||
err = nla_parse_nested(mon, TIPC_NLA_MON_MAX,
|
||||
attrs[TIPC_NLA_MON],
|
||||
tipc_nl_monitor_policy);
|
||||
tipc_nl_monitor_policy, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
|
@@ -2866,7 +2866,7 @@ int tipc_nl_publ_dump(struct sk_buff *skb, struct netlink_callback *cb)
|
||||
|
||||
err = nla_parse_nested(sock, TIPC_NLA_SOCK_MAX,
|
||||
attrs[TIPC_NLA_SOCK],
|
||||
tipc_nl_sock_policy);
|
||||
tipc_nl_sock_policy, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
|
@@ -457,7 +457,7 @@ int tipc_udp_nl_dump_remoteip(struct sk_buff *skb, struct netlink_callback *cb)
|
||||
|
||||
err = nla_parse_nested(battrs, TIPC_NLA_BEARER_MAX,
|
||||
attrs[TIPC_NLA_BEARER],
|
||||
tipc_nl_bearer_policy);
|
||||
tipc_nl_bearer_policy, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -609,7 +609,8 @@ int tipc_udp_nl_bearer_add(struct tipc_bearer *b, struct nlattr *attr)
|
||||
struct nlattr *opts[TIPC_NLA_UDP_MAX + 1];
|
||||
struct udp_media_addr *dst;
|
||||
|
||||
if (nla_parse_nested(opts, TIPC_NLA_UDP_MAX, attr, tipc_nl_udp_policy))
|
||||
if (nla_parse_nested(opts, TIPC_NLA_UDP_MAX, attr,
|
||||
tipc_nl_udp_policy, NULL))
|
||||
return -EINVAL;
|
||||
|
||||
if (!opts[TIPC_NLA_UDP_REMOTE])
|
||||
@@ -662,7 +663,7 @@ static int tipc_udp_enable(struct net *net, struct tipc_bearer *b,
|
||||
|
||||
if (nla_parse_nested(opts, TIPC_NLA_UDP_MAX,
|
||||
attrs[TIPC_NLA_BEARER_UDP_OPTS],
|
||||
tipc_nl_udp_policy))
|
||||
tipc_nl_udp_policy, NULL))
|
||||
goto err;
|
||||
|
||||
if (!opts[TIPC_NLA_UDP_LOCAL] || !opts[TIPC_NLA_UDP_REMOTE]) {
|
||||
|
Reference in New Issue
Block a user