summaryrefslogtreecommitdiff
path: root/source4/kdc
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-11 22:23:14 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:49:32 +0100
commit6f2252dace1629d7b5c5637b103caa28d2c89b07 (patch)
treefc09abaf04401ef510d55866066738840d052ebf /source4/kdc
parentf9948d18d73fb8d8711c3b5a46b1d83c881a0084 (diff)
downloadsamba-6f2252dace1629d7b5c5637b103caa28d2c89b07.tar.gz
samba-6f2252dace1629d7b5c5637b103caa28d2c89b07.tar.bz2
samba-6f2252dace1629d7b5c5637b103caa28d2c89b07.zip
r26401: Don't cache interfaces context in libnetif.
(This used to be commit 9f975417cc66bfd4589da38bfd23731dbe0e6153)
Diffstat (limited to 'source4/kdc')
-rw-r--r--source4/kdc/kdc.c17
1 files changed, 11 insertions, 6 deletions
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; i<num_interfaces; i++) {
- const char *address = talloc_strdup(tmp_ctx, iface_n_ip(lp_ctx, i));
+ const char *address = talloc_strdup(tmp_ctx, iface_n_ip(ifaces, i));
status = kdc_add_socket(kdc, address, lp_krb5_port(lp_ctx),
lp_kpasswd_port(lp_ctx));
NT_STATUS_NOT_OK_RETURN(status);
@@ -558,6 +560,7 @@ static void kdc_task_init(struct task_server *task)
struct kdc_server *kdc;
NTSTATUS status;
krb5_error_code ret;
+ struct interface *ifaces;
switch (lp_server_role(task->lp_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;