diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-07-10 15:13:45 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-07-10 17:11:14 +0200 |
commit | 1be5a9b1fdbf891749615e87391cdd2a9c4d7113 (patch) | |
tree | c8274346852d5deb2641b591c83d3715b0c274c1 | |
parent | 957876e76c6e11fc6641107a2c0dc4440be5791d (diff) | |
download | samba-1be5a9b1fdbf891749615e87391cdd2a9c4d7113.tar.gz samba-1be5a9b1fdbf891749615e87391cdd2a9c4d7113.tar.bz2 samba-1be5a9b1fdbf891749615e87391cdd2a9c4d7113.zip |
s4:lib/socket: iface_list_wildcard() should only return "::" if we have ipv6 interfaces
If glibc has IPv6 support, but it's not enabled in the running kernel
we should not try to listen on "::".
metze
-rw-r--r-- | source4/lib/socket/interface.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source4/lib/socket/interface.c b/source4/lib/socket/interface.c index d5b610fea7..42e1946768 100644 --- a/source4/lib/socket/interface.c +++ b/source4/lib/socket/interface.c @@ -520,7 +520,19 @@ const char **iface_list_wildcard(TALLOC_CTX *mem_ctx, struct loadparm_context *l #ifdef HAVE_IPV6 if (lpcfg_parm_bool(lp_ctx, NULL, "ipv6", "enable", true)) { - return str_list_add(ret, "::"); + struct interface *local_interfaces = NULL; + + load_interface_list(ret, lp_ctx, &local_interfaces); + + if (iface_list_first_v6(local_interfaces)) { + TALLOC_FREE(local_interfaces); + /* + * only add "::" if we have at least + * one ipv6 interface + */ + return str_list_add(ret, "::"); + } + TALLOC_FREE(local_interfaces); } #endif |