aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/tests/netns.sh
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-11-07 20:14:43 +0900
committerJason A. Donenfeld <Jason@zx2c4.com>2017-11-10 16:20:09 +0900
commitab9befbe4118850bcd58b33064f020d69b44dea6 (patch)
tree49c91f885ae48184d61f0175f6ca9c1bd13fa801 /src/tests/netns.sh
parentcompat: 4.4.0 has strange ECN function (diff)
downloadwireguard-monolithic-historical-ab9befbe4118850bcd58b33064f020d69b44dea6.tar.xz
wireguard-monolithic-historical-ab9befbe4118850bcd58b33064f020d69b44dea6.zip
netlink: make sure we reserve space for NLMSG_DONE
Otherwise, if messages pack really close together, we'll exceed the size of the sk_buff and return ENOBUFS. I suspect this has been the cause of a lot of weird bugs that people just worked around by increasing the receive buffer size. This actually addresses the root cause.
Diffstat (limited to 'src/tests/netns.sh')
-rwxr-xr-xsrc/tests/netns.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tests/netns.sh b/src/tests/netns.sh
index 9a12a19..2ad8d88 100755
--- a/src/tests/netns.sh
+++ b/src/tests/netns.sh
@@ -415,6 +415,15 @@ while read -r line; do
done < <(n0 wg show wg0 allowed-ips)
((i == 40))
ip0 link del wg0
+ip0 link add wg0 type wireguard
+config=( )
+for i in {1..29}; do
+ config+=( "[Peer]" "PublicKey=$(wg genkey)" )
+done
+config+=( "[Peer]" "PublicKey=$(wg genkey)" "AllowedIPs=255.2.3.4/32,abcd::255/128" )
+n0 wg setconf wg0 <(printf '%s\n' "${config[@]}")
+n0 wg showconf wg0 > /dev/null
+ip0 link del wg0
! n0 wg show doesnotexist || false