Document ICMPv6 and TUN/TAP

This commit is contained in:
Neil Alexander 2018-06-12 22:45:53 +01:00
parent ad6ea59049
commit 8e2c2aa977
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
10 changed files with 90 additions and 4 deletions

View file

@ -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