linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aditya Kumar Singh <quic_adisi@quicinc.com>
To: <johannes@sipsolutions.net>
Cc: <linux-wireless@vger.kernel.org>,
	Sriram R <quic_srirrama@quicinc.com>,
	Aditya Kumar Singh <quic_adisi@quicinc.com>
Subject: [PATCH v2] wifi: mac80211: handle link ID during management Tx
Date: Wed, 10 Apr 2024 10:57:05 +0530	[thread overview]
Message-ID: <20240410052705.169865-1-quic_adisi@quicinc.com> (raw)

From: Sriram R <quic_srirrama@quicinc.com>

During management Tx, when source address is same as one of the link conf's
address and even when userspace requested Tx on a specific link, link ID
is not set. Now if MLD address is also same as that of the link address,
then mac80211 fills link as unspecified. Due to this, later in driver, the
channel context is fetched from vif->bss_conf instead of link's conf which
in turn gives channel as NULL and hence as a result, the packet is
ultimately dropped.

Add changes to use the same link id and set it if the link bss is matching
the requested channel. This will prevent the packet from getting dropped.

Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
---
v2: rephrased commit message to describe how packet is getting dropped.

---
 net/mac80211/offchannel.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c
index 221695d841fd..65e1e9e971fd 100644
--- a/net/mac80211/offchannel.c
+++ b/net/mac80211/offchannel.c
@@ -897,8 +897,18 @@ int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
 				break;
 			}
 
-			if (ether_addr_equal(conf->addr, mgmt->sa))
+			if (ether_addr_equal(conf->addr, mgmt->sa)) {
+				/* If userspace requested Tx on a specific link
+				 * use the same link id if the link bss is matching
+				 * the requested chan.
+				 */
+				if (sdata->vif.valid_links &&
+				    params->link_id >= 0 && params->link_id == i &&
+				    params->chan == chanctx_conf->def.chan)
+					link_id = i;
+
 				break;
+			}
 
 			chanctx_conf = NULL;
 		}

base-commit: a35b36e6ee5dcf323d846ec3881159e4af90c9b4
-- 
2.25.1


                 reply	other threads:[~2024-04-10  5:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20240410052705.169865-1-quic_adisi@quicinc.com \
    --to=quic_adisi@quicinc.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=quic_srirrama@quicinc.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;
as well as URLs for NNTP newsgroup(s).