From patchwork Mon Dec 25 10:20:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Otcheretianski X-Patchwork-Id: 1879976 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=oiLPAe+h; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=SG3OlE2r; 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 4Symb45mCcz20Qr for ; Mon, 25 Dec 2023 03:24:47 +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:References:In-Reply-To: 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: List-Owner; bh=j5g8GWkR25xE4bdGf3t5TZf9JrG7O010z1BwBppNSF8=; b=oiLPAe+hS5MiE+ fg2Nbrp4ge9zdDC0uWzmbNhiJ1xEnn4Vhd75XxdKyDdBDWVeHk4zHnTqPeYHm38pQ1YfxiDxMimVA 7YwP5uBtK6g3gydY7SAWbIBIq57kXS24tZmngpbqS0TaNeUJtMx7b2vAWufEeuskmXbvnCFqAkvi1 esSrxBhpQp+VMhd+TRCwWh1ZI/642TXji6R1HWz/LWhVIX5gY2mGkBZtEPbl19REgzAnsqLJfwJeh bOGnd0mh2EsnYOW7BLaE46q8hGEVCySVRMyddI9WIfkCCV8aB/tRIDQkbIv8q0M43MkKRZqs7uPvO 8vYrWyysgDGa3u28oplw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rHRGr-009c1r-2F; Sun, 24 Dec 2023 16:24:09 +0000 Received: from mgamail.intel.com ([192.55.52.43]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rHRGo-009c18-2U for hostap@lists.infradead.org; Sun, 24 Dec 2023 16:24:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1703435046; x=1734971046; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Z4f7hOmAGny6nnygS27C5Xb+9OQzbgzruuKyXu580pY=; b=SG3OlE2rcxnwIOqaBBpMmEzpye6JYsy3OKHjSldGoo4ULyDxUk33J4Rr 9Ats320PszCHXltlqF29Lyii12qkbXUxSY+8RPFjb8ARAe9cj+cCjlM9L RiPVcOBqIFw4MUv/CU2Khi8mDIJq+J54kCK/dJ9igsbQnWMs1w5y/ZeX/ ia12VA91dtawFs3YKklXDIMCzKMLHvWGRLxbZ06wK2kWs5R9ppHTFTcOf If0YCrzYno9HMchSAsa6rAI9DyJn2uAfOjqoCWzvAXY04pXS/Va1w1lzl LNm/yXwVbqK0I2CkunNAmeaOY57I/RkrrHMRcGEF8Rg0sCF5hNch9komS g==; X-IronPort-AV: E=McAfee;i="6600,9927,10934"; a="482420992" X-IronPort-AV: E=Sophos;i="6.04,301,1695711600"; d="scan'208";a="482420992" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Dec 2023 08:24:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10934"; a="777554283" X-IronPort-AV: E=Sophos;i="6.04,301,1695711600"; d="scan'208";a="777554283" Received: from unknown (HELO WEIS0042.iil.intel.com) ([10.12.217.211]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Dec 2023 08:24:04 -0800 From: Andrei Otcheretianski To: hostap@lists.infradead.org Cc: Benjamin Berg Subject: [PATCH 02/12] hwsim: explicitly set address to bind to Date: Mon, 25 Dec 2023 12:20:59 +0200 Message-ID: <20231225102109.2853783-3-andrei.otcheretianski@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231225102109.2853783-1-andrei.otcheretianski@intel.com> References: <20231225102109.2853783-1-andrei.otcheretianski@intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231224_082406_822445_4C763F58 X-CRM114-Status: GOOD ( 10.66 ) 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: From: Benjamin Berg pyrad internally uses socket.getaddrinfo. While it is documented that one can pass an empty string to bind to all interfaces. The underlying function expects None instead though, breaking the call. Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [192.55.52.43 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record 2.5 DATE_IN_FUTURE_12_24 Date: is 12 to 24 hours after Received: date -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.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender 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 From: Benjamin Berg pyrad internally uses socket.getaddrinfo. While it is documented that one can pass an empty string to bind to all interfaces. The underlying function expects None instead though, breaking the call. Either way, it does not hurt to set the bind address to 127.0.0.1 explicitly, so do so to avoid issues. Signed-off-by: Benjamin Berg --- tests/hwsim/test_eap_proto.py | 2 +- tests/hwsim/test_radius.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/hwsim/test_eap_proto.py b/tests/hwsim/test_eap_proto.py index a1270ac3c6..e125481717 100644 --- a/tests/hwsim/test_eap_proto.py +++ b/tests/hwsim/test_eap_proto.py @@ -160,7 +160,7 @@ def start_radius_server(eap_handler): srv.hosts["127.0.0.1"] = pyrad.server.RemoteHost("127.0.0.1", b"radius", "localhost") - srv.BindToAddress("") + srv.BindToAddress("127.0.0.1") t_stop = threading.Event() t = threading.Thread(target=run_pyrad_server, args=(srv, t_stop, eap_handler)) t.start() diff --git a/tests/hwsim/test_radius.py b/tests/hwsim/test_radius.py index 5f1f4f175f..224bff177d 100644 --- a/tests/hwsim/test_radius.py +++ b/tests/hwsim/test_radius.py @@ -1132,7 +1132,7 @@ def test_radius_protocol(dev, apdev): srv.hosts["127.0.0.1"] = pyrad.server.RemoteHost("127.0.0.1", b"radius", "localhost") - srv.BindToAddress("") + srv.BindToAddress("127.0.0.1") t_events = {} t_events['stop'] = threading.Event() t_events['msg_auth'] = threading.Event() @@ -1249,7 +1249,7 @@ def start_radius_psk_server(psk, invalid_code=False, acct_interim_interval=0, srv.hosts["127.0.0.1"] = pyrad.server.RemoteHost("127.0.0.1", b"radius", "localhost") - srv.BindToAddress("") + srv.BindToAddress("127.0.0.1") t_events = {} t_events['stop'] = threading.Event() t_events['psk'] = psk @@ -1595,7 +1595,7 @@ def test_ap_vlan_wpa2_psk_radius_required(dev, apdev): srv.hosts["127.0.0.1"] = pyrad.server.RemoteHost("127.0.0.1", b"radius", "localhost") - srv.BindToAddress("") + srv.BindToAddress("127.0.0.1") t_events = {} t_events['stop'] = threading.Event() t_events['long'] = threading.Event()