Merge branch 'develop' of https://github.com/yggdrasil-network/yggdrasil-go into yggdrasil-network-develop

This commit is contained in:
vadym 2021-09-22 00:17:33 +03:00
commit 062e07be6f
2 changed files with 4 additions and 4 deletions

View file

@ -185,14 +185,14 @@ func setLogLevel(loglevel string, logger *log.Logger) {
type yggArgs struct {
genconf bool
useconf bool
useconffile string
normaliseconf bool
confjson bool
autoconf bool
ver bool
logto string
getaddr bool
getsnet bool
useconffile string
logto string
loglevel string
}

View file

@ -114,11 +114,11 @@ func (tun *TunAdapter) _start() error {
if tun.isOpen {
return errors.New("TUN module is already started")
}
tun.config.RLock()
defer tun.config.RUnlock()
if tun.config == nil {
return errors.New("no configuration available to TUN")
}
tun.config.RLock()
defer tun.config.RUnlock()
tun.addr = tun.rwc.Address()
tun.subnet = tun.rwc.Subnet()
addr := fmt.Sprintf("%s/%d", net.IP(tun.addr[:]).String(), 8*len(address.GetPrefix())-1)