mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2024-12-17 21:47:29 +00:00
Add IFF_NODAD/IFF_SECURED, define consts
This commit is contained in:
parent
e5bb9bcb8d
commit
195d577151
@ -30,7 +30,12 @@ func (tun *TunAdapter) setup(ifname string, iftapmode bool, addr string, mtu int
|
|||||||
return tun.setupAddress(addr)
|
return tun.setupAddress(addr)
|
||||||
}
|
}
|
||||||
|
|
||||||
const darwin_SIOCAIFADDR_IN6 = 2155899162
|
const (
|
||||||
|
darwin_SIOCAIFADDR_IN6 = 2155899162 // netinet6/in6_var.h
|
||||||
|
darwin_IN6_IFF_NODAD = 0x0020 // netinet6/in6_var.h
|
||||||
|
darwin_IN6_IFF_SECURED = 0x0400 // netinet6/in6_var.h
|
||||||
|
darwin_ND6_INFINITE_LIFETIME = 0xFFFFFFFF // netinet6/nd6.h
|
||||||
|
)
|
||||||
|
|
||||||
type in6_addrlifetime struct {
|
type in6_addrlifetime struct {
|
||||||
ia6t_expire float64
|
ia6t_expire float64
|
||||||
@ -91,8 +96,11 @@ func (tun *TunAdapter) setupAddress(addr string) error {
|
|||||||
ar.ifra_addr.sin6_addr[i] = uint16(binary.BigEndian.Uint16(b))
|
ar.ifra_addr.sin6_addr[i] = uint16(binary.BigEndian.Uint16(b))
|
||||||
}
|
}
|
||||||
|
|
||||||
ar.ifra_lifetime.ia6t_vltime = 0xFFFFFFFF
|
ar.ifra_flags |= darwin_IN6_IFF_NODAD
|
||||||
ar.ifra_lifetime.ia6t_pltime = 0xFFFFFFFF
|
ar.ifra_flags |= darwin_IN6_IFF_SECURED
|
||||||
|
|
||||||
|
ar.ifra_lifetime.ia6t_vltime = darwin_ND6_INFINITE_LIFETIME
|
||||||
|
ar.ifra_lifetime.ia6t_pltime = darwin_ND6_INFINITE_LIFETIME
|
||||||
|
|
||||||
var ir ifreq
|
var ir ifreq
|
||||||
copy(ir.ifr_name[:], tun.iface.Name())
|
copy(ir.ifr_name[:], tun.iface.Name())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user