Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fe52145f authored by Johannes Berg's avatar Johannes Berg Committed by David S. Miller
Browse files

netlink: pass extended ACK struct where available



This is an add-on to the previous patch that passes the extended ACK
structure where it's already available by existing genl_info or extack
function arguments.

This was done with this spatch (with some manual adjustment of
indentation):

@@
expression A, B, C, D, E;
identifier fn, info;
@@
fn(..., struct genl_info *info, ...) {
...
-nlmsg_parse(A, B, C, D, E, NULL)
+nlmsg_parse(A, B, C, D, E, info->extack)
...
}

@@
expression A, B, C, D, E;
identifier fn, info;
@@
fn(..., struct genl_info *info, ...) {
<...
-nla_parse_nested(A, B, C, D, NULL)
+nla_parse_nested(A, B, C, D, info->extack)
...>
}

@@
expression A, B, C, D, E;
identifier fn, extack;
@@
fn(..., struct netlink_ext_ack *extack, ...) {
<...
-nlmsg_parse(A, B, C, D, E, NULL)
+nlmsg_parse(A, B, C, D, E, extack)
...>
}

@@
expression A, B, C, D, E;
identifier fn, extack;
@@
fn(..., struct netlink_ext_ack *extack, ...) {
<...
-nla_parse(A, B, C, D, E, NULL)
+nla_parse(A, B, C, D, E, extack)
...>
}

@@
expression A, B, C, D, E;
identifier fn, extack;
@@
fn(..., struct netlink_ext_ack *extack, ...) {
...
-nlmsg_parse(A, B, C, D, E, NULL)
+nlmsg_parse(A, B, C, D, E, extack)
...
}

@@
expression A, B, C, D;
identifier fn, extack;
@@
fn(..., struct netlink_ext_ack *extack, ...) {
<...
-nla_parse_nested(A, B, C, D, NULL)
+nla_parse_nested(A, B, C, D, extack)
...>
}

@@
expression A, B, C, D;
identifier fn, extack;
@@
fn(..., struct netlink_ext_ack *extack, ...) {
<...
-nlmsg_validate(A, B, C, D, NULL)
+nlmsg_validate(A, B, C, D, extack)
...>
}

@@
expression A, B, C, D;
identifier fn, extack;
@@
fn(..., struct netlink_ext_ack *extack, ...) {
<...
-nla_validate(A, B, C, D, NULL)
+nla_validate(A, B, C, D, extack)
...>
}

@@
expression A, B, C;
identifier fn, extack;
@@
fn(..., struct netlink_ext_ack *extack, ...) {
<...
-nla_validate_nested(A, B, C, NULL)
+nla_validate_nested(A, B, C, extack)
...>
}

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fceb6435
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -523,7 +523,7 @@ static int crypto_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh,
	}

	err = nlmsg_parse(nlh, crypto_msg_min[type], attrs, CRYPTOCFGA_MAX,
			  crypto_policy, NULL);
			  crypto_policy, extack);
	if (err < 0)
		return err;

+2 −1
Original line number Diff line number Diff line
@@ -2471,7 +2471,8 @@ static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info)
			goto team_put;
		}
		err = nla_parse_nested(opt_attrs, TEAM_ATTR_OPTION_MAX,
				       nl_option, team_nl_option_policy, NULL);
				       nl_option, team_nl_option_policy,
				       info->extack);
		if (err)
			goto team_put;
		if (!opt_attrs[TEAM_ATTR_OPTION_NAME] ||
+5 −5
Original line number Diff line number Diff line
@@ -1564,7 +1564,7 @@ static int nl802154_add_llsec_key(struct sk_buff *skb, struct genl_info *info)

	if (nla_parse_nested(attrs, NL802154_KEY_ATTR_MAX,
			     info->attrs[NL802154_ATTR_SEC_KEY],
			     nl802154_key_policy, NULL))
			     nl802154_key_policy, info->extack))
		return -EINVAL;

	if (!attrs[NL802154_KEY_ATTR_USAGE_FRAMES] ||
@@ -1614,7 +1614,7 @@ static int nl802154_del_llsec_key(struct sk_buff *skb, struct genl_info *info)

	if (nla_parse_nested(attrs, NL802154_KEY_ATTR_MAX,
			     info->attrs[NL802154_ATTR_SEC_KEY],
			     nl802154_key_policy, NULL))
			     nl802154_key_policy, info->extack))
		return -EINVAL;

	if (ieee802154_llsec_parse_key_id(attrs[NL802154_KEY_ATTR_ID], &id) < 0)
@@ -1782,7 +1782,7 @@ static int nl802154_del_llsec_dev(struct sk_buff *skb, struct genl_info *info)

	if (nla_parse_nested(attrs, NL802154_DEV_ATTR_MAX,
			     info->attrs[NL802154_ATTR_SEC_DEVICE],
			     nl802154_dev_policy, NULL))
			     nl802154_dev_policy, info->extack))
		return -EINVAL;

	if (!attrs[NL802154_DEV_ATTR_EXTENDED_ADDR])
@@ -1910,7 +1910,7 @@ static int nl802154_add_llsec_devkey(struct sk_buff *skb, struct genl_info *info
	if (!info->attrs[NL802154_ATTR_SEC_DEVKEY] ||
	    nla_parse_nested(attrs, NL802154_DEVKEY_ATTR_MAX,
			     info->attrs[NL802154_ATTR_SEC_DEVKEY],
			     nl802154_devkey_policy, NULL) < 0)
			     nl802154_devkey_policy, info->extack) < 0)
		return -EINVAL;

	if (!attrs[NL802154_DEVKEY_ATTR_FRAME_COUNTER] ||
@@ -1942,7 +1942,7 @@ static int nl802154_del_llsec_devkey(struct sk_buff *skb, struct genl_info *info

	if (nla_parse_nested(attrs, NL802154_DEVKEY_ATTR_MAX,
			     info->attrs[NL802154_ATTR_SEC_DEVKEY],
			     nl802154_devkey_policy, NULL))
			     nl802154_devkey_policy, info->extack))
		return -EINVAL;

	if (!attrs[NL802154_DEVKEY_ATTR_EXTENDED_ADDR])
+1 −1
Original line number Diff line number Diff line
@@ -3532,7 +3532,7 @@ static int ip_vs_genl_set_daemon(struct sk_buff *skb, struct genl_info *info)
		if (!info->attrs[IPVS_CMD_ATTR_DAEMON] ||
		    nla_parse_nested(daemon_attrs, IPVS_DAEMON_ATTR_MAX,
				     info->attrs[IPVS_CMD_ATTR_DAEMON],
				     ip_vs_daemon_policy, NULL))
				     ip_vs_daemon_policy, info->extack))
			goto out;

		if (cmd == IPVS_CMD_NEW_DAEMON)
+1 −1
Original line number Diff line number Diff line
@@ -193,7 +193,7 @@ static int nfnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh,
		__u8 subsys_id = NFNL_SUBSYS_ID(type);

		err = nla_parse(cda, ss->cb[cb_id].attr_count, attr, attrlen,
				ss->cb[cb_id].policy, NULL);
				ss->cb[cb_id].policy, extack);
		if (err < 0) {
			rcu_read_unlock();
			return err;
Loading