developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 1 | From 3266d6c2cc19929c310361f00c4823c09a3ae8b4 Mon Sep 17 00:00:00 2001 |
| 2 | From: Michael-CY Lee <michael-cy.lee@mediatek.com> |
| 3 | Date: Mon, 6 May 2024 15:06:55 +0800 |
| 4 | Subject: [PATCH 64/89] mtk: mac80211: prevent STA MLD's link addr from being |
| 5 | randaomized |
| 6 | |
| 7 | STA MLD's link address should be fixed, otherwise it sends AUTH request |
| 8 | via different link address every time and causes connection issues. |
| 9 | |
| 10 | STA MLD's link address is determined by MLD address and link_id. |
| 11 | |
| 12 | Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com> |
| 13 | --- |
| 14 | net/mac80211/mlme.c | 16 ++++++++++------ |
| 15 | 1 file changed, 10 insertions(+), 6 deletions(-) |
| 16 | |
| 17 | diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c |
| 18 | index 4d6dfd6..1b19583 100644 |
| 19 | --- a/net/mac80211/mlme.c |
| 20 | +++ b/net/mac80211/mlme.c |
| 21 | @@ -8163,11 +8163,13 @@ void ieee80211_mgd_setup_link(struct ieee80211_link_data *link) |
| 22 | |
| 23 | ieee80211_clear_tpe(&link->conf->tpe); |
| 24 | |
| 25 | - if (sdata->u.mgd.assoc_data) |
| 26 | + if (sdata->u.mgd.assoc_data) { |
| 27 | ether_addr_copy(link->conf->addr, |
| 28 | sdata->u.mgd.assoc_data->link[link_id].addr); |
| 29 | - else if (!is_valid_ether_addr(link->conf->addr)) |
| 30 | - eth_random_addr(link->conf->addr); |
| 31 | + } else if (!is_valid_ether_addr(link->conf->addr)) { |
| 32 | + ether_addr_copy(link->conf->addr, sdata->vif.addr); |
| 33 | + link->conf->addr[4] += link_id + 1; |
| 34 | + } |
| 35 | } |
| 36 | |
| 37 | /* scan finished notification */ |
| 38 | @@ -8932,11 +8934,13 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, |
| 39 | } |
| 40 | |
| 41 | link = sdata_dereference(sdata->link[i], sdata); |
| 42 | - if (link) |
| 43 | + if (link) { |
| 44 | ether_addr_copy(assoc_data->link[i].addr, |
| 45 | link->conf->addr); |
| 46 | - else |
| 47 | - eth_random_addr(assoc_data->link[i].addr); |
| 48 | + } else { |
| 49 | + ether_addr_copy(assoc_data->link[i].addr, sdata->vif.addr); |
| 50 | + assoc_data->link[i].addr[4] += i + 1; |
| 51 | + } |
| 52 | sband = local->hw.wiphy->bands[link_cbss->channel->band]; |
| 53 | |
| 54 | if (match_auth && i == assoc_link_id && link) |
| 55 | -- |
| 56 | 2.18.0 |
| 57 | |