Page MenuHomePhorge

D437.1774852911.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D437.1774852911.diff

diff --git a/apps/kolab_guam/src/kolab_guam_listener.erl b/apps/kolab_guam/src/kolab_guam_listener.erl
--- a/apps/kolab_guam/src/kolab_guam_listener.erl
+++ b/apps/kolab_guam/src/kolab_guam_listener.erl
@@ -75,7 +75,23 @@
listen_options(none, Addr)
end.
-default_listen_options() -> [ { reuseaddr, true }, {active, false}, inet6 ].
+default_listen_options() -> [ { reuseaddr, true }, {active, false} | ipv6_opts() ].
+
+ipv6_opts() ->
+ case check_for_ipv6(inet:getifaddrs()) of
+ true -> [inet6];
+ _ -> []
+ end.
+
+check_for_ipv6({ok, Ifaddrs}) -> check_for_ipv6(Ifaddrs);
+check_for_ipv6([]) -> false;
+check_for_ipv6([{_iface, Attrs}|Ifaddrs]) ->
+ Addrs = proplists:get_all_values(addr, Attrs),
+ case lists:any(fun(Addr) -> size(Addr) == 8 end, Addrs) of
+ true -> true;
+ _ -> check_for_ipv6(Ifaddrs)
+ end;
+check_for_ipv6(_) -> false.
create_initial_listeners(ListenerPoolSize, PID) when is_pid(PID) ->
lager:debug("Creating session pool of size ~p for listener ~p", [ListenerPoolSize, PID]),

File Metadata

Mime Type
text/plain
Expires
Mon, Mar 30, 6:41 AM (3 d, 11 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18794898
Default Alt Text
D437.1774852911.diff (1 KB)

Event Timeline