From patchwork Thu Sep 12 22:04:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ahmed Zaki X-Patchwork-Id: 1161785 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=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mzse98e7"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="lI2jC7ts"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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 46Tt9w5CKCz9s4Y for ; Fri, 13 Sep 2019 08:05:24 +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: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=XkrkoV7Pf2AMcg05m1E3jevAqiUHPFBk8v35c2oN4dc=; b=mzs e98e7uCgxZYJ1z0vi3DQpfR/bKa7bpVMdSGVruDYRKBOqOxmYLLjV2QDblGU/JDfwxMWqmpUnHqSp 15JdCkeC6Uly+yVrvZ4JwOxWUN0/XhNX3Rl8/W8qFBXH6LX1u2CvUczdN9MsCfxGzGAKXvjeO3fm9 Fb/Ppdh/gtxZ9D+fVF86EmzhFekjT4YMKUHevhlO28BpAK9EZ4vQtyTIl8K80qy5z5gWXMDZflbUY gF9y+Ytn9e2b6KxBHZ4EVxVCZf/cyAAhbZ2+wW+fLGGYucS4YQcKstxlqPE0esaYllW/CfgonqNE/ jdFG/FqbRDK/BWGGsArSjZdPS/jAF/A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1i8XDN-0004qH-DC; Thu, 12 Sep 2019 22:05:21 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1i8XDK-0004pn-JZ for hostap@lists.infradead.org; Thu, 12 Sep 2019 22:05:19 +0000 Received: by mail-wm1-x343.google.com with SMTP id v17so25987wml.4 for ; Thu, 12 Sep 2019 15:05:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=x3DRUoyFq+DI6COXSjiD4byRW4CCgNg+MFrhPGyLJnU=; b=lI2jC7tsez7/CFtdX0/oUJ+eTDImUQk4HM7bleNNt9BrRg5zhXLCc0PpFgbxJjKrhi JLpL2tIo/empcjJAyW12YowsiSo19VBmKcguEv03+2E8ao3pueDggdHNcCRoYzntN5EG TCYnKMut67RKs1P0qZ2VmnqFKGkO1CHueYiBrd2ABxM0hIqepeSIBLikVj6oxwctxySi QbvIOjccmb1hfEl5GxVn+MkQ4kb78BYkZKLQSf8gNPRm+rH2a9wS3CgVfBEz9fe20w7n OKQK+Qrx2Qcl2PULolF4PIjv2XuHJYBIVnKGEvCePN+tbOgwb47opqjPrxnQKj9pJF45 Vq/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=x3DRUoyFq+DI6COXSjiD4byRW4CCgNg+MFrhPGyLJnU=; b=kP65iN6VakuAmkFH9HkhVyhqtK+QJs5xYF8/paqF/MJTIWSknyEz/u5lI7S5AwIjdm 3FDP6X5Ij9ZRNIOjoJaIuJeC2LW+Lf/a+38woQCuethDISp/1dJ65WgEkukkbK/efoAr fHqj9dS11Dvwppz1nCN9gHRMYTDV64ew0vxrKo/WUEWp03RTyJgSQV132ZbpEvH/UeF7 MyqfpxwWNVXJmZ15JL33P78Jxola9Baz0gHIgS+ypdCG8GupPXlLiv3e3okY8wHd++7H 7sXV2Yq0gIsTl1s8okPXeQ2qsnFOoww/OaSbwtjlmmRMx5vcuyHcH3YLveKdnMd6rC9f BINg== X-Gm-Message-State: APjAAAUwssm5wajakJ3rMNaRDpfoH9D96Z0hY25sNcCjUauIPWLNSKih AMQllAwC1vbtqsQNnyt2zGQHmDOh+8k= X-Google-Smtp-Source: APXvYqwV4SOq2+t5lHp7GYRtaZQewvuDODnZxGXtRrFyDb1xt5HGO4Ixe1SVFYIJGn0CGKhEASgcpA== X-Received: by 2002:a1c:ed04:: with SMTP id l4mr589336wmh.81.1568325916437; Thu, 12 Sep 2019 15:05:16 -0700 (PDT) Received: from localhost.localdomain ([156.196.251.77]) by smtp.googlemail.com with ESMTPSA id e9sm497636wme.3.2019.09.12.15.05.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Sep 2019 15:05:15 -0700 (PDT) From: Ahmed Zaki To: hostap@lists.infradead.org Subject: [PATCH] Fix bss_is_ess() in case of an IBSS network Date: Thu, 12 Sep 2019 16:04:29 -0600 Message-Id: <20190912220429.32103-1-anzaki@gmail.com> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190912_150518_671320_8AB96B81 X-CRM114-Status: GOOD ( 10.47 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:343 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (anzaki[at]gmail.com) -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.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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: Ahmed Zaki MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The check for the ESS or IBSS bits in the BSS caps is done via equality to IEEE80211_CAP_ESS (0x01). This will only be true for AP/ESS and will fail in case of IBSS (0x02). --- wpa_supplicant/events.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index f28e4399e..c8208e53e 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -906,8 +906,7 @@ static int bss_is_ess(struct wpa_bss *bss) IEEE80211_CAP_DMG_AP; } - return ((bss->caps & (IEEE80211_CAP_ESS | IEEE80211_CAP_IBSS)) == - IEEE80211_CAP_ESS); + return (bss->caps & IEEE80211_CAP_ESS || bss->caps & IEEE80211_CAP_IBSS); }