mirror of
https://github.com/openziti/desktop-edge-win.git
synced 2026-10-14 08:39:55 +00:00
fix mtu to not overflow uint16
This commit is contained in:
@@ -259,12 +259,12 @@ func setTunInfo(s *dto.TunnelStatus, ipv4 string, ipv4mask int) {
|
||||
log.Errorf("error reading MTU - using 0 for MTU: (%v)", err)
|
||||
mtu = 0
|
||||
}
|
||||
|
||||
umtu := uint16(mtu)
|
||||
//set the tun info into the state
|
||||
s.IpInfo = &dto.TunIpInfo{
|
||||
Ip: ipv4,
|
||||
DNS: Ipv4dns,
|
||||
MTU: uint16(mtu),
|
||||
MTU: umtu,
|
||||
Subnet: ipv4MaskString(ipnet.Mask),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ func (t *RuntimeState) CreateTun(ipv4 string, ipv4mask int) error {
|
||||
}
|
||||
|
||||
log.Infof("creating TUN device: %s", TunName)
|
||||
tunDevice, err := tun.CreateTUN(TunName, 64*1024)
|
||||
tunDevice, err := tun.CreateTUN(TunName, 64*1024 - 1)
|
||||
if err == nil {
|
||||
t.tun = &tunDevice
|
||||
tunName, err2 := tunDevice.Name()
|
||||
|
||||
Reference in New Issue
Block a user