From d6d8bce0e497f41105256c543530054ccdf69f9a Mon Sep 17 00:00:00 2001 From: Badlop Date: Wed, 3 Apr 2024 21:24:39 +0200 Subject: [PATCH] If INET_DIST_INTERFACE is IPv6, set required option (thanks to Stu Tomlinson)(#4189) --- .github/container/ejabberdctl.template | 3 +++ ejabberdctl.template | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/container/ejabberdctl.template b/.github/container/ejabberdctl.template index e7e112ffa..2d64e135e 100755 --- a/.github/container/ejabberdctl.template +++ b/.github/container/ejabberdctl.template @@ -79,6 +79,9 @@ fi if [ -n "$INET_DIST_INTERFACE" ] ; then INET_DIST_INTERFACE2=$("$ERL" $ERLANG_OPTS -noshell -eval 'case inet:parse_address("'$INET_DIST_INTERFACE'") of {ok,IP} -> io:format("~p",[IP]); _ -> ok end.' -s erlang halt) if [ -n "$INET_DIST_INTERFACE2" ] ; then + if [ $(echo "$INET_DIST_INTERFACE2" | grep -o "," | wc -l) -eq 7 ] ; then + INET_DIST_INTERFACE2="$INET_DIST_INTERFACE2 -proto_dist inet6_tcp" + fi ERLANG_OPTS="$ERLANG_OPTS -kernel inet_dist_use_interface $INET_DIST_INTERFACE2" fi fi diff --git a/ejabberdctl.template b/ejabberdctl.template index f558e93b2..28c31c054 100755 --- a/ejabberdctl.template +++ b/ejabberdctl.template @@ -78,6 +78,9 @@ fi if [ -n "$INET_DIST_INTERFACE" ] ; then INET_DIST_INTERFACE2=$("$ERL" $ERLANG_OPTS -noshell -eval 'case inet:parse_address("'$INET_DIST_INTERFACE'") of {ok,IP} -> io:format("~p",[IP]); _ -> ok end.' -s erlang halt) if [ -n "$INET_DIST_INTERFACE2" ] ; then + if [ $(echo "$INET_DIST_INTERFACE2" | grep -o "," | wc -l) -eq 7 ] ; then + INET_DIST_INTERFACE2="$INET_DIST_INTERFACE2 -proto_dist inet6_tcp" + fi ERLANG_OPTS="$ERLANG_OPTS -kernel inet_dist_use_interface $INET_DIST_INTERFACE2" fi fi