[PATCH] nl80211: correct netlink attributes of set_supp_port() for MLD
Jouni Malinen
j at w1.fi
Sun Dec 22 14:06:07 PST 2024
On Fri, Nov 22, 2024 at 04:21:43PM +0800, Zong-Zhe Yang wrote:
> When MLD, wpa_driver_nl80211_set_supp_port() gets
> `nl80211: Failed to set STA flag: -22 (Invalid argument)`
> due to imprecise netlink attributes.
Would you be able to share a debug log showing that? I was unable to
reproduce that in my testing.
> For MLD, NL80211_ATTR_MLO_LINK_ID is required. Otherwise,
> sta_link_apply_parameters() cannot get the target link.
That sounds wrong since Authorization status is at MLD level and mixing
this with link ID would seem to imply this is being done at a different
level, but it is possible that there are some inconvenient constraints
in how NL80211_CMD_SET_STATION might need to be used.
> Additionally, for MLD, NL80211_ATTR_MAC describes "link" address.
> And, NL80211_ATTR_MLD_ADDR describes MLD address.
Adding NL80211_ATTR_MLD_ADDR would seem reasonable, but that need for
link specific information needs to be documented more clearly since this
function is for an MLD level operation and specifying a link ID here is
quite confusing.
> diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
> @@ -7730,6 +7732,16 @@ static int wpa_driver_nl80211_set_supp_port(void *priv, int authorized)
> + if (!mld)
> + goto send;
> +
> + if (nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, mld->assoc_link_id) ||
> + nla_put(msg, NL80211_ATTR_MLD_ADDR, ETH_ALEN, mld->ap_mld_addr)) {
> + nlmsg_free(msg);
> + return -ENOBUFS;
> + }
> +
> +send:
> ret = send_and_recv_cmd(drv, msg);
That would look nicer if the unnecessary goto were removed:
if (mld &&
(nla_put_u8(...) ||
nla_put(...)) {
...
}
--
Jouni Malinen PGP id EFC895FA
More information about the Hostap
mailing list