]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Explicitly set address to bind to
authorBenjamin Berg <benjamin.berg@intel.com>
Mon, 25 Dec 2023 10:20:59 +0000 (12:20 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 13 Jan 2024 17:48:09 +0000 (19:48 +0200)
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 <benjamin.berg@intel.com>
tests/hwsim/test_eap_proto.py
tests/hwsim/test_radius.py

index a1270ac3c6b95d09467fd6cf0590e5b9db8f04f9..e125481717cc0a4dc23f642ec5f5f117a70bd320 100644 (file)
@@ -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()
index 5f1f4f175f1a8334dd97d73b9a7c4325367522a1..224bff177d826474a764eb262b31251ceba52ff8 100644 (file)
@@ -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()