1
0
mirror of https://github.com/samba-team/samba.git synced 2025-10-29 04:23:51 +03:00

r26401: Don't cache interfaces context in libnetif.

This commit is contained in:
Jelmer Vernooij
2007-12-11 22:23:14 +01:00
committed by Stefan Metzmacher
parent 9faba28749
commit 9f975417cc
33 changed files with 218 additions and 132 deletions

View File

@@ -218,15 +218,20 @@ static void smbsrv_task_init(struct task_server *task)
task_server_set_title(task, "task[smbsrv]");
if (lp_interfaces(task->lp_ctx) && lp_bind_interfaces_only(task->lp_ctx)) {
int num_interfaces = iface_count(task->lp_ctx);
int num_interfaces;
int i;
struct interface *ifaces;
load_interfaces(lp_interfaces(task->lp_ctx), &ifaces);
num_interfaces = iface_count(ifaces);
/* We have been given an interfaces line, and been
told to only bind to those interfaces. Create a
socket per interface and bind to only these.
*/
for(i = 0; i < num_interfaces; i++) {
const char *address = iface_n_ip(task->lp_ctx, i);
const char *address = iface_n_ip(ifaces, i);
status = smbsrv_add_socket(task->event_ctx, task->lp_ctx, task->model_ops, address);
if (!NT_STATUS_IS_OK(status)) goto failed;
}