Latest changes broken darwin TUNs
jpillora opened this issue · 3 comments
Can you please provide a working macOS example, which:
- creates tun interface
- assigns ip (
10.0.0.1
) - responds to icmp (
ping 10.0.0.1
works)
This program https://github.com/twitchyliquid64/subnet works because it vendors an older version, if you update github.com/songgao/water
in vendor/
you'll see that it no longer works on macOS.
Ah seems like the TUN interface emits/requires a leading 0x00000002
. Do you know why this is?
It sounds like related to #21
By default the kernel prepends a 4-byte header to packets read from the TUN fd, and expects that header from packets written into the fd. To avoid that, water
uses IFF_NO_PI
on Linux so that user don't have to worry about that header. But the same flag isn't supported on darwin. So that PR added a wrapper to "fake" IFF_NO_PI
behavior on darwin, so that it's consistent with Linux.
That repo doesn't have a SHA1 of vendored commit, but from this file it seems it has the latest water
code regarding to IFF_NO_PI
. What commit did you try to vendor into it? Any chance you vendored an old commit?
Closing due to inactivity. Please let me know if you are still having issues.