summaryrefslogtreecommitdiffhomepage
path: root/src/tun_linux.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/tun_linux.go')
-rw-r--r--src/tun_linux.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tun_linux.go b/src/tun_linux.go
index d0e9761..a200bd8 100644
--- a/src/tun_linux.go
+++ b/src/tun_linux.go
@@ -37,6 +37,8 @@ func (tun *NativeTun) setMTU(n int) error {
return err
}
+ defer syscall.Close(fd)
+
// do ioctl call
var ifr [64]byte
@@ -70,6 +72,8 @@ func (tun *NativeTun) MTU() (int, error) {
return 0, err
}
+ defer syscall.Close(fd)
+
// do ioctl call
var ifr [64]byte