aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/tools/wg-quick/linux.bash
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-11-21 10:53:45 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-11-26 11:33:33 +0100
commit0fadbc4f4e37dd577f431bf2d011837001c4d132 (patch)
treed93fa31ddedc40aeb0f1799248aafbb82e26319b /src/tools/wg-quick/linux.bash
parentallowedips: avoid double lock in selftest error case (diff)
downloadwireguard-monolithic-historical-0fadbc4f4e37dd577f431bf2d011837001c4d132.tar.xz
wireguard-monolithic-historical-0fadbc4f4e37dd577f431bf2d011837001c4d132.zip
wg-quick: linux: only touch net.ipv4 for v4
Diffstat (limited to 'src/tools/wg-quick/linux.bash')
-rwxr-xr-xsrc/tools/wg-quick/linux.bash8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/tools/wg-quick/linux.bash b/src/tools/wg-quick/linux.bash
index e690944..cf72d41 100755
--- a/src/tools/wg-quick/linux.bash
+++ b/src/tools/wg-quick/linux.bash
@@ -194,9 +194,11 @@ add_default() {
cmd ip $proto route add "$1" dev "$INTERFACE" table $table
cmd ip $proto rule add not fwmark $table table $table
cmd ip $proto rule add table main suppress_prefixlength 0
- while read -r key _ value; do
- [[ $value -eq 1 ]] && sysctl -q "$key=2"
- done < <(sysctl -a -r '^net\.ipv4.conf\.[^ .=]+\.rp_filter$')
+ if [[ $proto == -4 ]]; then
+ while read -r key _ value; do
+ [[ $value -eq 1 ]] && sysctl -q "$key=2"
+ done < <(sysctl -a -r '^net\.ipv4.conf\.[^ .=]+\.rp_filter$')
+ fi
return 0
}