summaryrefslogtreecommitdiff
path: root/net/mac80211
diff options
context:
space:
mode:
authorIlan Peer <ilan.peer@intel.com>2023-08-27 14:05:29 +0300
committerJohannes Berg <johannes.berg@intel.com>2023-09-11 12:32:40 +0200
commit0f99f0878350f907b31c1ea091c807faa566dded (patch)
tree568a06f326b47cd2562a581c741c3cde64397588 /net/mac80211
parent428e8976a15f849ad92b1c1e38dda2a684350ff7 (diff)
wifi: mac80211: Print local link address during authentication
To ease debugging, mostly in cases that authentication fails. Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230827135854.9c08605e2691.I0032e9d6e01325862189e4a20b02ddbe8f2f5e75@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/mlme.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 0f295c5403b3..69f236b8bb45 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -7018,6 +7018,7 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
struct ieee80211_local *local = sdata->local;
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
struct ieee80211_mgd_auth_data *auth_data;
+ struct ieee80211_link_data *link;
u16 auth_alg;
int err;
bool cont_auth;
@@ -7143,8 +7144,6 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
false);
}
- sdata_info(sdata, "authenticate with %pM\n", auth_data->ap_addr);
-
/* needed for transmitting the auth frame(s) properly */
memcpy(sdata->vif.cfg.ap_addr, auth_data->ap_addr, ETH_ALEN);
@@ -7153,6 +7152,19 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
if (err)
goto err_clear;
+ if (req->link_id > 0)
+ link = sdata_dereference(sdata->link[req->link_id], sdata);
+ else
+ link = sdata_dereference(sdata->link[0], sdata);
+
+ if (WARN_ON(!link)) {
+ err = -ENOLINK;
+ goto err_clear;
+ }
+
+ sdata_info(sdata, "authenticate with %pM (local address=%pM)\n",
+ auth_data->ap_addr, link->conf->addr);
+
err = ieee80211_auth(sdata);
if (err) {
sta_info_destroy_addr(sdata, auth_data->ap_addr);