From 43fe20f2bdef70f67288a6ac22daaf4fc9d372e8 Mon Sep 17 00:00:00 2001 From: Tim Wilkinson Date: Thu, 21 Jul 2022 07:50:28 -0700 Subject: [PATCH] Fix random iperf failures (#445) --- files/www/cgi-bin/iperf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/files/www/cgi-bin/iperf b/files/www/cgi-bin/iperf index b499ed21..b17ea7ed 100755 --- a/files/www/cgi-bin/iperf +++ b/files/www/cgi-bin/iperf @@ -37,6 +37,9 @@ require("uci") require("luci.sys") require("nixio") +local info = require("aredn.info") + +local node = info.get_nvram("node") local q = os.getenv("QUERY_STRING") or "" local server = q:match("server=([^&]*)") @@ -51,7 +54,7 @@ if uci.cursor():get("aredn", "@iperf[0]", "enable") == "0" then elseif not server then print("
Provide a server name to run a test between this client and a server [/cgi-bin/iperf?server=<ServerName>&protocol=<udp|tcp>]
") elseif server == "" then - os.execute("killall iperf3; iperf3 -s -D -1") + os.execute("killall iperf3; iperf3 -s -D -1 -B " .. node) for _ = 1,5 do if io.popen("netstat -ln | grep 0.0.0.0:5201"):read("*a") ~= "" then