diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-11-21 10:53:45 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-11-26 11:33:33 +0100 |
commit | a59aa6c404f45055e59e59e603b7faf297f28425 (patch) | |
tree | 548de7e3249f2cbdc55bab6e0be122a6a5fe19ec /src/wg-quick | |
parent | wg-quick: android: check for null in binder cleanup functions (diff) | |
download | wireguard-tools-a59aa6c404f45055e59e59e603b7faf297f28425.tar.xz wireguard-tools-a59aa6c404f45055e59e59e603b7faf297f28425.zip |
wg-quick: linux: only touch net.ipv4 for v4
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rwxr-xr-x | src/wg-quick/linux.bash | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/wg-quick/linux.bash b/src/wg-quick/linux.bash index e690944..cf72d41 100755 --- a/src/wg-quick/linux.bash +++ b/src/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 } |