From: Piotr Kubik <piotr@kubik.pl>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Tamizh Chelvam Raja <tamizh.raja@oss.qualcomm.com>,
Muna Sinada <muna.sinada@oss.qualcomm.com>,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
Piotr Kubik <piotr@kubik.pl>,
stable@vger.kernel.org
Subject: [PATCH wireless 2/2] wifi: mac80211: set the link addresses of a 4-address AP_VLAN before its links
Date: Tue, 20 Oct 2026 14:44:46 +0200 [thread overview]
Message-ID: <20261020124446.188739-3-piotr@kubik.pl> (raw)
In-Reply-To: <20261020124446.188739-1-piotr@kubik.pl>
ieee80211_set_sta_4addr() gives the AP_VLAN of a 4-address MLD station
the links of that station. It added the links first and set
wdev->links[].addr afterwards, from the link_conf of the AP_VLAN
itself. ieee80211_link_init() takes the address of a new link from
wdev->links[].addr, so a link that the station gained later came up
with the zero address that an earlier call had set, and the copy from
its own link_conf kept it at zero. With two such links,
ieee80211_check_dup_link_addrs() refuses the change with -EALREADY,
and the station stays on the AP interface instead of its AP_VLAN.
Set the addresses from the link_conf of the AP before the links are
added, as the AP_VLAN link update in link.c does.
Fixes: 469d5d5a3b7a ("wifi: mac80211: synchronize valid links for WDS AP_VLAN interfaces")
Cc: stable@vger.kernel.org
Signed-off-by: Piotr Kubik <piotr@kubik.pl>
---
net/mac80211/cfg.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2823,26 +2823,29 @@ static int ieee80211_set_sta_4addr(struc
wdev->valid_links = new_links;
- err = ieee80211_vif_set_links(sdata, new_links, 0);
- if (err) {
- wdev->valid_links = orig_links;
- return err;
- }
-
master_iter = master->vif.valid_links;
+ /* ieee80211_link_init() takes the address of a new link from
+ * wdev->links, so set it before the links are added.
+ */
for_each_set_bit(link_id, &master_iter,
IEEE80211_MLD_MAX_NUM_LINKS) {
if (!(sta_links & BIT(link_id))) {
eth_zero_addr(wdev->links[link_id].addr);
} else {
link_conf = wiphy_dereference(wiphy,
- vif->link_conf[link_id]);
+ master->vif.link_conf[link_id]);
ether_addr_copy(wdev->links[link_id].addr,
link_conf->bssid);
}
}
+
+ err = ieee80211_vif_set_links(sdata, new_links, 0);
+ if (err) {
+ wdev->valid_links = orig_links;
+ return err;
+ }
}
rcu_assign_pointer(sdata->u.vlan.sta, sta);
next prev parent reply other threads:[~2026-10-20 12:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-20 12:44 [PATCH wireless 0/2] wifi: mac80211: fix link changes of 4-address MLD stations Piotr Kubik
2026-10-20 12:44 ` [PATCH wireless 1/2] wifi: mac80211: change the links of an AP_VLAN station through its AP Piotr Kubik
2026-10-20 12:44 ` Piotr Kubik [this message]
2026-10-21 4:05 ` [PATCH wireless 2/2] wifi: mac80211: set the link addresses of a 4-address AP_VLAN before its links kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261020124446.188739-3-piotr@kubik.pl \
--to=piotr@kubik.pl \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=muna.sinada@oss.qualcomm.com \
--cc=stable@vger.kernel.org \
--cc=tamizh.raja@oss.qualcomm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®