wireguard-go icon indicating copy to clipboard operation
wireguard-go copied to clipboard

Port to DragonFly BSD

Open falsifian opened this issue 4 years ago • 0 comments

Original patch (on top of commit e852f4c0) 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 the tun_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] https://github.com/DragonFlyBSD/DragonFlyBSD/commit/0df03f127ea71fb9dbcedbdc065f211514feefdf [1] https://github.com/WireGuard/wireguard-go/commit/bb42ec7d185ab5f5cd3867ac1258edff86b7f307 [2] https://github.com/DragonFlyBSD/DeltaPorts/commit/ef672333228e7ecf8a33dd88a5e715034e973c75

Signed-off-by: James Cook [email protected]

falsifian avatar Jun 19 '21 01:06 falsifian