aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-01-24 03:26:51 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-01-24 03:28:54 +0100
commit3f7a31faea0654a4b4333d47f338151558eced00 (patch)
tree20e88d5a64c8417a057d0eebe0a5b1dbaaab8a10
parentnetlink: use __kernel_timespec for handshake time (diff)
downloadwireguard-tools-3f7a31faea0654a4b4333d47f338151558eced00.tar.xz
wireguard-tools-3f7a31faea0654a4b4333d47f338151558eced00.zip
wg-quick: freebsd: allow loopback to work
FreeBSD adds a route for point-to-point destination addresses. We don't really want to specify any destination address, but unfortunately we have to. Before we tried to cheat by giving our own address as the destination, but this had the unfortunate effect of preventing loopback from working on our local ip address. We work around this with yet another kludge: we set the destination address to 127.0.0.1. Since 127.0.0.1 is already assigned to an interface, this has the same effect of not specifying a destination address, and therefore we accomplish the intended behavior. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rwxr-xr-xsrc/wg-quick/freebsd.bash2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wg-quick/freebsd.bash b/src/wg-quick/freebsd.bash
index e83dbef..93f1a3b 100755
--- a/src/wg-quick/freebsd.bash
+++ b/src/wg-quick/freebsd.bash
@@ -158,7 +158,7 @@ add_addr() {
if [[ $1 == *:* ]]; then
cmd ifconfig "$INTERFACE" inet6 "$1" alias
else
- cmd ifconfig "$INTERFACE" inet "$1" "${1%%/*}" alias
+ cmd ifconfig "$INTERFACE" inet "$1" 127.0.0.1 alias
fi
}