public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* Maybe problem with ieee80211_tear_down_links return value.
@ 2026-02-28  0:58 Ben Greear
  2026-02-28  6:45 ` Rameshkumar Sundaram
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Greear @ 2026-02-28  0:58 UTC (permalink / raw)
  To: linux-wireless

While checking on some other problems, I ended up adding logging to the code path
below from net/mac80211/link.c.  This path is hit very often on my system, and if I understand
the code correctly, it should only hit in error cases where MLO links have duplicated
MAC addresses.

	ret = ieee80211_check_dup_link_addrs(sdata);
	if (!ret) {
		/* for keys we will not be able to undo this */
		ieee80211_tear_down_links(sdata, to_free, rem);

The ieee80211_check_dup_link_addrs method appears to return 0 when there are no duplicates,
and -EALREADY when there are duplicates.  So maybe the check above should be reversed to be:

if (ret) {
??

static int ieee80211_check_dup_link_addrs(struct ieee80211_sub_if_data *sdata)
{
	unsigned int i, j;

	for (i = 0; i < IEEE80211_MLD_MAX_NUM_LINKS; i++) {
		struct ieee80211_link_data *link1;

		link1 = sdata_dereference(sdata->link[i], sdata);
		if (!link1)
			continue;
		for (j = i + 1; j < IEEE80211_MLD_MAX_NUM_LINKS; j++) {
			struct ieee80211_link_data *link2;

			link2 = sdata_dereference(sdata->link[j], sdata);
			if (!link2)
				continue;

			if (ether_addr_equal(link1->conf->addr,
					     link2->conf->addr))
				return -EALREADY;
		}
	}

	return 0;
}

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-02-28 12:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-28  0:58 Maybe problem with ieee80211_tear_down_links return value Ben Greear
2026-02-28  6:45 ` Rameshkumar Sundaram
2026-02-28 12:58   ` Ben Greear

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox