Merge branch 'yggdrasil-network-develop' into develop

This commit is contained in:
vadym 2021-09-22 00:18:09 +03:00
commit 6d21306305
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 { type yggArgs struct {
genconf bool genconf bool
useconf bool useconf bool
useconffile string
normaliseconf bool normaliseconf bool
confjson bool confjson bool
autoconf bool autoconf bool
ver bool ver bool
logto string
getaddr bool getaddr bool
getsnet bool getsnet bool
useconffile string
logto string
loglevel string loglevel string
} }

View file

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