aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
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
commit7c833642dfa342218602ab18e7091e86408d2982 (patch)
treeef87da105c18cfc6e1ac62eb2c81d33dd5794aff /src
parentversion: bump snapshot (diff)
downloadwireguard-monolithic-historical-7c833642dfa342218602ab18e7091e86408d2982.tar.xz
wireguard-monolithic-historical-7c833642dfa342218602ab18e7091e86408d2982.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.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/tools/wg-quick/freebsd.bash2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/wg-quick/freebsd.bash b/src/tools/wg-quick/freebsd.bash
index e83dbef..93f1a3b 100755
--- a/src/tools/wg-quick/freebsd.bash
+++ b/src/tools/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
}