]> git.ipfire.org Git - thirdparty/wireguard-tools.git/commitdiff
wg-quick: freebsd: rebreak interface loopback, while fixing localhost
authorJason A. Donenfeld <Jason@zx2c4.com>
Thu, 28 Feb 2019 18:03:11 +0000 (19:03 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Thu, 28 Feb 2019 20:25:49 +0000 (21:25 +0100)
The commit 7c833642 ("wg-quick: freebsd: allow loopback to work") was
supposed to make things better, but actually it just started sending
legitimate localhost traffic over the WireGuard interface, which is
really quite bad.

This reverts commit 7c833642dfa342218602ab18e7091e86408d2982.

Reported-by: Matt Smith <matt.xtaz@gmail.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
src/wg-quick/freebsd.bash

index 93f1a3b772522549ac784cd87a666f335addb35f..e83dbef0a85af36e75017f3e368e798cf5012b0d 100755 (executable)
@@ -158,7 +158,7 @@ add_addr() {
        if [[ $1 == *:* ]]; then
                cmd ifconfig "$INTERFACE" inet6 "$1" alias
        else
-               cmd ifconfig "$INTERFACE" inet "$1" 127.0.0.1 alias
+               cmd ifconfig "$INTERFACE" inet "$1" "${1%%/*}" alias
        fi
 }