5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-11-22 15:20:30 +00:00

Fix debug builds (foiled by debug builds every time)

This commit is contained in:
Neil Alexander 2018-12-14 18:10:39 +00:00
parent 2a38ad07cd
commit f28360ce4d
No known key found for this signature in database
GPG Key ID: A02A2019A2BB0944

View File

@ -68,11 +68,11 @@ func (c *Core) DEBUG_getEncryptionPublicKey() boxPubKey {
} }
func (c *Core) DEBUG_getSend() chan<- []byte { func (c *Core) DEBUG_getSend() chan<- []byte {
return c.tun.send return c.router.tun.send
} }
func (c *Core) DEBUG_getRecv() <-chan []byte { func (c *Core) DEBUG_getRecv() <-chan []byte {
return c.tun.recv return c.router.tun.recv
} }
// Peer // Peer
@ -304,18 +304,18 @@ func (c *Core) DEBUG_startTunWithMTU(ifname string, iftapmode bool, mtu int) {
addr := c.DEBUG_getAddr() addr := c.DEBUG_getAddr()
straddr := fmt.Sprintf("%s/%v", net.IP(addr[:]).String(), 8*len(address_prefix)) straddr := fmt.Sprintf("%s/%v", net.IP(addr[:]).String(), 8*len(address_prefix))
if ifname != "none" { if ifname != "none" {
err := c.tun.setup(ifname, iftapmode, straddr, mtu) err := c.router.tun.setup(ifname, iftapmode, straddr, mtu)
if err != nil { if err != nil {
panic(err) panic(err)
} }
c.log.Println("Setup TUN/TAP:", c.tun.iface.Name(), straddr) c.log.Println("Setup TUN/TAP:", c.router.tun.iface.Name(), straddr)
go func() { panic(c.tun.read()) }() go func() { panic(c.router.tun.read()) }()
} }
go func() { panic(c.tun.write()) }() go func() { panic(c.router.tun.write()) }()
} }
func (c *Core) DEBUG_stopTun() { func (c *Core) DEBUG_stopTun() {
c.tun.close() c.router.tun.close()
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -546,7 +546,7 @@ func DEBUG_simLinkPeers(p, q *peer) {
} }
func (c *Core) DEBUG_simFixMTU() { func (c *Core) DEBUG_simFixMTU() {
c.tun.mtu = 65535 c.router.tun.mtu = 65535
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////