/* 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)) {
- status = cldapd_add_socket(cldapd, lp_ctx, "0.0.0.0");
- NT_STATUS_NOT_OK_RETURN(status);
+ const char **wcard = iface_list_wildcard(cldapd, lp_ctx);
+ NT_STATUS_HAVE_NO_MEMORY(wcard);
+ for (i=0; wcard[i]; i++) {
+ status = cldapd_add_socket(cldapd, lp_ctx, wcard[i]);
+ NT_STATUS_NOT_OK_RETURN(status);
+ }
+ talloc_free(wcard);
}
/* now we have to also listen on the specific interfaces,
/* 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)) {
- if (kdc_port) {
- status = kdc_add_socket(kdc, model_ops,
- "kdc", "0.0.0.0", kdc_port,
- kdc_process, false);
- NT_STATUS_NOT_OK_RETURN(status);
- }
-
- if (kpasswd_port) {
- status = kdc_add_socket(kdc, model_ops,
- "kpasswd", "0.0.0.0", kpasswd_port,
- kpasswdd_process, false);
- NT_STATUS_NOT_OK_RETURN(status);
+ const char **wcard = iface_list_wildcard(kdc, lp_ctx);
+ NT_STATUS_HAVE_NO_MEMORY(wcard);
+ for (i=0; wcard[i]; i++) {
+ if (kdc_port) {
+ status = kdc_add_socket(kdc, model_ops,
+ "kdc", wcard[i], kdc_port,
+ kdc_process, false);
+ NT_STATUS_NOT_OK_RETURN(status);
+ }
+
+ if (kpasswd_port) {
+ status = kdc_add_socket(kdc, model_ops,
+ "kpasswd", wcard[i], kpasswd_port,
+ kpasswdd_process, false);
+ NT_STATUS_NOT_OK_RETURN(status);
+ }
}
+ talloc_free(wcard);
done_wildcard = true;
}
if (!NT_STATUS_IS_OK(status)) goto failed;
}
} else {
- status = add_socket(task, task->lp_ctx, model_ops,
- lpcfg_socket_address(task->lp_ctx), ldap_service);
- if (!NT_STATUS_IS_OK(status)) goto failed;
+ const char **wcard;
+ int i;
+ wcard = iface_list_wildcard(task, task->lp_ctx);
+ if (wcard == NULL) {
+ DEBUG(0,("No wildcard addresses available\n"));
+ goto failed;
+ }
+ for (i=0; wcard[i]; i++) {
+ status = add_socket(task, task->lp_ctx, model_ops, wcard[i], ldap_service);
+ if (!NT_STATUS_IS_OK(status)) goto failed;
+ }
+ talloc_free(wcard);
}
ldapi_path = lpcfg_private_path(ldap_service, task->lp_ctx, "ldapi");
NT_STATUS_NOT_OK_RETURN(status);
}
} else {
- status = add_socket_rpc_tcp_iface(dce_ctx, e, event_ctx, model_ops,
- lpcfg_socket_address(lp_ctx));
- NT_STATUS_NOT_OK_RETURN(status);
+ const char **wcard;
+ int i;
+ wcard = iface_list_wildcard(dce_ctx, lp_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]);
+ NT_STATUS_NOT_OK_RETURN(status);
+ }
+ talloc_free(wcard);
}
return NT_STATUS_OK;
}
} else {
/* Just bind to lpcfg_socket_address() (usually 0.0.0.0) */
- status = smbsrv_add_socket(task, task->event_ctx, task->lp_ctx, task->model_ops,
- lpcfg_socket_address(task->lp_ctx));
- if (!NT_STATUS_IS_OK(status)) goto failed;
+ const char **wcard;
+ int i;
+ wcard = iface_list_wildcard(task, task->lp_ctx);
+ if (wcard == NULL) {
+ DEBUG(0,("No wildcard addresses available\n"));
+ goto failed;
+ }
+ for (i=0; wcard[i]; i++) {
+ status = smbsrv_add_socket(task, task->event_ctx, task->lp_ctx, task->model_ops, wcard[i]);
+ if (!NT_STATUS_IS_OK(status)) goto failed;
+ }
+ talloc_free(wcard);
}
return;
if (!NT_STATUS_IS_OK(status)) goto failed;
}
} else {
- /* Just bind to lpcfg_socket_address() (usually 0.0.0.0) */
- status = samba3_add_socket(task,
- task->event_ctx, task->lp_ctx,
- model_ops,
- lpcfg_socket_address(task->lp_ctx));
- if (!NT_STATUS_IS_OK(status)) goto failed;
+ const char **wcard;
+ int i;
+ wcard = iface_list_wildcard(task, task->lp_ctx);
+ if (wcard == NULL) {
+ DEBUG(0,("No wildcard addresses available\n"));
+ goto failed;
+ }
+ for (i=0; wcard[i]; i++) {
+ status = samba3_add_socket(task,
+ task->event_ctx, task->lp_ctx,
+ model_ops,
+ wcard[i]);
+ if (!NT_STATUS_IS_OK(status)) goto failed;
+ }
+ talloc_free(wcard);
}
return;
talloc_free(ifaces);
} else {
- status = stream_setup_socket(task, task->event_ctx,
- task->lp_ctx, model_ops,
- &web_stream_ops,
- "ipv4", lpcfg_socket_address(task->lp_ctx),
- &port, lpcfg_socket_options(task->lp_ctx),
- task);
- if (!NT_STATUS_IS_OK(status)) goto failed;
+ const char **wcard;
+ int i;
+ wcard = iface_list_wildcard(task, task->lp_ctx);
+ if (wcard == NULL) {
+ DEBUG(0,("No wildcard addresses available\n"));
+ goto failed;
+ }
+ for (i=0; wcard[i]; i++) {
+ status = stream_setup_socket(task, task->event_ctx,
+ task->lp_ctx, model_ops,
+ &web_stream_ops,
+ "ip", wcard[i],
+ &port, lpcfg_socket_options(task->lp_ctx),
+ wdata);
+ if (!NT_STATUS_IS_OK(status)) goto failed;
+ }
+ talloc_free(wcard);
}
wdata->tls_params = tls_initialise(wdata, task->lp_ctx);