From patchwork Fri Aug 24 19:01:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 961994 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.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=candelatech.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uP4qcXcc"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41xrHz597Zz9ryn for ; Sat, 25 Aug 2018 05:02:23 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To: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:List-Owner; bh=pKTa6JuZiiI3tzS1FffL0Mo+2CI3Qm/sJrgoTVguz6Q=; b=uP4qcXccas4lk0+DM3/WeWQ43l WoZhGNGESPg3EZ7+RN+4//by+fL6OoEOTwSR7lG6brldQFWWbjM/WlOOB47+yaBXitBiUmngsbYMt glE6clfKCubJUFYhO4eBBlUk9BMckOo+6j/KawkRdxNNcbS0PM2sC7zb8aCC65Ilxo/xKc9p7ntRe 0QHfI1NqZUfl/fCDc/G1tGsqVIgss4D+OfMs2XMBwROBSQK0c/77WNv1a8jMhUasNs4bVvtuX0cWj +JGlER6sLR8IvQ3bpcDn5E5/APM/fhFaEq+tcrvseDdRb9t+RqrWG6BVJalVHr1iCZUz3ZdkpIPYP ijQMoyyw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ftHLO-000583-GH; Fri, 24 Aug 2018 19:02:03 +0000 Received: from mail2.candelatech.com ([208.74.158.173]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ftHL8-00051X-Lx for hostap@lists.infradead.org; Fri, 24 Aug 2018 19:01:48 +0000 Received: from v-f24-64.candelatech.com (firewall.candelatech.com [50.251.239.81]) by mail2.candelatech.com (Postfix) with ESMTP id DFCE940A5C4; Fri, 24 Aug 2018 12:01:32 -0700 (PDT) From: greearb@candelatech.com To: hostap@lists.infradead.org Subject: [PATCH 2/2] supplicant: Support disabling the supported-oper-class IE. Date: Fri, 24 Aug 2018 12:01:29 -0700 Message-Id: <1535137289-5425-2-git-send-email-greearb@candelatech.com> X-Mailer: git-send-email 2.7.5 In-Reply-To: <1535137289-5425-1-git-send-email-greearb@candelatech.com> References: <1535137289-5425-1-git-send-email-greearb@candelatech.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180824_120146_756272_3C28FCA5 X-CRM114-Status: GOOD ( 15.18 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: j@w1.fi, Ben Greear MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Ben Greear This provides a work-around for cases where the AP (most likely) has bugs when this element exists and/or has 5Ghz elements when the AP is evidently unexpecting that. Test case that required this fix is a DPC3941 AP, configured with 2.4G radio to have WPA2 PSK. Client station is ath10k 9880. The symptom is that the client radio does not ack the 1/4 eapol. I do not know exactly why, but maybe it is corrupted in some suble way that I did not notice. Signed-off-by: Ben Greear --- wpa_supplicant/config.c | 1 + wpa_supplicant/config.h | 10 ++++++++++ wpa_supplicant/sme.c | 10 ++++++---- wpa_supplicant/wpa_supplicant.c | 2 +- wpa_supplicant/wpa_supplicant.conf | 9 +++++++++ 5 files changed, 27 insertions(+), 5 deletions(-) diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c index 9b751ec..6e5c5d8 100644 --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c @@ -4745,6 +4745,7 @@ static const struct global_parse_data global_fields[] = { { INT(p2p_go_max_inactivity), 0 }, { INT_RANGE(auto_interworking, 0, 1), 0 }, { INT(okc), 0 }, + { INT(no_oper_classes_ie), 0 }, { INT(pmf), 0 }, { FUNC(sae_groups), 0 }, { INT(dtim_period), 0 }, diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h index f9afd7a..8f562c8 100644 --- a/wpa_supplicant/config.h +++ b/wpa_supplicant/config.h @@ -1165,6 +1165,16 @@ struct wpa_config { int okc; /** + * At least some APs (dpc3941) will not reliably associate a station on the + * 2.4Ghz radio with at least some client devices (ath10k 9880) if the + * supported operating classes IE advertises 2.4 and 5Ghz range + * (81, 83, 84, 115 ... 130) + * So, allow users to disable the operating-class IE in order to work around + * this. + */ + int no_oper_classes_ie; + + /** * pmf - Whether to enable/require PMF by default * * By default, PMF is disabled unless enabled by the per-network diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c index 90d0353..16dd61f 100644 --- a/wpa_supplicant/sme.c +++ b/wpa_supplicant/sme.c @@ -473,10 +473,12 @@ static void sme_send_authentication(struct wpa_supplicant *wpa_s, sme_auth_handle_rrm(wpa_s, bss); - wpa_s->sme.assoc_req_ie_len += wpas_supp_op_class_ie( - wpa_s, bss->freq, - wpa_s->sme.assoc_req_ie + wpa_s->sme.assoc_req_ie_len, - sizeof(wpa_s->sme.assoc_req_ie) - wpa_s->sme.assoc_req_ie_len); + if (!wpa_s->conf->no_oper_classes_ie) { + wpa_s->sme.assoc_req_ie_len += wpas_supp_op_class_ie( + wpa_s, bss->freq, + wpa_s->sme.assoc_req_ie + wpa_s->sme.assoc_req_ie_len, + sizeof(wpa_s->sme.assoc_req_ie) - wpa_s->sme.assoc_req_ie_len); + } if (params.p2p) wpa_drv_get_ext_capa(wpa_s, WPA_IF_P2P_CLIENT); diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index 2aef867..533cdd7 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -2655,7 +2655,7 @@ static u8 * wpas_populate_assoc_ies( os_memset(wpa_s->p2p_ip_addr_info, 0, sizeof(wpa_s->p2p_ip_addr_info)); #endif /* CONFIG_P2P */ - if (bss) { + if (bss && !(wpa_s->conf->no_oper_classes_ie)) { wpa_ie_len += wpas_supp_op_class_ie(wpa_s, bss->freq, wpa_ie + wpa_ie_len, max_wpa_ie_len - diff --git a/wpa_supplicant/wpa_supplicant.conf b/wpa_supplicant/wpa_supplicant.conf index e3a5bcb..010695b 100644 --- a/wpa_supplicant/wpa_supplicant.conf +++ b/wpa_supplicant/wpa_supplicant.conf @@ -370,6 +370,15 @@ fast_reauth=1 # can be disabled with per-network proactive_key_caching=0 parameter. #okc=0 +# At least some APs (dpc3941) will not reliably associate a station on the +# 2.4Ghz radio with at least some client devices (ath10k 9880) if the +# supported operating classes IE advertises 2.4 and 5Ghz range +# (81, 83, 84, 115 ... 130) +# So, allow users to disable the operating-class IE in order to work around +# this. Default is to set this to 0 (enable oper-classes-ie) +# Set it to 1 to disable the oper-classes-ie +#no_oper_classes_ie=0 + # Protected Management Frames default # This parameter can be used to set the default behavior for the ieee80211w # parameter for RSN networks. By default, PMF is disabled unless enabled with