diff --git a/src/tun/tun.go b/src/tun/tun.go index 9ec7bc9..fcd597b 100644 --- a/src/tun/tun.go +++ b/src/tun/tun.go @@ -108,7 +108,7 @@ func (tun *TunAdapter) _start() error { tun.addr = tun.rwc.Address() tun.subnet = tun.rwc.Subnet() prefix := address.GetPrefix() - addr := fmt.Sprintf("%s/%d", net.IP(tun.addr[:]).String(), 8*len(prefix)-1) + addr := fmt.Sprintf("%s/%d", net.IP(tun.addr[:]).String(), 8*len(prefix[:])-1) if tun.config.name == "none" || tun.config.name == "dummy" { tun.log.Debugln("Not starting TUN as ifname is none or dummy") tun.isEnabled = false