mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-29 06:35:07 +03:00
Per-platform TUN defaults
This commit is contained in:
parent
bec898a326
commit
4917ea3dd2
8 changed files with 56 additions and 26 deletions
|
@ -15,9 +15,12 @@ import water "github.com/neilalexander/water"
|
|||
// to disable the PI header when in TUN mode, so we need to modify the read/
|
||||
// writes to handle those first four bytes
|
||||
|
||||
func defaultTUNParameters() tunDefaultParameters {
|
||||
func getDefaults() tunDefaultParameters {
|
||||
return tunDefaultParameters{
|
||||
maxMTU: 16384,
|
||||
maximumIfMTU: 16384,
|
||||
defaultIfMTU: DEFAULT_MTU,
|
||||
defaultIfName: "/dev/tap0",
|
||||
defaultIfTAPMode: true,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,7 +89,7 @@ func (tun *tunDevice) setup(ifname string, iftapmode bool, addr string, mtu int)
|
|||
panic(err)
|
||||
}
|
||||
tun.iface = iface
|
||||
tun.mtu = getMTUFromMax(mtu)
|
||||
tun.mtu = getSupportedMTU(mtu)
|
||||
return tun.setupAddress(addr)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue