From patchwork Mon Feb 15 14:53:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peer, Ilan" X-Patchwork-Id: 582925 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B1AA8140328 for ; Tue, 16 Feb 2016 00:10:01 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aVItm-0006vx-JB; Mon, 15 Feb 2016 13:09:06 +0000 Received: from mga04.intel.com ([192.55.52.120]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aVIkL-0007OL-IG for hostap@lists.infradead.org; Mon, 15 Feb 2016 12:59:31 +0000 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP; 15 Feb 2016 04:58:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,450,1449561600"; d="scan'208";a="746656271" Received: from unknown (HELO JED00377.ger.corp.intel.com) ([10.12.217.192]) by orsmga003.jf.intel.com with ESMTP; 15 Feb 2016 04:58:14 -0800 From: Ilan Peer To: hostap@lists.infradead.org Subject: [PATCH 10/26] MBO: Add association disallowed support Date: Mon, 15 Feb 2016 16:53:31 +0200 Message-Id: <1455548043-22427-20-git-send-email-ilan.peer@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1455548043-22427-1-git-send-email-ilan.peer@intel.com> References: <1455548043-22427-1-git-send-email-ilan.peer@intel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160215_045922_013017_5F4717E6 X-CRM114-Status: UNSURE ( 7.56 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [192.55.52.120 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Spinadel MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: David Spinadel Prevent association to APs that have association disallowed attribute in MBO IE in beacons or probe responses. Signed-off-by: David Spinadel --- wpa_supplicant/events.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 3264dc0..cb44674 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -827,6 +827,9 @@ static struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s, const u8 *ie; struct wpa_ssid *ssid; int osen; +#ifdef CONFIG_MBO + const u8 *assoc_disallow; +#endif /* CONFIG_MBO */ ie = wpa_bss_get_vendor_ie(bss, WPA_IE_VENDOR_TYPE); wpa_ie_len = ie ? ie[1] : 0; @@ -1064,6 +1067,16 @@ static struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s, (unsigned int) diff.usec); continue; } +#ifdef CONFIG_MBO + assoc_disallow = wpas_mbo_get_bss_attr(wpa_s, bss, + MBO_ATTR_ID_ASSOC_DISALLOW); + if (assoc_disallow) { + wpa_dbg(wpa_s, MSG_DEBUG, + " skip - MBO association disallowed, reason %u", + assoc_disallow[2]); + continue; + } +#endif /* CONFIG_MBO */ /* Matching configuration found */ return ssid;