wg-quick: preliminary support for go implementation

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2018-05-05 03:54:55 +02:00
parent f8a990763a
commit 0b64881c7a
1 changed files with 7 additions and 1 deletions

View File

@ -83,7 +83,13 @@ auto_su() {
}
add_if() {
cmd ip link add "$INTERFACE" type wireguard
local ret
if ! cmd ip link add "$INTERFACE" type wireguard; then
ret=$?
[[ -e /sys/module/wireguard ]] || ! command -v wireguard-go >/dev/null && return $ret
echo "[!] Missing WireGuard kernel module. Falling back to slow userspace implementation."
cmd wireguard-go "$INTERFACE"
fi
}
del_if() {