summaryrefslogtreecommitdiff
path: root/source4/smb_server
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-05-12 12:35:02 +0200
committerAndrew Tridgell <tridge@samba.org>2011-06-06 12:26:10 +1000
commitdc8c8fd9e4f85974cd0665e613d4422ba8dd900e (patch)
tree0f1f60584986c4648ace8af742d2023fe5c87dc8 /source4/smb_server
parentd510687408c03291df767e0ccacebcd4a360646c (diff)
downloadsamba-dc8c8fd9e4f85974cd0665e613d4422ba8dd900e.tar.gz
samba-dc8c8fd9e4f85974cd0665e613d4422ba8dd900e.tar.bz2
samba-dc8c8fd9e4f85974cd0665e613d4422ba8dd900e.zip
s4-ipv6: use iface_list_wildcard() to listen on IPv6
when we need to listen on a wildcard address, we now listen on a list of sockets, usually 0.0.0.0 and ::
Diffstat (limited to 'source4/smb_server')
-rw-r--r--source4/smb_server/service_smb.c15
-rw-r--r--source4/smb_server/smb_samba3.c21
2 files changed, 27 insertions, 9 deletions
diff --git a/source4/smb_server/service_smb.c b/source4/smb_server/service_smb.c
index 4866695865..d2833d9be6 100644
--- a/source4/smb_server/service_smb.c
+++ b/source4/smb_server/service_smb.c
@@ -63,9 +63,18 @@ static void smbsrv_task_init(struct task_server *task)
}
} 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;
diff --git a/source4/smb_server/smb_samba3.c b/source4/smb_server/smb_samba3.c
index 86e67ec20d..35630ade05 100644
--- a/source4/smb_server/smb_samba3.c
+++ b/source4/smb_server/smb_samba3.c
@@ -152,12 +152,21 @@ static void samba3_smb_task_init(struct task_server *task)
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;