Development discussion of WireGuard
 help / color / mirror / Atom feed
From: "René van Dorst" <opensource@vdorst.com>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: WireGuard list <wireguard@lists.zx2c4.com>
Subject: Re: netns.sh stuck at ncat.
Date: Tue, 21 Nov 2017 07:54:01 +0000	[thread overview]
Message-ID: <20171121075401.Horde.gAK_8RJbLyuvqgW8amLTrYK@www.vdorst.com> (raw)
In-Reply-To: <CAHmME9r3BDd97=tZZg1kxn_gyQPrdfsdOkLo-Zv=1-rZWDqnHg@mail.gmail.com>

Quoting "Jason A. Donenfeld" <Jason@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@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@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.

      reply	other threads:[~2017-11-21  7:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-20 23:14 René van Dorst
2017-11-21  0:23 ` Jason A. Donenfeld
2017-11-21  0:38   ` Jason A. Donenfeld
2017-11-21  7:54     ` René van Dorst [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171121075401.Horde.gAK_8RJbLyuvqgW8amLTrYK@www.vdorst.com \
    --to=opensource@vdorst.com \
    --cc=Jason@zx2c4.com \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).