aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-05-16 04:12:02 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-05-16 04:25:42 +0200
commitb9b78f2739996ff9830cba310036db35b7ec99fa (patch)
tree9043f4cbe948423cc8c2b73fffe53e58b1a12f79
parentwg-quick: darwin: use bash from environment and require bash 4+ (diff)
downloadwireguard-monolithic-historical-b9b78f2739996ff9830cba310036db35b7ec99fa.tar.xz
wireguard-monolithic-historical-b9b78f2739996ff9830cba310036db35b7ec99fa.zip
wg-quick: add intentionally undocumented userspace implementation knob
This knob might disappear at some point, and we don't want to encourage its use, so it's not being documented, but this should help with development of new implementations.
-rwxr-xr-xsrc/tools/wg-quick/darwin.bash2
-rwxr-xr-xsrc/tools/wg-quick/linux.bash4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/tools/wg-quick/darwin.bash b/src/tools/wg-quick/darwin.bash
index 4a3240c..0eef3d9 100755
--- a/src/tools/wg-quick/darwin.bash
+++ b/src/tools/wg-quick/darwin.bash
@@ -101,7 +101,7 @@ get_real_interface() {
add_if() {
export WG_DARWIN_UTUN_NAME_FILE="/var/run/wireguard/$INTERFACE.name"
mkdir -m 0700 -p "/var/run/wireguard/"
- cmd wireguard-go utun
+ cmd "${WG_QUICK_USERSPACE_IMPLEMENTATION:-wireguard-go}" utun
get_real_interface
}
diff --git a/src/tools/wg-quick/linux.bash b/src/tools/wg-quick/linux.bash
index 38ccad2..9139e7f 100755
--- a/src/tools/wg-quick/linux.bash
+++ b/src/tools/wg-quick/linux.bash
@@ -86,9 +86,9 @@ add_if() {
local ret
if ! cmd ip link add "$INTERFACE" type wireguard; then
ret=$?
- [[ -e /sys/module/wireguard ]] || ! command -v wireguard-go >/dev/null && return $ret
+ [[ -e /sys/module/wireguard ]] || ! command -v "${WG_QUICK_USERSPACE_IMPLEMENTATION:-wireguard-go}" >/dev/null && exit $ret
echo "[!] Missing WireGuard kernel module. Falling back to slow userspace implementation."
- cmd wireguard-go "$INTERFACE"
+ cmd "${WG_QUICK_USERSPACE_IMPLEMENTATION:-wireguard-go}" "$INTERFACE"
fi
}