diff mbox series

[12/15] wifi: mac80211: Print local link address during authentication

Message ID 20230827135854.9c08605e2691.I0032e9d6e01325862189e4a20b02ddbe8f2f5e75@changeid
State New
Headers show
Series cfg80211/mac80211 patches from our internal tree 2023-08-27 | expand

Commit Message

Greenman, Gregory Aug. 27, 2023, 11:05 a.m. UTC
From: Ilan Peer <ilan.peer@intel.com>

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>
---
 net/mac80211/mlme.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

Comments

Wen Gong Aug. 28, 2023, 10:37 a.m. UTC | #1
On 8/27/2023 7:05 PM, gregory.greenman@intel.com wrote:
[...]
> @@ -7218,6 +7217,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);
> +

req->link_id >= 0 means MLD.
For non-MLD, req->link_id < 0, is it better to use sdata->deflink for non-MLD?
Is sdata->link[0] always pointer to sdata->deflink for non-MLD?

It has a comment for deflink of struct ieee80211_sta, but no comment for deflink
  of struct ieee80211_sub_if_data.

> +	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);
diff mbox series

Patch

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index ca6045f56b4b..a93fbed69a70 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -7085,6 +7085,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;
@@ -7208,8 +7209,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);
 
@@ -7218,6 +7217,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);