mirror of
https://github.com/samba-team/samba.git
synced 2025-03-27 22:50:26 +03:00
s4:lib/socket: simplify iface_list_wildcard() and its callers
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10464 Signed-off-by: Stefan Metzmacher <metze@samba.org> Change-Id: Ib317d71dea01fc8ef6b6a26455f15a8a175d59f6 Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Mar 7 02:18:17 CET 2014 on sn-devel-104
This commit is contained in:
parent
a571fe520d
commit
f7883ae02a
@ -153,7 +153,7 @@ static NTSTATUS cldapd_startup_interfaces(struct cldapd_server *cldapd, struct l
|
||||
/* if we are allowing incoming packets from any address, then
|
||||
we need to bind to the wildcard address */
|
||||
if (!lpcfg_bind_interfaces_only(lp_ctx)) {
|
||||
const char **wcard = iface_list_wildcard(cldapd, lp_ctx);
|
||||
char **wcard = iface_list_wildcard(cldapd);
|
||||
NT_STATUS_HAVE_NO_MEMORY(wcard);
|
||||
for (i=0; wcard[i]; i++) {
|
||||
status = cldapd_add_socket(cldapd, lp_ctx, wcard[i]);
|
||||
|
@ -657,7 +657,7 @@ static NTSTATUS dns_add_socket(struct dns_server *dns,
|
||||
/*
|
||||
setup our listening sockets on the configured network interfaces
|
||||
*/
|
||||
static NTSTATUS dns_startup_interfaces(struct dns_server *dns, struct loadparm_context *lp_ctx,
|
||||
static NTSTATUS dns_startup_interfaces(struct dns_server *dns,
|
||||
struct interface *ifaces)
|
||||
{
|
||||
const struct model_ops *model_ops;
|
||||
@ -687,8 +687,8 @@ static NTSTATUS dns_startup_interfaces(struct dns_server *dns, struct loadparm_c
|
||||
NT_STATUS_NOT_OK_RETURN(status);
|
||||
}
|
||||
} else {
|
||||
const char **wcard;
|
||||
wcard = iface_list_wildcard(tmp_ctx, lp_ctx);
|
||||
char **wcard;
|
||||
wcard = iface_list_wildcard(tmp_ctx);
|
||||
if (wcard == NULL) {
|
||||
DEBUG(0, ("No wildcard address available\n"));
|
||||
return NT_STATUS_INTERNAL_ERROR;
|
||||
@ -891,7 +891,7 @@ static void dns_task_init(struct task_server *task)
|
||||
DLIST_ADD_END(dns->zones, z, NULL);
|
||||
}
|
||||
|
||||
status = dns_startup_interfaces(dns, task->lp_ctx, ifaces);
|
||||
status = dns_startup_interfaces(dns, ifaces);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
task_server_terminate(task, "dns failed to setup interfaces", true);
|
||||
return;
|
||||
|
@ -733,7 +733,7 @@ static NTSTATUS kdc_startup_interfaces(struct kdc_server *kdc, struct loadparm_c
|
||||
/* if we are allowing incoming packets from any address, then
|
||||
we need to bind to the wildcard address */
|
||||
if (!lpcfg_bind_interfaces_only(lp_ctx)) {
|
||||
const char **wcard = iface_list_wildcard(kdc, lp_ctx);
|
||||
char **wcard = iface_list_wildcard(kdc);
|
||||
NT_STATUS_HAVE_NO_MEMORY(wcard);
|
||||
for (i=0; wcard[i]; i++) {
|
||||
if (kdc_port) {
|
||||
|
@ -962,9 +962,9 @@ static void ldapsrv_task_init(struct task_server *task)
|
||||
if (!NT_STATUS_IS_OK(status)) goto failed;
|
||||
}
|
||||
} else {
|
||||
const char **wcard;
|
||||
char **wcard;
|
||||
int i;
|
||||
wcard = iface_list_wildcard(task, task->lp_ctx);
|
||||
wcard = iface_list_wildcard(task);
|
||||
if (wcard == NULL) {
|
||||
DEBUG(0,("No wildcard addresses available\n"));
|
||||
goto failed;
|
||||
|
@ -503,7 +503,7 @@ bool iface_list_same_net(const char *ip1, const char *ip2, const char *netmask)
|
||||
return the list of wildcard interfaces
|
||||
this will include the IPv4 0.0.0.0, and may include IPv6 ::
|
||||
*/
|
||||
const char **iface_list_wildcard(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
|
||||
char **iface_list_wildcard(TALLOC_CTX *mem_ctx)
|
||||
{
|
||||
char **ret;
|
||||
#ifdef HAVE_IPV6
|
||||
@ -511,5 +511,5 @@ const char **iface_list_wildcard(TALLOC_CTX *mem_ctx, struct loadparm_context *l
|
||||
#else
|
||||
ret = str_list_make(mem_ctx, "0.0.0.0", NULL);
|
||||
#endif
|
||||
return discard_const_p(const char *, ret);
|
||||
return ret;
|
||||
}
|
||||
|
@ -1824,9 +1824,9 @@ static NTSTATUS dcesrv_add_ep_tcp(struct dcesrv_context *dce_ctx,
|
||||
NT_STATUS_NOT_OK_RETURN(status);
|
||||
}
|
||||
} else {
|
||||
const char **wcard;
|
||||
char **wcard;
|
||||
int i;
|
||||
wcard = iface_list_wildcard(dce_ctx, lp_ctx);
|
||||
wcard = iface_list_wildcard(dce_ctx);
|
||||
NT_STATUS_HAVE_NO_MEMORY(wcard);
|
||||
for (i=0; wcard[i]; i++) {
|
||||
status = add_socket_rpc_tcp_iface(dce_ctx, e, event_ctx, model_ops, wcard[i]);
|
||||
|
@ -63,9 +63,9 @@ static void smbsrv_task_init(struct task_server *task)
|
||||
if (!NT_STATUS_IS_OK(status)) goto failed;
|
||||
}
|
||||
} else {
|
||||
const char **wcard;
|
||||
char **wcard;
|
||||
int i;
|
||||
wcard = iface_list_wildcard(task, task->lp_ctx);
|
||||
wcard = iface_list_wildcard(task);
|
||||
if (wcard == NULL) {
|
||||
DEBUG(0,("No wildcard addresses available\n"));
|
||||
goto failed;
|
||||
|
@ -336,9 +336,9 @@ static void websrv_task_init(struct task_server *task)
|
||||
|
||||
talloc_free(ifaces);
|
||||
} else {
|
||||
const char **wcard;
|
||||
char **wcard;
|
||||
int i;
|
||||
wcard = iface_list_wildcard(task, task->lp_ctx);
|
||||
wcard = iface_list_wildcard(task);
|
||||
if (wcard == NULL) {
|
||||
DEBUG(0,("No wildcard addresses available\n"));
|
||||
goto failed;
|
||||
|
Loading…
x
Reference in New Issue
Block a user