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.
Original patch (on top of commit e852f4c) by Aaron Li <[email protected]> in
2020. Rebased with minor tweaks.
The TUN device/interface on DragonFly BSD is very similar to the FreeBSD
one, so it's rather easy to port WireGuard-go to DragonFly BSD based on
the FreeBSD support code.
The
tun_dragonfly.go
code is derived from thetun_freebsd.go
code.One major difference is that DragonFly BSD's TUN device supports the
TUNGIFNAME
ioctl [0] for easily getting the assigned interface name.The remaining differences are mostly minor cleanups and tweaks.
I've tested that DragonFly BSD's TUN device doesn't have the race issue
like the FreeBSD one [1], so I didn't keep the code to disable LLv6.
Tested on DragonFly BSD master branch (6.1-DEVELOPMENT) as of
2021-Jun-18. Requires a pending fix to the x/net library:
https://go-review.googlesource.com/c/net/+/328331/
Also thank François Tigeot, who ported WireGuard-go to DragonFly BSD's
DeltaPorts/DPorts [2].
[0] DragonFlyBSD/DragonFlyBSD@0df03f1
[1] bb42ec7
[2] DragonFlyBSD/DeltaPorts@ef67233
Signed-off-by: James Cook [email protected]