Closed LuoZijun closed 3 years ago
@meh ping ...
Is the index in both cases supposed to be + 1
? I remember there being some edge case when I was testing this stuff.
@meh XNU source code https://github.com/apple/darwin-xnu/blob/master/bsd/net/if_utun.c#L1426-L1428
@meh
I think +1
is the general way to due with this issue: https://github.com/WireGuard/wireguard-go/blob/58a8f05f50b633bb45c7cc299c405618489c18ad/tun/tun_darwin.go#L156
Current, when we create a tun device with name
utun10
on macos, theifconfig
will displayutun9
.so this patch will fix this problem.