[PATCH] ANQP/hostapd: RNR response to RNR query to ANQP query through action frame.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Sharadanand Karanjkar <skaranjkar@xxxxxxxxx>

STA can query for RNR report from ANQP action frame.
Parse all the interfaces and fill the RNR information.
Doing this allows station to discover networks on other frequencies
which were announced throgh RNR in the ANQP RNR response,
e. g. for multi-media APs in WiFi 6e.

Signed-off-by: Sharadanand Karanjkar <skaranjkar@xxxxxxxxx>
---
 wpa_supplicant/interworking.c | 37 +++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/wpa_supplicant/interworking.c b/wpa_supplicant/interworking.c
index 71a5c1651..4ca139d98 100644
--- a/wpa_supplicant/interworking.c
+++ b/wpa_supplicant/interworking.c
@@ -2884,6 +2884,40 @@ static void anqp_add_extra(struct wpa_supplicant *wpa_s,
 	}
 }
 
+static void anqp_add_rnr(struct wpa_supplicant *wpa_s,
+			   struct wpa_bss_anqp *anqp,
+			   const u8 *data, size_t slen)
+{
+	struct wpa_bss_anqp_rnr *tmp, *elem = NULL;
+
+	if (!anqp)
+		return;
+
+	dl_list_for_each(tmp, &anqp->anqp_rnr, struct wpa_bss_anqp_rnr,
+			 list) {
+		if(os_memcmp(tmp->bssid, data, ETH_ALEN) == 0) {
+			elem = tmp;
+			break;
+		}
+	}
+
+	if (!elem) {
+		elem = os_zalloc(sizeof(*elem));
+		if (!elem)
+			return;
+
+		os_memcpy(elem->bssid, data, ETH_ALEN);
+		dl_list_add(&anqp->anqp_rnr, &elem->list);
+	} else {
+		wpabuf_free(elem->rnr_report);
+	}
+
+	elem->rnr_report = wpabuf_alloc_copy(data, slen);
+	if (!elem->rnr_report) {
+		dl_list_del(&elem->list);
+		os_free(elem);
+	}
+}
 
 static void interworking_parse_venue_url(struct wpa_supplicant *wpa_s,
 					 const u8 *data, size_t len)
@@ -3073,6 +3107,9 @@ static void interworking_parse_rx_anqp_resp(struct wpa_supplicant *wpa_s,
 			return;
 		}
 		break;
+	case ANQP_NEIGHBOR_REPORT:
+		anqp_add_rnr(wpa_s, anqp, data, slen);
+		break;
 	default:
 		wpa_msg(wpa_s, MSG_DEBUG,
 			"Interworking: Unsupported ANQP Info ID %u", info_id);
-- 
2.30.2


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux