Go to file
Jason A. Donenfeld 65c2211c61 if_wg: do not allow ioctl to race with clone_destroy
This fixes the crash from:

bash -c 'while true; do ifconfig wg0 create; ifconfig wg0 destroy; done&
while true; do wg show wg0 > /dev/null 2>&1; done& wait'

Since we're setting ifp to NULL here, we also have to account for
multicast v6 packets being transmitted during destroy, which can be
triggered by:

  ifconfig wg0 create
  ifconfig wg0 inet6 fe80::1234/120
  ifconfig wg0 up
  route add -inet6 ff02::1:0/120 -iface wg0
  ifconfig wg0 destroy

These are unfixed upstream bug that we're working around.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-04-15 18:22:10 -06:00
src if_wg: do not allow ioctl to race with clone_destroy 2021-04-15 18:22:10 -06:00
tests Initial import 2021-03-17 09:35:54 -06:00
COPYING Initial import 2021-03-17 09:35:54 -06:00
MISSING.md compat: backport to FreeBSD 12.2 2021-03-18 09:00:52 -06:00
README.md README: separate build stage 2021-03-23 12:23:11 -06:00
TODO.md if_wg: remove peer marshalling from get request 2021-04-13 21:35:17 -06:00

README.md

WireGuard for FreeBSD

This is a kernel module for FreeBSD to support WireGuard. It is being developed here before its eventual submission to FreeBSD 13.1 or 14.

Installation instructions

First make sure you have the latest net/wireguard package installed, version ≥1.0.20210315.

Then, on FreeBSD 12 & 13:

# git clone https://git.zx2c4.com/wireguard-freebsd
# make -C wireguard-freebsd/src
# make -C wireguard-freebsd/src load install

After that, it should be possible to use wg(8) and wg-quick(8) like usual, but with the faster kernel implementation.