Use uint64 for MTU for forward-compatibility

This commit is contained in:
Neil Alexander 2021-05-16 20:00:45 +01:00
parent 2d01386d6e
commit 416eadbcff
10 changed files with 21 additions and 22 deletions

View file

@ -10,7 +10,7 @@ import (
)
// Configures the TUN adapter with the correct IPv6 address and MTU.
func (tun *TunAdapter) setup(ifname string, addr string, mtu MTU) error {
func (tun *TunAdapter) setup(ifname string, addr string, mtu uint64) error {
if ifname == "auto" {
ifname = "\000"
}
@ -20,7 +20,7 @@ func (tun *TunAdapter) setup(ifname string, addr string, mtu MTU) error {
}
tun.iface = iface
if mtu, err := iface.MTU(); err == nil {
tun.mtu = getSupportedMTU(MTU(mtu))
tun.mtu = getSupportedMTU(uint64(mtu))
} else {
tun.mtu = 0
}