From patchwork Fri Jul 12 10:48:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 1131273 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=narfation.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nZrr893r"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=narfation.org header.i=@narfation.org header.b="kTz0Vr+A"; 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 45lV6N1Tt4z9s8m for ; Fri, 12 Jul 2019 20:49:16 +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: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=r5EGOk4PFHpc87udkVInUdX2MStiDqYZj6+pptPJ8Q4=; b=nZrr893re22uF/ WfcN38SJ24S5uYl/2LGXdMkzNc4CMHFF7SJBF+BO7+LzCV1P20435MTfGHWmMXrW4sAcW4Rv3zWIO AifvyK6cdS7gbL2UzdOHDnnNJbE9kRKj+SA8MtUfZqh/c+vee80gQGhww6xQ5trIivSFkjH//6HfM I8t1yWOwcyY+2IQh7ZhySXR3gfjfv7z8t44ukiHmza3fFTDIyezfnJ8/kJRNrPu6mbh1BlcVwwO4J zlZKD7On/2SC7+XroW1TGVCaH2Lu5lSBIp5Tg46MimDGxOvg6HZYdciSOv4MWKQ0NmMLOXeP1d0YB UhXQW0eAok+AT/o7/zuA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hlt72-0002N4-SB; Fri, 12 Jul 2019 10:49:12 +0000 Received: from dvalin.narfation.org ([213.160.73.56]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hlt6z-0002M9-Hz for hostap@lists.infradead.org; Fri, 12 Jul 2019 10:49:11 +0000 Received: from sven-desktop.home.narfation.org (p5B34C47F.dip0.t-ipconnect.de [91.52.196.127]) by dvalin.narfation.org (Postfix) with ESMTPSA id 0CC362013F; Fri, 12 Jul 2019 10:49:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1562928548; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=ml+P9SCa9DT6WYG0+1eYt56URSryQkSApWc3MTMYwtA=; b=kTz0Vr+A3bedacpoG0OiZ5bR9/uJ0AhwBaBmxgGRXH4zEUXDm67eaUuo1mTongvo6TGR6c FTnMHGy1dTaNKACoLbX/MLCpGuUiU3Qfc9bs+G8MMuhNFyw7cP6cvwTgys7BWYepmIQ/5L Qzv9MAchHN/K2w5yPUAGQz55qVRM9CU= From: Sven Eckelmann To: hostap@lists.infradead.org Subject: [PATCH] tests: Fix wlan.mesh.config.cap workaround for test_wpas_mesh_max_peering Date: Fri, 12 Jul 2019 12:48:53 +0200 Message-Id: <20190712104853.17066-1-sven@narfation.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1562928548; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=ml+P9SCa9DT6WYG0+1eYt56URSryQkSApWc3MTMYwtA=; b=LdwM5MlUBII3MuK3aT4FMJN+phP0KibcX6hPbjAbT04jdTnefARKB4IN3g1J0hHVP2ztUi 3yeCM3t/l4AMYR8QKpNlV8++k/A8qD1XJFRFCxytpGbZPQqrhGVkkhe4PUAjsmFOF2FWNP ZLAvakKeyOIb2D2/5ndvQ1fCqQ2kQ4A= ARC-Seal: i=1; s=20121; d=narfation.org; t=1562928548; a=rsa-sha256; cv=none; b=q0a80/LhaCPJSimykrAjvfXvSJK2ZWA9U3eWX1hrPiImaEPXnM9gd7xMHsKC8V16sn9oay xof5CKBc0d9QPeGfg+cuXWayY+q+05ci0PcCq1aZ8350IL4D04qAogFSbQjx5twWF/J6GC XBPEQCl6be3LqtJfc502lUfHmS3Px1Y= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=sven smtp.mailfrom=sven@narfation.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190712_034909_920722_D27B7ACA X-CRM114-Status: UNSURE ( 8.39 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [213.160.73.56 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -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: Johannes Berg , Sven Eckelmann Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The wlan.mesh.config doesn't have to be the last element of beacon. Things like VHT or HE oper/cap are usually follow the mesh configuration element. The workaround must first get the position of a correct reference value in wlan.mesh.config (ps_protocol) and then calculate the correct wlan.mesh.config.cap offset based on that. Reported-by: Johannes Berg Fixes: 2cbaf0de223b ("tests: Work around tshark bug in wpas_mesh_max_peering") Signed-off-by: Sven Eckelmann --- Just as additional information: This problem was introduced for wireshark in commit 3c427376579a ("802.11: Use proto_tree_add_bitmask") - part of 2.4.0-rc0. The fix was added after 3.0.0 with commit f3ef8575d462 ("ieee80211: fix wrong offset for mesh configuration capability bitmask") --- tests/hwsim/test_wpas_mesh.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/hwsim/test_wpas_mesh.py b/tests/hwsim/test_wpas_mesh.py index 5b8b16602..cb1bb8c31 100644 --- a/tests/hwsim/test_wpas_mesh.py +++ b/tests/hwsim/test_wpas_mesh.py @@ -877,8 +877,21 @@ def test_wpas_mesh_max_peering(dev, apdev, params): out = run_tshark_json(capfile, filt + " && wlan.sa == " + addr) pkts = json.loads(out) for pkt in pkts: + wlan = pkt["_source"]["layers"]["wlan"] + if "wlan.tagged.all" not in wlan: + continue + + tagged = wlan["wlan.tagged.all"] + if "wlan.tag" not in tagged: + continue + + wlan_tag = tagged["wlan.tag"] + if "wlan.mesh.config.ps_protocol_raw" not in wlan_tag: + continue + frame = pkt["_source"]["layers"]["frame_raw"][0] - cap = int(frame[-2:], 16) + cap_offset = wlan_tag["wlan.mesh.config.ps_protocol_raw"][1] + 6 + cap = int(frame[(cap_offset * 2):(cap_offset * 2 + 2)], 16) if cap & 0x01: one[idx] += 1 else: