mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
Document ICMPv6 and TUN/TAP
This commit is contained in:
parent
ad6ea59049
commit
8e2c2aa977
10 changed files with 90 additions and 4 deletions
|
@ -10,6 +10,8 @@ import "golang.org/x/sys/unix"
|
|||
|
||||
import water "github.com/yggdrasil-network/water"
|
||||
|
||||
// Sane defaults for the Darwin/macOS platform. The "default" options may be
|
||||
// may be replaced by the running configuration.
|
||||
func getDefaults() tunDefaultParameters {
|
||||
return tunDefaultParameters{
|
||||
maximumIfMTU: 65535,
|
||||
|
@ -19,6 +21,7 @@ func getDefaults() tunDefaultParameters {
|
|||
}
|
||||
}
|
||||
|
||||
// Configures the "utun" adapter with the correct IPv6 address and MTU.
|
||||
func (tun *tunDevice) setup(ifname string, iftapmode bool, addr string, mtu int) error {
|
||||
if iftapmode {
|
||||
tun.core.log.Printf("TAP mode is not supported on this platform, defaulting to TUN")
|
||||
|
@ -65,6 +68,8 @@ type ifreq struct {
|
|||
ifru_mtu uint32
|
||||
}
|
||||
|
||||
// Sets the IPv6 address of the utun adapter. On Darwin/macOS this is done using
|
||||
// a system socket and making direct syscalls to the kernel.
|
||||
func (tun *tunDevice) setupAddress(addr string) error {
|
||||
var fd int
|
||||
var err error
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue