From 8b9a91be57c771da86358dbce2ee8860e20ea2ef Mon Sep 17 00:00:00 2001 From: Arceliar Date: Sat, 28 Apr 2018 16:39:58 -0500 Subject: [PATCH 1/2] possibly fix weird issue I was having with netns, still not sure I understand why it was a problem --- src/yggdrasil/debug.go | 1 + src/yggdrasil/tun_linux.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/yggdrasil/debug.go b/src/yggdrasil/debug.go index faa7471e..e70e8a61 100644 --- a/src/yggdrasil/debug.go +++ b/src/yggdrasil/debug.go @@ -236,6 +236,7 @@ func (c *Core) DEBUG_startTunWithMTU(ifname string, iftapmode bool, mtu int) { if err != nil { panic(err) } + c.log.Println("Setup TUN/TAP:", c.tun.iface.Name(), straddr) go func() { panic(c.tun.read()) }() } go func() { panic(c.tun.write()) }() diff --git a/src/yggdrasil/tun_linux.go b/src/yggdrasil/tun_linux.go index 28cccda6..42ff4a4a 100644 --- a/src/yggdrasil/tun_linux.go +++ b/src/yggdrasil/tun_linux.go @@ -48,7 +48,8 @@ func (tun *tunDevice) setupAddress(addr string) error { } for _, ifce := range ifces { if ifce.Name == tun.iface.Name() { - netIF = &ifce + var newIF = ifce + netIF = &newIF // Don't point inside ifces, it's apparently unsafe?... } } if netIF == nil { From f6cba4efc109f10ffed1f00704dc07fbef86b2d6 Mon Sep 17 00:00:00 2001 From: Arceliar Date: Sat, 28 Apr 2018 16:45:37 -0500 Subject: [PATCH 2/2] fix loopback devices in s channel test --- misc/run-schannel-netns | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/misc/run-schannel-netns b/misc/run-schannel-netns index fe85f450..35c197c0 100755 --- a/misc/run-schannel-netns +++ b/misc/run-schannel-netns @@ -44,6 +44,13 @@ ip netns exec node5 tc qdisc add dev veth54 root tbf rate 100mbit burst 8192 lat ip netns exec node4 tc qdisc add dev veth46 root tbf rate 10mbit burst 8192 latency 1ms ip netns exec node6 tc qdisc add dev veth64 root tbf rate 10mbit burst 8192 latency 1ms +ip netns exec node1 ip link set lo up +ip netns exec node2 ip link set lo up +ip netns exec node3 ip link set lo up +ip netns exec node4 ip link set lo up +ip netns exec node5 ip link set lo up +ip netns exec node6 ip link set lo up + ip netns exec node1 ./run --autoconf --pprof &> /dev/null & ip netns exec node2 ./run --autoconf --pprof &> /dev/null & ip netns exec node3 ./run --autoconf --pprof &> /dev/null &