From 895f4b82e3fcb112821afa2b7938327b467ef0d4 Mon Sep 17 00:00:00 2001 From: "Simon L." Date: Wed, 22 Jan 2025 16:51:55 +0100 Subject: [PATCH 1/2] talk: automatically bind ipv4 only if ipv6 is disabled Signed-off-by: Simon L. --- Containers/talk/start.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Containers/talk/start.sh b/Containers/talk/start.sh index e73525b8..c382f7f1 100644 --- a/Containers/talk/start.sh +++ b/Containers/talk/start.sh @@ -30,14 +30,21 @@ if [ -n "$IPv4_ADDRESS_TALK" ] && [ "$IPv4_ADDRESS_TALK_RELAY" = "$IPv4_ADDRESS_ IPv4_ADDRESS_TALK="" fi +IP_BINDING="::" +if grep -q "1" /sys/module/ipv6/parameters/disable \ +|| sysctl -a 2>/dev/null | grep "net.ipv6.conf.all.disable_ipv6" | grep -q "1" \ +|| sysctl -a 2>/dev/null | grep "net.ipv6.conf.default.disable_ipv6" | grep -q "1"; then + IP_BINDING="0.0.0.0" +fi + # Turn cat << TURN_CONF > "/conf/eturnal.yml" eturnal: listen: - - ip: "::" + - ip: "$IP_BINDING" port: $TALK_PORT transport: udp - - ip: "::" + - ip: "$IP_BINDING" port: $TALK_PORT transport: tcp log_dir: stdout From 00a2e88c226cd04e78f2daa44d361eb6c22fa031 Mon Sep 17 00:00:00 2001 From: "Simon L." Date: Thu, 23 Jan 2025 11:22:07 +0100 Subject: [PATCH 2/2] address review Signed-off-by: Simon L. Co-authored-by: Richard Steinmetz Signed-off-by: Simon L. --- Containers/talk/start.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Containers/talk/start.sh b/Containers/talk/start.sh index c382f7f1..d1037f8c 100644 --- a/Containers/talk/start.sh +++ b/Containers/talk/start.sh @@ -32,8 +32,8 @@ fi IP_BINDING="::" if grep -q "1" /sys/module/ipv6/parameters/disable \ -|| sysctl -a 2>/dev/null | grep "net.ipv6.conf.all.disable_ipv6" | grep -q "1" \ -|| sysctl -a 2>/dev/null | grep "net.ipv6.conf.default.disable_ipv6" | grep -q "1"; then +|| grep -q "1" /proc/sys/net/ipv6/conf/all/disable_ipv6 \ +|| grep -q "1" /proc/sys/net/ipv6/conf/default/disable_ipv6; then IP_BINDING="0.0.0.0" fi