Skip to content

Commit

Permalink
If INET_DIST_INTERFACE is IPv6, set required option (thanks to Stu To…
Browse files Browse the repository at this point in the history
…mlinson)(#4189)
  • Loading branch information
badlop committed Apr 4, 2024
1 parent 7c76f2b commit d6d8bce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/container/ejabberdctl.template
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions ejabberdctl.template
Expand Up @@ -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
Expand Down

0 comments on commit d6d8bce

Please sign in to comment.