From 10e1b86a955b1ecd2e0bc9f8617e4883724cd97c Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 19 Nov 2025 16:05:22 +0100 Subject: [PATCH] Improve IPv6 disabling logic in install scripts Updated both alpine-install.func and install.func to enhance IPv6 disabling by checking IPV6_METHOD and adding more sysctl settings. Also improved messaging and removed suppression of sysctl output in install.func. --- misc/alpine-install.func | 8 +++++++- misc/install.func | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/misc/alpine-install.func b/misc/alpine-install.func index c8f4ee0fc..46dcb72ae 100644 --- a/misc/alpine-install.func +++ b/misc/alpine-install.func @@ -13,10 +13,16 @@ load_functions verb_ip6() { set_std_mode # Set STD mode based on VERBOSE - if [ "$DISABLEIPV6" == "yes" ]; then + if [ "$IPV6_METHOD" == "none" ] || [ "$DISABLEIPV6" == "yes" ]; then + msg_info "Disabling IPv6" $STD sysctl -w net.ipv6.conf.all.disable_ipv6=1 + $STD sysctl -w net.ipv6.conf.default.disable_ipv6=1 + $STD sysctl -w net.ipv6.conf.lo.disable_ipv6=1 echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf + echo "net.ipv6.conf.default.disable_ipv6 = 1" >>/etc/sysctl.conf + echo "net.ipv6.conf.lo.disable_ipv6 = 1" >>/etc/sysctl.conf $STD rc-update add sysctl default + msg_ok "Disabled IPv6" fi } diff --git a/misc/install.func b/misc/install.func index c424ab043..0c9d07299 100644 --- a/misc/install.func +++ b/misc/install.func @@ -20,7 +20,7 @@ verb_ip6() { $STD echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf $STD echo "net.ipv6.conf.default.disable_ipv6 = 1" >>/etc/sysctl.conf $STD echo "net.ipv6.conf.lo.disable_ipv6 = 1" >>/etc/sysctl.conf - $STD sysctl -p >/dev/null + $STD sysctl -p msg_ok "Disabled IPv6" fi }