Skip to content

Commit b303835

Browse files
committed
wifi: mac80211: accept STA changes without link changes
If there's no link ID, then check that there are no changes to the link, and if so accept them, unless a new link is created. While at it, reject creating a new link without an address. This fixes authorizing an MLD (peer) that has no link 0. Signed-off-by: Johannes Berg <[email protected]>
1 parent 7dad3e3 commit b303835

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

net/mac80211/cfg.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1610,6 +1610,18 @@ static int sta_link_apply_parameters(struct ieee80211_local *local,
16101610
rcu_dereference_protected(sta->link[link_id],
16111611
lockdep_is_held(&local->sta_mtx));
16121612

1613+
/*
1614+
* If there are no changes, then accept a link that doesn't exist,
1615+
* unless it's a new link.
1616+
*/
1617+
if (params->link_id < 0 && !new_link &&
1618+
!params->link_mac && !params->txpwr_set &&
1619+
!params->supported_rates_len &&
1620+
!params->ht_capa && !params->vht_capa &&
1621+
!params->he_capa && !params->eht_capa &&
1622+
!params->opmode_notif_used)
1623+
return 0;
1624+
16131625
if (!link || !link_sta)
16141626
return -EINVAL;
16151627

@@ -1625,6 +1637,8 @@ static int sta_link_apply_parameters(struct ieee80211_local *local,
16251637
params->link_mac)) {
16261638
return -EINVAL;
16271639
}
1640+
} else if (new_link) {
1641+
return -EINVAL;
16281642
}
16291643

16301644
if (params->txpwr_set) {

0 commit comments

Comments
 (0)