From 5d2dd061f08d2068bb330e5950d6cda1b5bb87fd Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Mon, 15 Jan 2018 14:14:18 +0000 Subject: [PATCH] Fix definition of SIOCAIFADDR_IN6 --- src/yggdrasil/tun_darwin.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/yggdrasil/tun_darwin.go b/src/yggdrasil/tun_darwin.go index 7562a90..4793a5c 100644 --- a/src/yggdrasil/tun_darwin.go +++ b/src/yggdrasil/tun_darwin.go @@ -7,6 +7,7 @@ import "unsafe" import "strings" import "strconv" import "encoding/binary" +// import "fmt" import water "github.com/songgao/water" @@ -23,7 +24,7 @@ func (tun *tunDevice) setup(ifname string, addr string, mtu int) error { const AF_INET6 = 30 const IN6_IFF_NODAD = 0x0020 -const SIOCAIFADDR_IN6 = (0x80000000) | ((4 & 0x1fff) << 16) | uint32(byte('i'))<<8 | 26 +const SIOCAIFADDR_IN6 = 2155899162 type in6_addrlifetime struct { ia6t_expire float64 @@ -81,7 +82,7 @@ func (tun *tunDevice) setupAddress(addr string) error { tun.core.log.Printf("Interface name: %s", ar.ifra_name) tun.core.log.Printf("Interface IPv6: %s", addr) - /* + /* var bytes *[unsafe.Sizeof(ar)]byte = (*[unsafe.Sizeof(ar)]byte)(unsafe.Pointer(&ar)); var out string; for i := 0; i < int(unsafe.Sizeof(ar)); i ++ {