Linux wireless drivers development
 help / color / mirror / Atom feed
From: Ilan Peer <ilan.peer@intel.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org, Ilan Peer <ilan.peer@intel.com>
Subject: [PATCH v2 06/11] wifi: mac80211: accept NAN beacons only when IC is enabled
Date: Mon,  5 Oct 2026 10:40:31 +0300	[thread overview]
Message-ID: <20261005074037.3506633-7-ilan.peer@intel.com> (raw)
In-Reply-To: <20261005074037.3506633-1-ilan.peer@intel.com>

Accept NAN beacons in the Rx path only when Instant Communication
(IC) is enabled in the NAN configuration.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
---
 net/mac80211/rx.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 5e26be8e27d8..eb1578b2d6d7 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -4660,7 +4660,8 @@ static bool ieee80211_accept_frame(struct ieee80211_rx_data *rx)
 		 * Accept only frames that are addressed to the NAN cluster
 		 * (based on the Cluster ID). From these frames, accept only
 		 *  - public action frames,
-		 *  - authentication frames to the local address, and
+		 *  - authentication frames to the local address,
+		 *  - NAN beacons, when Instant Communication is enabled, and
 		 *  - robust management frames except disassoc.
 		 */
 		if (!ether_addr_equal(sdata->u.nan.conf.cluster_id, hdr->addr3))
@@ -4670,6 +4671,9 @@ static bool ieee80211_accept_frame(struct ieee80211_rx_data *rx)
 		if (ieee80211_is_auth(hdr->frame_control) &&
 		    ether_addr_equal(sdata->vif.addr, hdr->addr1))
 			return true;
+		if (ieee80211_is_nan_beacon((struct ieee80211_mgmt *)hdr,
+					    skb->len))
+			return sdata->u.nan.conf.instant_comm;
 		if (!ieee80211_is_disassoc(hdr->frame_control) &&
 		    ieee80211_is_robust_mgmt_frame(skb))
 			return true;
-- 
2.55.0


  parent reply	other threads:[~2026-10-04 13:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-05  7:40 [PATCH v2 00/11] wifi: cfg80211/mac80211: add NAN Instant Communication support Ilan Peer
2026-10-04 13:41 ` Johannes Berg
2026-10-04 13:54   ` Peer, Ilan
2026-10-05  7:40 ` [PATCH v2 01/11] wifi: cfg80211: nan: add " Ilan Peer
2026-10-05  7:40 ` [PATCH v2 02/11] wifi: mac80211: nan: Update NAN configuration copy Ilan Peer
2026-10-05  7:40 ` [PATCH v2 03/11] wifi: cfg80211: nan: check Rx registration for NAN beacons Ilan Peer
2026-10-05  7:40 ` [PATCH v2 04/11] wifi: cfg80211: do not use NAN beacons to update the BSS table Ilan Peer
2026-10-05  7:40 ` [PATCH v2 05/11] wifi: mac80211: nan: allow Rx registration for NAN beacons Ilan Peer
2026-10-05  7:40 ` Ilan Peer [this message]
2026-10-05  7:40 ` [PATCH v2 07/11] wifi: ieee80211: add NAN service ID list attribute definitions Ilan Peer
2026-10-05  7:40 ` [PATCH v2 08/11] wifi: mac80211_hwsim: nan: use ieee80211_is_nan_beacon() helper Ilan Peer
2026-10-05  7:40 ` [PATCH v2 09/11] wifi: mac80211_hwsim: nan: prepare for more configurable NAN settings Ilan Peer
2026-10-05  7:40 ` [PATCH v2 10/11] wifi: mac80211_hwsim: nan: Handle more of the NAN configuration Ilan Peer
2026-10-05  7:40 ` [PATCH v2 11/11] wifi: mac80211_hwsim: add NAN Instant Communication support Ilan Peer

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=20261005074037.3506633-7-ilan.peer@intel.com \
    --to=ilan.peer@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /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