25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-20 16:15:59 +01:00

mod_stun_disco: Fix parsing of IPv6 listeners

Don't crash if `mod_stun_disco` is used with `offer_local_services`
and an IPv6 listener has an explicit `ip:` address configured.

Thanks to Daniel Kenzelmann for reporting the issue.
This commit is contained in:
Holger Weiss 2021-12-18 17:50:26 +01:00
parent 24742031e9
commit 42bdb501ca

View File

@ -646,7 +646,7 @@ get_listener_ips(#{ip := {0, 0, 0, 0, 0, 0, 0, 1}} = Opts) ->
{undefined, get_turn_ipv6_addr(Opts)};
get_listener_ips(#{ip := {_, _, _, _} = IP}) ->
{IP, undefined};
get_listener_ips(#{ip := {_, _, _, _, _,_, _, _, _} = IP}) ->
get_listener_ips(#{ip := {_, _, _, _, _, _, _, _} = IP}) ->
{undefined, IP}.
-spec get_turn_ipv4_addr(map()) -> inet:ip4_address() | undefined.