aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-05-05 03:54:55 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-05-10 19:23:02 +0200
commit0b64881c7ac934f3ef8e9c74b815357fbe981ccb (patch)
treefe061774bb964c6354d8846e32cbec2ad33c95f1 /src
parentembeddable-wg-library: zero attribute padding (diff)
downloadwireguard-tools-0b64881c7ac934f3ef8e9c74b815357fbe981ccb.tar.xz
wireguard-tools-0b64881c7ac934f3ef8e9c74b815357fbe981ccb.zip
wg-quick: preliminary support for go implementation
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/wg-quick.bash8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/wg-quick.bash b/src/wg-quick.bash
index f8c1ce7..cd66b4d 100755
--- a/src/wg-quick.bash
+++ b/src/wg-quick.bash
@@ -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() {