Check if IPv6 got disabled via kernel parameter before trying to disable it

This commit is contained in:
Saverio Miroddi 2020-11-14 22:47:22 +01:00 committed by GitHub
parent 3814d4be97
commit 338ca1ac42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View File

@ -66,8 +66,11 @@ fi
# PIA currently does not support IPv6. In order to be sure your VPN # PIA currently does not support IPv6. In order to be sure your VPN
# connection does not leak, it is best to disabled IPv6 altogether. # connection does not leak, it is best to disabled IPv6 altogether.
if [ $(sysctl -n net.ipv6.conf.all.disable_ipv6) -ne 1 ] || # IPv6 can also be disabled via kernel commandline param, so we must
[ $(sysctl -n net.ipv6.conf.default.disable_ipv6) -ne 1 ] # first check if this is the case.
if [[ -f /proc/net/if_inet6 ]] &&
[[ $(sysctl -n net.ipv6.conf.all.disable_ipv6) -ne 1 ||
$(sysctl -n net.ipv6.conf.default.disable_ipv6) -ne 1 ]]
then then
echo 'You should consider disabling IPv6 by running:' echo 'You should consider disabling IPv6 by running:'
echo 'sysctl -w net.ipv6.conf.all.disable_ipv6=1' echo 'sysctl -w net.ipv6.conf.all.disable_ipv6=1'

View File

@ -37,8 +37,11 @@ check_tool jq jq
# PIA currently does not support IPv6. In order to be sure your VPN # PIA currently does not support IPv6. In order to be sure your VPN
# connection does not leak, it is best to disabled IPv6 altogether. # connection does not leak, it is best to disabled IPv6 altogether.
if [ $(sysctl -n net.ipv6.conf.all.disable_ipv6) -ne 1 ] || # IPv6 can also be disabled via kernel commandline param, so we must
[ $(sysctl -n net.ipv6.conf.default.disable_ipv6) -ne 1 ] # first check if this is the case.
if [[ -f /proc/net/if_inet6 ]] &&
[[ $(sysctl -n net.ipv6.conf.all.disable_ipv6) -ne 1 ||
$(sysctl -n net.ipv6.conf.default.disable_ipv6) -ne 1 ]]
then then
echo 'You should consider disabling IPv6 by running:' echo 'You should consider disabling IPv6 by running:'
echo 'sysctl -w net.ipv6.conf.all.disable_ipv6=1' echo 'sysctl -w net.ipv6.conf.all.disable_ipv6=1'