Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These changes add support for macOS. The I/O code for writing tunnel traffic adheres to the platform independent interfaces that already exist and are implemented for Linux, but the
uapi
code is shared in full between Linux and macOS. There is one slight inefficiency in the tunnel trait that forces a copy that could be eluded with a slight change to the trait. I've tested this implementation a bit and it seems to be on par with the linux implementation, sans the firewall mark.This implementation does rely on 3 extra dependencies, some of which are there purely for ergonomics (
nix
) and could be substituted with more calls tolibc
and in-line struct definitions.