mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2026-05-22 05:46:30 +03:00
Don't allow exceeding maximum MTU for a given platform
This commit is contained in:
@@ -27,6 +27,17 @@ type tunDevice struct {
|
||||
iface tunInterface
|
||||
}
|
||||
|
||||
type tunDefaultParameters struct {
|
||||
maxMTU int
|
||||
}
|
||||
|
||||
func getMTUFromMax(mtu int) int {
|
||||
if mtu > defaultTUNParameters().maxMTU {
|
||||
return defaultTUNParameters().maxMTU
|
||||
}
|
||||
return mtu
|
||||
}
|
||||
|
||||
func (tun *tunDevice) init(core *Core) {
|
||||
tun.core = core
|
||||
tun.icmpv6.init(tun)
|
||||
|
||||
Reference in New Issue
Block a user