mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
Use uint64 for MTU for forward-compatibility
This commit is contained in:
parent
2d01386d6e
commit
416eadbcff
10 changed files with 21 additions and 22 deletions
|
@ -19,7 +19,7 @@ import (
|
|||
// This is to catch Windows platforms
|
||||
|
||||
// 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 = defaults.GetDefaults().DefaultIfName
|
||||
}
|
||||
|
@ -43,14 +43,14 @@ func (tun *TunAdapter) setup(ifname string, addr string, mtu MTU) error {
|
|||
return err
|
||||
}
|
||||
if mtu, err := iface.MTU(); err == nil {
|
||||
tun.mtu = MTU(mtu)
|
||||
tun.mtu = uint64(mtu)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
// Sets the MTU of the TAP adapter.
|
||||
func (tun *TunAdapter) setupMTU(mtu MTU) error {
|
||||
func (tun *TunAdapter) setupMTU(mtu uint64) error {
|
||||
if tun.iface == nil || tun.Name() == "" {
|
||||
return errors.New("Can't configure MTU as TUN adapter is not present")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue