From patchwork Wed Aug 5 04:59:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 1341080 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=codeaurora.org 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=Wc70I8pb; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.a=rsa-sha256 header.s=smtp header.b=gDa+PLcU; 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 4BLzwx6lFtz9sRK for ; Wed, 5 Aug 2020 15:01:21 +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: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=kF9MMbW08Zt5cwFX4BrS3kzGbICQ/oKTjFjBCQViEfs=; b=Wc70I8pbb18/SFbxBOJpN7DE+f hC7wd+Gc9lYxqczh5RrRQp/uFkJb4BmJ8Kf7X6iysIRqSDF36DwTUR1ZyM2+g1a3rw8ajav6JSWjN ZxEoMsqLvdNNUUJ5RxNiORDCBPjaEfKkq6cMovQnVRzzgqhbOTn8ZtdbuGJun+eHr7QrR1ixLkc78 tTUz2KlSBoXB+pSanufR+e3OqizYV3T+GCp+ljSmX8SMvAr78Smu8yxxCqoe3LL+7xwd6ReAb3hUx HrcBicHnqcKzDOTWKwObBUR80rSvHHdEG74zKsgJjm/N6DV1Ps+MtdHc8YdFkVbu1C9eq2Mf4ih0e qpjDpddg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k3BWl-0000oQ-0t; Wed, 05 Aug 2020 04:59:47 +0000 Received: from m43-7.mailgun.net ([69.72.43.7]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k3BWg-0000na-5n for hostap@lists.infradead.org; Wed, 05 Aug 2020 04:59:45 +0000 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1596603584; h=Content-Transfer-Encoding: MIME-Version: Message-Id: Date: Subject: Cc: To: From: Sender; bh=y/T7r08s3wQh0yO3VfZCmdIjxlWBE9ZZZHp/3cfMLxw=; b=gDa+PLcUcaEy3fCyrq7Ff/nxkofglEGQJxH50qAS1S3mlax5n81NRMGFOYlf1GDzvcoxnTBZ Eh0B+YVEjW2SuzophOZnQJ2AciKn1TXguJzqTdpmoRn4FL3N+UitcMDzO7Ay0RsBpwbf8W0G jt4bNkn/cX6+nrwRD8TYTJzqJrM= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyJkMjNkOSIsICJob3N0YXBAbGlzdHMuaW5mcmFkZWFkLm9yZyIsICJiZTllNGEiXQ== Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n02.prod.us-west-2.postgun.com with SMTP id 5f2a3ca921814c78d92c1398 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 05 Aug 2020 04:59:21 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id A52FEC43395; Wed, 5 Aug 2020 04:59:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from alokad-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: alokad) by smtp.codeaurora.org (Postfix) with ESMTPSA id B565BC4339C; Wed, 5 Aug 2020 04:59:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org B565BC4339C Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=alokad@codeaurora.org From: Aloka Dixit To: j@w1.fi Subject: [PATCH] hostapd: Fix max BSSID indicator in MBSSID IE Date: Tue, 4 Aug 2020 21:59:11 -0700 Message-Id: <20200805045911.26949-1-alokad@codeaurora.org> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200805_005945_060342_1E4104A6 X-CRM114-Status: GOOD ( 13.43 ) 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 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [69.72.43.7 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [69.72.43.7 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -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.0 RCVD_IN_MSPIKE_WL Mailspike good senders 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: hostap@lists.infradead.org, Aloka Dixit Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The calculation of max BSSID indicator should include all transmitting and non-transmitting profiles from the MBSSID set. Also, for one transmitting and one non-transmitting VAPs, the max BSSID indicator should be 1 however it is set to 2. This patch fixes both issues. Signed-off-by: Aloka Dixit --- Depends-on: "multiple_bssid: add support" series in upstream review src/ap/ieee802_11.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) base-commit: 02f4946172dea335d1ed7fde7e8de3ebbdef859a prerequisite-patch-id: 6f0719fba383f1e0dc762be7da5788029f34cc3a prerequisite-patch-id: 22601d88ad72e4e9addec18b0c9257c484045832 prerequisite-patch-id: 0705e4aacca8246468960bbc15f8286d666af505 prerequisite-patch-id: 8d54a8fe0bca799e6bcc4a00dd85106a8237dd5d prerequisite-patch-id: ac87754ecaa990144d7fbf75ed2cebd2beab5de4 prerequisite-patch-id: e7bb814f80cee4bfe863b990695fcc3ba5229248 prerequisite-patch-id: 95cb792fddaafba73bb5e62dc6062b8e851b1421 diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index b0575337b2ee..fbb1dfa3ffa0 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -5703,9 +5703,9 @@ static u8 * hostapd_eid_multiple_bssid_chunk(struct hostapd_data *hapd, multiple_bssid_too_big: *count = i; - *num_offset = (u8)ceil(log2(num)); - if (*num_offset < 2) - *num_offset = 2; + *num_offset = (u8)ceil(log2(hapd->iface->num_bss)); + if (*num_offset < 1) + *num_offset = 1; *size_offset = (eid - size_offset) - 1; return eid;