From 6f2252dace1629d7b5c5637b103caa28d2c89b07 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 11 Dec 2007 22:23:14 +0100 Subject: r26401: Don't cache interfaces context in libnetif. (This used to be commit 9f975417cc66bfd4589da38bfd23731dbe0e6153) --- source4/kdc/kdc.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'source4/kdc') diff --git a/source4/kdc/kdc.c b/source4/kdc/kdc.c index 18fc86b8e0..0301a4c264 100644 --- a/source4/kdc/kdc.c +++ b/source4/kdc/kdc.c @@ -520,16 +520,18 @@ static NTSTATUS kdc_add_socket(struct kdc_server *kdc, const char *address, /* setup our listening sockets on the configured network interfaces */ -static NTSTATUS kdc_startup_interfaces(struct kdc_server *kdc, struct loadparm_context *lp_ctx) +static NTSTATUS kdc_startup_interfaces(struct kdc_server *kdc, struct loadparm_context *lp_ctx, + struct interface *ifaces) { - int num_interfaces = iface_count(lp_ctx); + int num_interfaces; TALLOC_CTX *tmp_ctx = talloc_new(kdc); NTSTATUS status; - int i; + + num_interfaces = iface_count(ifaces); for (i=0; ilp_ctx)) { case ROLE_STANDALONE: @@ -571,7 +574,9 @@ static void kdc_task_init(struct task_server *task) break; } - if (iface_count(task->lp_ctx) == 0) { + load_interfaces(lp_interfaces(task->lp_ctx), &ifaces); + + if (iface_count(ifaces) == 0) { task_server_terminate(task, "kdc: no network interfaces configured"); return; } @@ -641,7 +646,7 @@ static void kdc_task_init(struct task_server *task) kdc_mem_ctx = kdc->smb_krb5_context; /* start listening on the configured network interfaces */ - status = kdc_startup_interfaces(kdc, task->lp_ctx); + status = kdc_startup_interfaces(kdc, task->lp_ctx, ifaces); if (!NT_STATUS_IS_OK(status)) { task_server_terminate(task, "kdc failed to setup interfaces"); return; -- cgit