]> git.ipfire.org Git - thirdparty/wireguard-tools.git/commitdiff
wg-quick: do not set explicit src route for v6 default route
authorJason A. Donenfeld <Jason@zx2c4.com>
Mon, 24 Jul 2017 14:08:42 +0000 (16:08 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Mon, 24 Jul 2017 21:19:38 +0000 (23:19 +0200)
This was only required because clueless network operators were trying to
route fec0::/10 globally, when that range doesn't actually have global
scope. Now that we understand the cause was operator error, we revert
the change here, so that the routing table is kept consistent.

This reverts commit 64e47de870a2f0575b5564a70e5680b48ab83ff9.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
src/wg-quick.bash

index ff92221e5495662a8ce184189909017faa6d4362..b1fb4357722c2e7baa1d607eb84968699f64a7de 100755 (executable)
@@ -144,18 +144,10 @@ add_default() {
                        ((DEFAULT_TABLE++))
                done
        fi
-       local proto=-4 src ip
-       if [[ $1 == *:* ]]; then
-               proto=-6
-               for ip in "${ADDRESSES[@]}"; do
-                       if [[ $ip == *:* ]]; then
-                               src="src ${ip%/*}"
-                               break
-                       fi
-               done
-       fi
+       local proto=-4
+       [[ $1 == *:* ]] && proto=-6
        cmd wg set "$INTERFACE" fwmark $DEFAULT_TABLE
-       cmd ip $proto route add "$1" $src dev "$INTERFACE" table $DEFAULT_TABLE
+       cmd ip $proto route add "$1" dev "$INTERFACE" table $DEFAULT_TABLE
        cmd ip $proto rule add not fwmark $DEFAULT_TABLE table $DEFAULT_TABLE
        cmd ip $proto rule add table main suppress_prefixlength 0
        local key value