From 12cba9dac91e4da9720c3662e5b267bca7e1ac7c Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Sat, 26 May 2018 20:59:15 +0100 Subject: [PATCH] Fix passing CIDR to tun.setup --- src/yggdrasil/core.go | 3 ++- yggdrasil.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/yggdrasil/core.go b/src/yggdrasil/core.go index 907db6a8..55306197 100644 --- a/src/yggdrasil/core.go +++ b/src/yggdrasil/core.go @@ -125,7 +125,8 @@ func (c *Core) Start(nc *config.NodeConfig, log *log.Logger) error { return err } - if err := c.tun.setup(nc.IfName, nc.IfTAPMode, net.IP(c.router.addr[:]).String(), nc.IfMTU); err != nil { + ip := net.IP(c.router.addr[:]).String() + if err := c.tun.setup(nc.IfName, nc.IfTAPMode, fmt.Sprintf("%s/8", ip), nc.IfMTU); err != nil { c.log.Println("Failed to start TUN/TAP") return err } diff --git a/yggdrasil.go b/yggdrasil.go index 8a8ab2ef..72cacb05 100644 --- a/yggdrasil.go +++ b/yggdrasil.go @@ -212,7 +212,7 @@ func main() { // start Yggdrasil. This will start the router, switch, DHT node, TCP and UDP // sockets, TUN/TAP adapter and multicast discovery port. if err := n.core.Start(cfg, logger); err != nil { - logger.Println("An error occured during startup") + logger.Println("An error occurred during startup") panic(err) } // If any static peers were provided in the configuration above then we should