From patchwork Fri Jun 26 14:28:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Theil X-Patchwork-Id: 1317705 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=tu-ilmenau.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=3brk15TM; 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 49tfQv0gzdz9s1x for ; Sat, 27 Jun 2020 00:29:27 +1000 (AEST) 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: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=ljb3LpN8HyFfzqZjH3S8ulKElRzu6rErvRKLkik7xaw=; b=3brk15TMX3OgvQ4NWagoBdDCS v2uV9ldcjXfKwPP8qms7gI6DbBVfYOSAVrSfre8QN9x/OMex6uvU2pJnCIXGxF7PDrRvPU4Jqlt73 YIF5DpjjkUbakC7Dw4wS3hAEaC843V15vG+KxoCVBhOjrXs6isMx1ElOKhz3PnYSi6cUQn7GI1Pvp bd/hBnGxfwAusjZ4IuoZXE8Cdr6Ssgg+kEtoxCjZqg5SFznODOaMuLJeGNxuNYzz7VDW6h37jlxXP H2dCK3eldE+rdMEnyueXePWBR2kCLDZ9mIaK9yW/wxI2mp7937yBAOJJ1/8WB4+QjFyrZguv7HeVP 0uHSG+j4w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jopLV-0007h3-M9; Fri, 26 Jun 2020 14:28:49 +0000 Received: from smail.rz.tu-ilmenau.de ([141.24.186.67]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jopLB-0007Yy-7c for hostap@lists.infradead.org; Fri, 26 Jun 2020 14:28:32 +0000 Received: from legolas.prakinf.tu-ilmenau.de (unknown [141.24.207.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smail.rz.tu-ilmenau.de (Postfix) with ESMTPSA id EFC7E58007F; Fri, 26 Jun 2020 16:28:23 +0200 (CEST) From: Markus Theil To: hostap@lists.infradead.org Subject: [RESEND PATCH 10/10] mesh: fix mesh_oom test Date: Fri, 26 Jun 2020 16:28:22 +0200 Message-Id: <20200626142822.272002-11-markus.theil@tu-ilmenau.de> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200626142822.272002-1-markus.theil@tu-ilmenau.de> References: <20200626142822.272002-1-markus.theil@tu-ilmenau.de> MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [141.24.186.67 listed in list.dnswl.org] 0.0 SPF_NONE SPF: sender does not publish an 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: masashi.honma@gmail.com, Markus Theil , peter.oh@bowerswilkins.com Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Only change freq params, if ifmsh->freq is set initially, which only happens if hostapd_get_hw_features in setup_interface2 succeeds. Signed-off-by: Markus Theil --- wpa_supplicant/mesh.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c index 0742cabbc..4c7cfa374 100644 --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c @@ -218,7 +218,7 @@ static int wpas_mesh_complete(struct wpa_supplicant *wpa_s) * inspect if channel's been changed since initialized. * i.e. DFS radar detection */ - if (ifmsh->freq != params->freq.freq) { + if (ifmsh->freq > 0 && ifmsh->freq != params->freq.freq) { wpa_s->assoc_freq = ifmsh->freq; ssid->frequency = ifmsh->freq; struct he_capabilities *he_capab = NULL; @@ -447,7 +447,8 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s, ifmsh->mconf = mconf; /* need conf->hw_mode for supported rates. */ - conf->hw_mode = ieee80211_freq_to_chan(frequency, &conf->channel); + conf->hw_mode = ieee80211_freq_to_channel_ext(frequency, 0, CHANWIDTH_USE_HT, + &conf->op_class, &conf->channel); if (conf->hw_mode == NUM_HOSTAPD_MODES) { wpa_printf(MSG_ERROR, "Unsupported mesh mode frequency: %d MHz", frequency);