mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-12-02 18:22:01 +00:00
wireguard's CreateTUN() sets the MTU using the same ioctl(2), on both
FreeBSD and OpenBSD.
Tested on OpenBSD (outputwith this patch):
```
# ktrace ./yggdrasil -autoconf | grep Interface
2024/09/24 17:26:29 Interface name: tun0
2024/09/24 17:26:29 Interface IPv6: 201:26e:68f0:502e:f445:13eb:2fe1:f7cd/7
2024/09/24 17:26:29 Interface MTU: 16384
```
```
$ ifconfig tun0 | head -n1
tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 16384
```
```
# kdump | grep ioctl
53097 yggdrasil CALL ioctl(10,SIOCGIFMTU,0xc0000376b8)
53097 yggdrasil RET ioctl 0
53097 yggdrasil CALL ioctl(10,SIOCSIFMTU,0xc0000376c0)
53097 yggdrasil RET ioctl 0
53097 yggdrasil CALL ioctl(10,SIOCGIFMTU,0xc0000377f8)
53097 yggdrasil RET ioctl 0
53097 yggdrasil CALL ioctl(10,_IOW('i',12,0x20),0xc00003777c)
53097 yggdrasil RET ioctl -1 errno 25 Inappropriate ioctl for device
"2024/09/24 17:26:29 Error in SIOCSIFADDR_IN6: inappropriate ioctl for device
```
(The completely broken address ioctl is another story...)