From d62bb8b13c9ba9c5617d8a8f5f173a4e286ee522 Mon Sep 17 00:00:00 2001 From: Nate Brown Date: Mon, 25 Nov 2019 11:21:48 -0800 Subject: [PATCH] Force mtu to int32 --- tun_linux.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tun_linux.go b/tun_linux.go index a5c7ebb..ed4585c 100644 --- a/tun_linux.go +++ b/tun_linux.go @@ -65,7 +65,7 @@ type ifreqAddr struct { type ifreqMTU struct { Name [16]byte - MTU int + MTU int32 pad [8]byte } @@ -184,7 +184,7 @@ func (c Tun) Activate() error { } // Set the MTU on the device - ifm := ifreqMTU{Name: devName, MTU: c.MaxMTU} + ifm := ifreqMTU{Name: devName, MTU: int32(c.MaxMTU)} if err = ioctl(fd, syscall.SIOCSIFMTU, uintptr(unsafe.Pointer(&ifm))); err != nil { return fmt.Errorf("failed to set tun mtu: %s", err) }