diff --git a/src/yggdrasil/tun_bsd.go b/src/yggdrasil/tun_bsd.go index 5dbdd7d7..721b6778 100644 --- a/src/yggdrasil/tun_bsd.go +++ b/src/yggdrasil/tun_bsd.go @@ -137,7 +137,7 @@ func (tun *tunDevice) setupAddress(addr string) error { copy(ar.ifr_name[:], tun.iface.Name()) ar.ifru_addr.sin6_len = uint8(unsafe.Sizeof(ar.ifru_addr)) ar.ifru_addr.sin6_family = unix.AF_INET6 - parts := strings.Split(strings.TrimRight(addr, "/8"), ":") + parts := strings.Split(strings.Split(addr, "/")[0], ":") for i := 0; i < 8; i++ { addr, _ := strconv.ParseUint(parts[i], 16, 16) b := make([]byte, 16) diff --git a/src/yggdrasil/tun_darwin.go b/src/yggdrasil/tun_darwin.go index 94a63de2..72b9cf08 100644 --- a/src/yggdrasil/tun_darwin.go +++ b/src/yggdrasil/tun_darwin.go @@ -84,7 +84,7 @@ func (tun *tunDevice) setupAddress(addr string) error { ar.ifra_addr.sin6_len = uint8(unsafe.Sizeof(ar.ifra_addr)) ar.ifra_addr.sin6_family = unix.AF_INET6 - parts := strings.Split(strings.TrimRight(addr, "/8"), ":") + parts := strings.Split(strings.Split(addr, "/")[0], ":") for i := 0; i < 8; i++ { addr, _ := strconv.ParseUint(parts[i], 16, 16) b := make([]byte, 16)