Skip to content

Commit

Permalink
wifi: mac80211: mlme: assign link address correctly
Browse files Browse the repository at this point in the history
Right now, we assign the link address only after we add
the link to the driver, which is quite obviously wrong.
It happens to work in many cases because it gets updated
immediately, and then link_conf updates may update it,
but it's clearly not really right.

Set the link address during ieee80211_mgd_setup_link()
so it's set before telling the driver about the link.

Fixes: 81151ce ("wifi: mac80211: support MLO authentication/association with one link")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Johannes Berg committed Sep 3, 2022
1 parent e73b5e5 commit acdc3e4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions net/mac80211/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -6323,6 +6323,8 @@ void ieee80211_mgd_setup_link(struct ieee80211_link_data *link)
if (sdata->u.mgd.assoc_data)
ether_addr_copy(link->conf->addr,
sdata->u.mgd.assoc_data->link[link_id].addr);
else if (!is_valid_ether_addr(link->conf->addr))
eth_random_addr(link->conf->addr);
}

/* scan finished notification */
Expand Down Expand Up @@ -6410,9 +6412,6 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata,
goto out_err;
}

if (mlo && !is_valid_ether_addr(link->conf->addr))
eth_random_addr(link->conf->addr);

if (WARN_ON(!ifmgd->auth_data && !ifmgd->assoc_data)) {
err = -EINVAL;
goto out_err;
Expand Down

0 comments on commit acdc3e4

Please sign in to comment.