netns.sh stuck at ncat.

René van Dorst opensource at vdorst.com
Tue Nov 21 08:54:01 CET 2017


Quoting "Jason A. Donenfeld" <Jason at zx2c4.com>:

> This is pretty strange looking, and appears like it's a userland issue
> -- like the versions of ncat or ss or whatever weird scripting hacks
> in netns.sh aren't working well with the tools installed or some
> networking sysctl I forgot to toggle... Maybe one quick way of testing
> if it's an ss issue (old RHEL tools, or the like) would be to change
> the function body of waitncatudp into just `sleep 2` or something.

Maybe it did not work before but I didn't noticed because ncat was not  
installed until yesterday.
I tried old wireguard module not the userland tools. But the same  
results stuck at ncat.

This Cubox is running Ubuntu xenial 16.04.3 LTS (GNU/Linux 4.13.14 armv7l)

ncat comes with package nmap

root at cubox-es:~# apt show nmap
Package: nmap
Version: 7.01-2ubuntu2

ss utility, iproute2-ss151103


With sleep 2 it works again.


My script modifications.

root at cubox-es:/usr/src/WireGuard/src/tests# git diff ./netns.sh
diff --git a/src/tests/netns.sh b/src/tests/netns.sh
index 2ad8d88..7718da6 100755
--- a/src/tests/netns.sh
+++ b/src/tests/netns.sh
@@ -38,7 +38,7 @@ ip1() { pretty 1 "ip $*"; ip -n $netns1 "$@"; }
  ip2() { pretty 2 "ip $*"; ip -n $netns2 "$@"; }
  sleep() { read -t "$1" -N 0 || true; }
  waitiperf() { pretty "${1//*-}" "wait for iperf:5201"; while [[ $(ss  
-N "$1" -tlp 'sport = 5201') != *iperf3* ]]; do sleep 0.1; done; }
-waitncatudp() { pretty "${1//*-}" "wait for udp:1111"; while [[ $(ss  
-N "$1" -ulp 'sport = 1111') != *ncat* ]]; do sleep 0.1; done; }
+waitncatudp() { pretty "${1//*-}" "wait for udp:1111"; sleep 2; }
  waitncattcp() { pretty "${1//*-}" "wait for tcp:1111"; while [[ $(ss  
-N "$1" -tlp 'sport = 1111') != *ncat* ]]; do sleep 0.1; done; }
  waitiface() { pretty "${1//*-}" "wait for $2 to come up"; ip netns  
exec "$1" bash -c "while [[ \$(< \"/sys/class/net/$2/operstate\") !=  
up ]]; do read -t .1 -N 0 || true; done;"; }

Greats,

René van Dorst.



More information about the WireGuard mailing list