Fix passing CIDR to tun.setup

This commit is contained in:
Neil Alexander 2018-05-26 20:59:15 +01:00
parent ef2ed4b04a
commit 12cba9dac9
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
2 changed files with 3 additions and 2 deletions

View file

@ -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
}

View file

@ -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