Centralise platform defaults into the 'defaults' package

This commit is contained in:
Neil Alexander 2018-07-07 12:08:52 +01:00
parent adc21baa28
commit 1692bd98fd
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
20 changed files with 169 additions and 105 deletions

View file

@ -13,17 +13,6 @@ 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,
defaultIfMTU: 65535,
defaultIfName: "auto",
defaultIfTAPMode: false,
}
}
// 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 {