summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-02-27 10:18:35 +0100
committerKarolin Seeger <kseeger@samba.org>2014-04-01 09:08:06 +0200
commit74aa879af2c20feda1b3f94de0317bac8e89002a (patch)
treec662cdda7ecdad39742e893dfccd4da3fa57d63f
parent5f4c1bbc6cc127a03e53f60ebefeeb20a7d79bff (diff)
downloadsamba-74aa879af2c20feda1b3f94de0317bac8e89002a.tar.gz
s4:lib/socket: use the same logic in iface_list_wildcard() as in smbd
If we have ipv6 support we should listen on "::" too. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10464 Signed-off-by: Stefan Metzmacher <metze@samba.org> Change-Id: I8ce185d5070280149bee9fd33010443be9031089 Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit a571fe520d09a00273a58b1fb0fa9aab8e0aefce)
-rw-r--r--source4/lib/socket/interface.c26
1 files changed, 5 insertions, 21 deletions
diff --git a/source4/lib/socket/interface.c b/source4/lib/socket/interface.c
index 7a4733f4666..cdfadc9953c 100644
--- a/source4/lib/socket/interface.c
+++ b/source4/lib/socket/interface.c
@@ -505,27 +505,11 @@ bool iface_list_same_net(const char *ip1, const char *ip2, const char *netmask)
*/
const char **iface_list_wildcard(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
{
- const char **ret;
- ret = (const char **)str_list_make(mem_ctx, "0.0.0.0", NULL);
- if (ret == NULL) return NULL;
-
+ char **ret;
#ifdef HAVE_IPV6
- if (lpcfg_parm_bool(lp_ctx, NULL, "ipv6", "enable", true)) {
- 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);
- }
+ ret = str_list_make(mem_ctx, "::,0.0.0.0", NULL);
+#else
+ ret = str_list_make(mem_ctx, "0.0.0.0", NULL);
#endif
-
- return ret;
+ return discard_const_p(const char *, ret);
}