diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-07-24 16:08:42 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-07-24 23:19:38 +0200 |
commit | 9d5d4ea0ba1608acb5c506032a677c1450f35189 (patch) | |
tree | 6613044676b5de3b34b1b22f8baf8f1b4b38cbfe /src | |
parent | android: add port of wg-quick (diff) | |
download | wireguard-monolithic-historical-9d5d4ea0ba1608acb5c506032a677c1450f35189.tar.xz wireguard-monolithic-historical-9d5d4ea0ba1608acb5c506032a677c1450f35189.zip |
wg-quick: do not set explicit src route for v6 default route
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.
Diffstat (limited to 'src')
-rwxr-xr-x | src/tools/wg-quick.bash | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/tools/wg-quick.bash b/src/tools/wg-quick.bash index ff92221..b1fb435 100755 --- a/src/tools/wg-quick.bash +++ b/src/tools/wg-quick.bash @@ -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 |