From patchwork Thu Oct 22 18:20:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Pedersen X-Patchwork-Id: 1386383 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=adapt-ip.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=n5t+fB9V; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CHG0M0ZHjz9sSW for ; Fri, 23 Oct 2020 05:21:39 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=3ldZe7Rj9khxVKrL3BIYiCaJQDCzJ13rbrHmTIRrj3A=; b=n5t+fB9VAASX7N5FI8xWdA8rZk aJgEDOzyD9otH6RJOoBhoe3RH+QAyqeb38wrmFRjbvAlhle88xH2bDBK+7tVpXB871ZM3ebHJJ2xM tgohuMeFJIVulQtGJRJ29YvNyY57ZRQbCXctULsiJMwrqKI02OxpRPoJIFkiDyQt11PR3spyeiIRF l6HY4y6AioNsEW5Fhm5weFVZc4Ny9UDk0Gpa4aB0tRA55NTY1OW1FG7R53iOPWlBxpVPdSjN6/uuU RLA0UCgNtta7K89clvE+aPPqhg61XWbkq3xpc3PmJN6VU4CNVKMcQGjkwsrNmd78glyb3VKhLK0EN Ce/EI/dA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kVfCd-0005J8-6X; Thu, 22 Oct 2020 18:20:43 +0000 Received: from mail.adapt-ip.com ([173.164.178.19] helo=web.adapt-ip.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kVfCa-0005IM-TZ for hostap@lists.infradead.org; Thu, 22 Oct 2020 18:20:41 +0000 Received: from localhost (localhost [127.0.0.1]) by web.adapt-ip.com (Postfix) with ESMTP id 5032F4FA667; Thu, 22 Oct 2020 18:20:36 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at web.adapt-ip.com Received: from web.adapt-ip.com ([127.0.0.1]) by localhost (web.adapt-ip.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id weux8ur3EtXp; Thu, 22 Oct 2020 18:20:33 +0000 (UTC) Received: from atlas.campbell.adapt-ip.com (gateway.adapt-ip.com [173.164.178.20]) (Authenticated sender: thomas@adapt-ip.com) by web.adapt-ip.com (Postfix) with ESMTPSA id 288C24FA666; Thu, 22 Oct 2020 18:20:32 +0000 (UTC) From: Thomas Pedersen To: hostap Subject: [PATCH] wlantest: allow missing RSNE in S1G beacon Date: Thu, 22 Oct 2020 11:20:32 -0700 Message-Id: <20201022182032.1897-1-thomas@adapt-ip.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201022_142041_043002_C8D5F5D4 X-CRM114-Status: GOOD ( 15.20 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jouni Malinen , Thomas Pedersen Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org S1G beacons save a few bytes by not requiring the RSN IE in beacon if RSN BSS is configured. Handle this in wlantest by only clearing RSNE from the BSS info if frame is a probe response. Signed-off-by: Thomas Pedersen --- src/common/ieee802_11_common.c | 5 +++++ src/common/ieee802_11_common.h | 1 + src/common/ieee802_11_defs.h | 3 +++ wlantest/bss.c | 10 ++++++++-- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/common/ieee802_11_common.c b/src/common/ieee802_11_common.c index 9c536cc5f34f..3727b9477ef9 100644 --- a/src/common/ieee802_11_common.c +++ b/src/common/ieee802_11_common.c @@ -566,6 +566,11 @@ ParseRes ieee802_11_parse_elems(const u8 *start, size_t len, elems->dils = pos; elems->dils_len = elen; break; + case WLAN_EID_S1G_CAPABILITIES: + if (elen < 15) + break; + elems->s1g_capab = pos; + break; case WLAN_EID_FRAGMENT: ieee802_11_parse_fragment(&elems->frag_ies, pos, elen); break; diff --git a/src/common/ieee802_11_common.h b/src/common/ieee802_11_common.h index 0ddba06924c2..7d1db72c6408 100644 --- a/src/common/ieee802_11_common.h +++ b/src/common/ieee802_11_common.h @@ -115,6 +115,7 @@ struct ieee802_11_elems { const u8 *short_ssid_list; const u8 *he_6ghz_band_cap; const u8 *sae_pk; + const u8 *s1g_capab; u8 ssid_len; u8 supp_rates_len; diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h index 86d71c15680d..9518a7afe909 100644 --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h @@ -443,7 +443,10 @@ #define WLAN_EID_DEVICE_LOCATION 204 #define WLAN_EID_WHITE_SPACE_MAP 205 #define WLAN_EID_FTM_PARAMETERS 206 +#define WLAN_EID_S1G_BCN_COMPAT 213 +#define WLAN_EID_S1G_CAPABILITIES 217 #define WLAN_EID_VENDOR_SPECIFIC 221 +#define WLAN_EID_S1G_OPERATION 232 #define WLAN_EID_CAG_NUMBER 237 #define WLAN_EID_AP_CSN 239 #define WLAN_EID_FILS_INDICATION 240 diff --git a/wlantest/bss.c b/wlantest/bss.c index 3208e65e4195..5a05521d93d4 100644 --- a/wlantest/bss.c +++ b/wlantest/bss.c @@ -178,14 +178,20 @@ void bss_update(struct wlantest *wt, struct wlantest_bss *bss, elems->osen_len + 2); } - if (elems->rsn_ie == NULL) { + /* S1G does not include RSNE in beacon, so only clear it from + * probe response. NOTE this assumes short beacons were dropped due to + * missing SSID above. + */ + if (elems->rsn_ie == NULL && + (!elems->s1g_capab || + (elems->s1g_capab && beacon != 1))) { if (bss->rsnie[0]) { add_note(wt, MSG_INFO, "BSS " MACSTR " - RSN IE removed", MAC2STR(bss->bssid)); bss->rsnie[0] = 0; update = 1; } - } else { + } else if (elems->rsn_ie) { if (bss->rsnie[0] == 0 || os_memcmp(bss->rsnie, elems->rsn_ie - 2, elems->rsn_ie_len + 2) != 0) {