From patchwork Thu Oct 12 21:12:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Baligh Gasmi gasmibal@gmail.com" X-Patchwork-Id: 1847798 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=Nuftfq0k; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=ATdVKY24; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S62S71pjhz1ypX for ; Fri, 13 Oct 2023 08:13:41 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :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=wGnM8S3TttwrfXybwCKu9BYe4a0/Y8hcT3vGbLTJlK0=; b=Nuftfq0k4jinIU 0eN7ubDOWiae99AjKC/WOWvX9zVM4lt57EJDLjYBS7kSsK5HiXG/oEXaF2sdTPZsdNKIbMpppuMuH tnRafx8wdqok7tEiBp/7knUJTTkiZNPjhxk3wANSVfMMq4AzJhmh8aeaqnCUfHV1CI9T2DXe345jN bitJELCOA7nlK7Ao9KPP+yliAsEb+E95bt49N3wf/gS7mp9CgUzmOGbn04V6MIWkiV0Gavkc7nS2e g2xqFOY/3+6cJw8FkdmCgrUmo5bipdv6UMyN7xgUn7am7bsJjKgpQTK1VGVwshVN0qemeiXcEGFqp j2HXK/f/3KcHTaNOdgrA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qr2yp-001rvq-2T; Thu, 12 Oct 2023 21:12:27 +0000 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qr2yk-001rup-36 for hostap@lists.infradead.org; Thu, 12 Oct 2023 21:12:24 +0000 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-31fa15f4cc6so1351584f8f.2 for ; Thu, 12 Oct 2023 14:12:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697145138; x=1697749938; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=hjNXWeg0WAhJpg80PJgINmSLoIMOOhBu0T/zwStmUNg=; b=ATdVKY24YANQIBjt2L3Uf5IjrmsI0z7NN6xdbMkn1Rp7Vxs3wy3yELvoz5814sJGap fVzkCqMSdGZAHPWf1Dhi7jhFtVKXT3Hi6hzzOZ+Xbs+ApYQeBLLm8ssK143Wb/MwQMf5 qjZm1TtWXHQx7Pnn1yfistp1oHclydMqqqITOCjcAGkVoXjOePdmE0o/bhkF9Xy6wrCt eWK5OwAj+cb2Uf0XLwXuIYr+O7MX49m/Z0m+EiELrUroCyBOlhsSKLo9wDATSCuMzzqR JcX9zjHlAlLQvuVzv/zZpIfaMnKeYMADkS7z3r0VqVo2dxi6vuU+EtFGJsM2A3Lugpyq mn2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697145138; x=1697749938; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hjNXWeg0WAhJpg80PJgINmSLoIMOOhBu0T/zwStmUNg=; b=ZNNaVQ6BThY2qJWl3OUwTYhMfKp/TC5vzjTUPEgkKTeCVFauNTZz+ct/eE37DtrCNt vawFpXfpxrvctJseFPqsOUuCEdXzrvn/d/yKECsTh5Qo6yM1IN68OXYhzWvh+TpkvUj6 krFKZLJyrRZmMjNi/r4HKn3P9HhhMiq7ex97CjH+oqUOqFhguGU59af8ur1CJNAGL5gc Ey2deBfTaKuue41kZF3xvyv2v7hAWfpWU4CNVgWFUHuiUHosiDmK2zlkNl0FtFzDs8/U xXGask6iHicmD+ef9mdKVZnyFwJ7h3BekVfLSop1f5zUiuNTB/a9a5tJL/NEDKz79veQ Gahg== X-Gm-Message-State: AOJu0Yz1nx73E2m0u2lZ+4SCXvqFasqwhcTGVR2BaqCRCajDUleIv1Bn iqBCs6sbOBoSZw1Fv9fv0EmX69SPg04= X-Google-Smtp-Source: AGHT+IHfiPBBOKXTcfT/6cJ/TJyw1RX+lHj57hwtbmKXkXkxMfYJkjH0LeGObam4C5WoZYj8f6ZAUw== X-Received: by 2002:a5d:4b48:0:b0:317:d048:8d87 with SMTP id w8-20020a5d4b48000000b00317d0488d87mr20025942wrs.61.1697145137674; Thu, 12 Oct 2023 14:12:17 -0700 (PDT) Received: from localhost.localdomain (2a01cb000b6bf000286e073d04e12df8.ipv6.abo.wanadoo.fr. [2a01:cb00:b6b:f000:286e:73d:4e1:2df8]) by smtp.gmail.com with ESMTPSA id e11-20020adfe7cb000000b003176c6e87b1sm19242691wrn.81.2023.10.12.14.12.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 14:12:17 -0700 (PDT) From: Baligh Gasmi To: hostap@lists.infradead.org Cc: Baligh Gasmi Subject: [PATCH] CSA MBSS: CHAN_SWITCH is always failing. Date: Thu, 12 Oct 2023 23:12:03 +0200 Message-Id: <20231012211203.529730-1-gasmibal@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231012_141223_040138_A30D7DBC X-CRM114-Status: GOOD ( 16.71 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: When asking hostapd to switch channel in the multi-BSS configuration, only the first (associated to the first BSS) request is executed correctly by some driver, other BSS's request are failing. This i [...] Content analysis details: (-0.2 points, 5.0 required) 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 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [gasmibal[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:432 listed in] [list.dnswl.org] X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org When asking hostapd to switch channel in the multi-BSS configuration, only the first (associated to the first BSS) request is executed correctly by some driver, other BSS's request are failing. This is because multi-BSS configuration is using same Radio and one request seems to be suffisant to driver to switch on. Solution in here is to return SUCCESS if there was at least one BSS switched OK. Signed-off-by: Baligh Gasmi --- hostapd/ctrl_iface.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c index f90eb22c4..cf3d65172 100644 --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c @@ -2694,6 +2694,8 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface, return 0; } + int one_success = 0; + int last_fail = ret; for (i = 0; i < iface->num_bss; i++) { /* Save CHAN_SWITCH VHT, HE, and EHT config */ @@ -2704,11 +2706,13 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface, if (ret) { /* FIX: What do we do if CSA fails in the middle of * submitting multi-BSS CSA requests? */ - return ret; + last_fail = ret; + } else { + one_success = 1; } } - return 0; + return one_success ? 0 : last_fail; #else /* NEED_AP_MLME */ return -1; #endif /* NEED_AP_MLME */