mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
Give nodeconfig to tun
This commit is contained in:
parent
738a9da796
commit
aed3c7e784
3 changed files with 39 additions and 13 deletions
|
@ -2,7 +2,6 @@ package yggdrasil
|
|||
|
||||
import (
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net"
|
||||
|
@ -110,12 +109,13 @@ func (c *Core) UpdateConfig(config *config.NodeConfig) {
|
|||
|
||||
components := []chan chan error{
|
||||
c.admin.reconfigure,
|
||||
//c.searches.reconfigure,
|
||||
//c.dht.reconfigure,
|
||||
//c.sessions.reconfigure,
|
||||
//c.peers.reconfigure,
|
||||
//c.router.reconfigure,
|
||||
//c.switchTable.reconfigure,
|
||||
c.searches.reconfigure,
|
||||
c.dht.reconfigure,
|
||||
c.sessions.reconfigure,
|
||||
c.peers.reconfigure,
|
||||
c.router.reconfigure,
|
||||
c.router.tun.reconfigure,
|
||||
c.switchTable.reconfigure,
|
||||
c.tcp.reconfigure,
|
||||
c.multicast.reconfigure,
|
||||
}
|
||||
|
@ -240,8 +240,7 @@ func (c *Core) Start(nc *config.NodeConfig, log *log.Logger) error {
|
|||
return err
|
||||
}
|
||||
|
||||
ip := net.IP(c.router.addr[:]).String()
|
||||
if err := c.router.tun.start(nc.IfName, nc.IfTAPMode, fmt.Sprintf("%s/%d", ip, 8*len(address.GetPrefix())-1), nc.IfMTU); err != nil {
|
||||
if err := c.router.tun.start(); err != nil {
|
||||
c.log.Println("Failed to start TUN/TAP")
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue