r26402: Require a talloc context in libnetif.
authorJelmer Vernooij <jelmer@samba.org>
Tue, 11 Dec 2007 21:23:20 +0000 (22:23 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:49:33 +0000 (05:49 +0100)
(This used to be commit a35e51871bbf1ab33fc316fa59e597b722769c50)

26 files changed:
source4/cldap_server/cldap_server.c
source4/cldap_server/netlogon.c
source4/heimdal_build/glue.c
source4/kdc/kdc.c
source4/ldap_server/ldap_server.c
source4/lib/socket/interface.c
source4/lib/socket/testsuite.c
source4/libcli/resolve/bcast.c
source4/libcli/resolve/nbtlist.c
source4/libcli/wrepl/winsrepl.c
source4/nbt_server/nbt_server.c
source4/nbt_server/wins/wins_ldb.c
source4/nbt_server/wins/winsserver.c
source4/rpc_server/service_rpc.c
source4/scripting/ejs/smbcalls_sys.c
source4/smb_server/smb_server.c
source4/torture/nbt/dgram.c
source4/torture/nbt/register.c
source4/torture/nbt/wins.c
source4/torture/nbt/winsbench.c
source4/torture/nbt/winsreplication.c
source4/torture/rpc/spoolss_notify.c
source4/utils/nmblookup.c
source4/web_server/web_server.c
source4/wrepl_server/wrepl_in_connection.c
source4/wrepl_server/wrepl_server.c

index 8f6c9410f8c7ba8f8c49e7eac2c945276bc66479..47597ff1dbf80ece9972093218cc7db9368d1e23 100644 (file)
@@ -159,7 +159,7 @@ static void cldapd_task_init(struct task_server *task)
        NTSTATUS status;
        struct interface *ifaces;
        
-       load_interfaces(lp_interfaces(task->lp_ctx), &ifaces);
+       load_interfaces(task, lp_interfaces(task->lp_ctx), &ifaces);
 
        if (iface_count(ifaces) == 0) {
                task_server_terminate(task, "cldapd: no network interfaces configured");
index 1c2b51aed705b09a68ccbd9f05470751264719a5..b79d678e88d58e3c2012dbc098acb8551221ff5d 100644 (file)
@@ -188,7 +188,7 @@ static NTSTATUS cldapd_netlogon_fill(struct cldapd_server *cldapd,
                                               lp_workgroup(lp_ctx));
        server_site      = "Default-First-Site-Name";
        client_site      = "Default-First-Site-Name";
-       load_interfaces(lp_interfaces(lp_ctx), &ifaces);
+       load_interfaces(mem_ctx, lp_interfaces(lp_ctx), &ifaces);
        pdc_ip           = iface_best_ip(ifaces, src_address);
 
        ZERO_STRUCTP(netlogon);
index 809b63f418eb3807dd142db87331ed75787864c3..07062ae8bfd28ecd92ceb91e6ca3cf0b08620033 100644 (file)
@@ -33,11 +33,12 @@ krb5_error_code KRB5_LIB_FUNCTION krb5_get_all_client_addrs(krb5_context context
        int i;
        struct interface *ifaces;
 
-       load_interfaces(lp_interfaces(global_loadparm), &ifaces);
+       load_interfaces(NULL, lp_interfaces(global_loadparm), &ifaces);
 
        res->len = iface_count(ifaces);
        res->val = malloc_array_p(HostAddress, res->len);
        if (res->val == NULL) {
+               talloc_free(ifaces);
                return ENOMEM;
        }
        for (i=0;i<res->len;i++) {
@@ -46,11 +47,14 @@ krb5_error_code KRB5_LIB_FUNCTION krb5_get_all_client_addrs(krb5_context context
                res->val[i].address.length = 4;
                res->val[i].address.data = malloc(4);
                if (res->val[i].address.data == NULL) {
+                       talloc_free(ifaces);
                        return ENOMEM;
                }
                ((struct in_addr *)res->val[i].address.data)->s_addr = inet_addr(ip);
        }
 
+       talloc_free(ifaces);
+
        return 0;
 }
 
index 0301a4c264149c9c4778727b1f4afd809493f7de..5c8b2afe0fceb24fca340c45ad1fb2a00eb9c526 100644 (file)
@@ -574,7 +574,7 @@ static void kdc_task_init(struct task_server *task)
                break;
        }
 
-       load_interfaces(lp_interfaces(task->lp_ctx), &ifaces);
+       load_interfaces(task, lp_interfaces(task->lp_ctx), &ifaces);
 
        if (iface_count(ifaces) == 0) {
                task_server_terminate(task, "kdc: no network interfaces configured");
index 9d3fa0ada438dca76eb2a4e6c973b4b083389175..f0b5e56205e3478cfb004d38e27e2ae5d5d6265f 100644 (file)
@@ -550,7 +550,7 @@ static void ldapsrv_task_init(struct task_server *task)
                int num_interfaces;
                int i;
 
-               load_interfaces(lp_interfaces(task->lp_ctx), &ifaces);
+               load_interfaces(task, lp_interfaces(task->lp_ctx), &ifaces);
                num_interfaces = iface_count(ifaces);
 
                /* We have been given an interfaces line, and been 
index d21923d972b490d91b0263306521ca03d70a2ce4..241fcbff5eb732540391b4cdb8a1d2f4088ad6d1 100644 (file)
@@ -63,7 +63,7 @@ static struct interface *iface_find(struct interface *interfaces,
 /****************************************************************************
 add an interface to the linked list of interfaces
 ****************************************************************************/
-static void add_interface(struct in_addr ip, struct in_addr nmask, struct interface **interfaces)
+static void add_interface(TALLOC_CTX *mem_ctx, struct in_addr ip, struct in_addr nmask, struct interface **interfaces)
 {
        struct interface *iface;
        struct in_addr bcast;
@@ -73,7 +73,7 @@ static void add_interface(struct in_addr ip, struct in_addr nmask, struct interf
                return;
        }
 
-       iface = talloc(*interfaces == NULL ? talloc_autofree_context() : *interfaces, struct interface);
+       iface = talloc(*interfaces == NULL ? mem_ctx : *interfaces, struct interface);
        if (iface == NULL) 
                return;
        
@@ -110,7 +110,8 @@ This handles the following different forms:
 4) ip/mask
 5) bcast/mask
 **/
-static void interpret_interface(const char *token, 
+static void interpret_interface(TALLOC_CTX *mem_ctx, 
+                               const char *token, 
                                struct iface_struct *probed_ifaces, 
                                int total_probed,
                                struct interface **local_interfaces)
@@ -125,7 +126,7 @@ static void interpret_interface(const char *token,
        /* first check if it is an interface name */
        for (i=0;i<total_probed;i++) {
                if (gen_fnmatch(token, probed_ifaces[i].name) == 0) {
-                       add_interface(probed_ifaces[i].ip,
+                       add_interface(mem_ctx, probed_ifaces[i].ip,
                                      probed_ifaces[i].netmask,
                                      local_interfaces);
                        added = 1;
@@ -143,7 +144,7 @@ static void interpret_interface(const char *token,
                ip.s_addr = interpret_addr2(token).s_addr;
                for (i=0;i<total_probed;i++) {
                        if (ip.s_addr == probed_ifaces[i].ip.s_addr) {
-                               add_interface(probed_ifaces[i].ip,
+                               add_interface(mem_ctx, probed_ifaces[i].ip,
                                              probed_ifaces[i].netmask,
                                              local_interfaces);
                                return;
@@ -169,7 +170,7 @@ static void interpret_interface(const char *token,
            ip.s_addr == MKNETADDR(ip.s_addr, nmask.s_addr)) {
                for (i=0;i<total_probed;i++) {
                        if (same_net(ip, probed_ifaces[i].ip, nmask)) {
-                               add_interface(probed_ifaces[i].ip, nmask,
+                               add_interface(mem_ctx, probed_ifaces[i].ip, nmask,
                                              local_interfaces);
                                return;
                        }
@@ -178,14 +179,14 @@ static void interpret_interface(const char *token,
                return;
        }
 
-       add_interface(ip, nmask, local_interfaces);
+       add_interface(mem_ctx, ip, nmask, local_interfaces);
 }
 
 
 /**
 load the list of network interfaces
 **/
-void load_interfaces(const char **interfaces, struct interface **local_interfaces)
+void load_interfaces(TALLOC_CTX *mem_ctx, const char **interfaces, struct interface **local_interfaces)
 {
        const char **ptr = interfaces;
        int i;
@@ -208,14 +209,14 @@ void load_interfaces(const char **interfaces, struct interface **local_interface
                }
                for (i=0;i<total_probed;i++) {
                        if (ifaces[i].ip.s_addr != loopback_ip.s_addr) {
-                               add_interface(ifaces[i].ip, 
+                               add_interface(mem_ctx, ifaces[i].ip, 
                                              ifaces[i].netmask, local_interfaces);
                        }
                }
        }
 
        while (ptr && *ptr) {
-               interpret_interface(*ptr, ifaces, total_probed, local_interfaces);
+               interpret_interface(mem_ctx, *ptr, ifaces, total_probed, local_interfaces);
                ptr++;
        }
 
index a99ae078b55f05a49104f50ab990032017f29fe4..6d4d81a884bb5b167efb99d775fc37ea533e39fd 100644 (file)
@@ -42,7 +42,7 @@ static bool test_udp(struct torture_context *tctx)
        TALLOC_CTX *mem_ctx = tctx;
        struct interface *ifaces;
 
-       load_interfaces(lp_interfaces(tctx->lp_ctx), &ifaces);
+       load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces);
 
        status = socket_create("ip", SOCKET_TYPE_DGRAM, &sock1, 0);
        torture_assert_ntstatus_ok(tctx, status, "creating DGRAM IP socket 1");
@@ -135,7 +135,7 @@ static bool test_tcp(struct torture_context *tctx)
        torture_assert_ntstatus_ok(tctx, status, "creating IP stream socket 1");
        talloc_steal(mem_ctx, sock2);
 
-       load_interfaces(lp_interfaces(tctx->lp_ctx), &ifaces);
+       load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces);
        localhost = socket_address_from_strings(sock1, sock1->backend_name, 
                                                iface_best_ip(ifaces, "127.0.0.1"), 0);
        torture_assert(tctx, localhost, "Localhost not found");
index d1f3d65faf437e56723555cbe799f147fde85cd8..1dd932876052083ee495a54351f85d6c5cb79141 100644 (file)
@@ -86,7 +86,7 @@ NTSTATUS resolve_name_bcast(struct nbt_name *name,
 bool resolve_context_add_bcast_method(struct resolve_context *ctx, struct loadparm_context *lp_ctx)
 {
        struct interface *ifaces;
-       load_interfaces(lp_interfaces(lp_ctx), &ifaces);
+       load_interfaces(ctx, lp_interfaces(lp_ctx), &ifaces);
        return resolve_context_add_method(ctx, resolve_name_bcast_send, resolve_name_bcast_recv,
                                          ifaces);
 }
index 6c12fe706b432095d4bfc3fad2c30a9148a63102..595743e69324491d73aa058228d8e024b5dad07d 100644 (file)
@@ -76,7 +76,7 @@ static void nbtlist_handler(struct nbt_name_request *req)
        }
 
        /* favor a local address if possible */
-       load_interfaces(lp_interfaces(global_loadparm), &ifaces);
+       load_interfaces(NULL, lp_interfaces(global_loadparm), &ifaces);
        state->reply_addr = NULL;
        for (i=0;i<q->out.num_addrs;i++) {
                if (iface_is_local(ifaces, q->out.reply_addrs[i])) {
@@ -85,6 +85,7 @@ static void nbtlist_handler(struct nbt_name_request *req)
                        break;
                }
        }
+       talloc_free(ifaces);
 
        if (state->reply_addr == NULL) {
                state->reply_addr = talloc_steal(state, 
index 15dc98f675c35f5a09a05d690c43722afc3ba637..63b0a60f6c214b90e0625995579bbcf4dea06f68 100644 (file)
@@ -334,7 +334,7 @@ struct composite_context *wrepl_connect_send(struct wrepl_socket *wrepl_socket,
 
        if (!our_ip) {
                struct interface *ifaces;
-               load_interfaces(lp_interfaces(global_loadparm), &ifaces);
+               load_interfaces(state, lp_interfaces(global_loadparm), &ifaces);
                our_ip = iface_best_ip(ifaces, peer_ip);
        }
 
index 14b8d2461c15b0207c27c145425874c5226417f0..c7fb3b286a447ba12a805fe86b70b06c0588a42a 100644 (file)
@@ -39,7 +39,7 @@ static void nbtd_task_init(struct task_server *task)
        NTSTATUS status;
        struct interface *ifaces;
 
-       load_interfaces(lp_interfaces(task->lp_ctx), &ifaces);
+       load_interfaces(task, lp_interfaces(task->lp_ctx), &ifaces);
 
        if (iface_count(ifaces) == 0) {
                task_server_terminate(task, "nbtd: no network interfaces configured");
index 6fef2180560788acf96ea80896840c910f2b58a8..47aa4156675f9d8408c1651830c06c279c1de964 100644 (file)
@@ -91,7 +91,7 @@ static int wins_ldb_init(struct ldb_module *ctx)
        owner = lp_parm_string(lp_ctx, NULL, "winsdb", "local_owner");
        if (!owner) {
                struct interface *ifaces;
-               load_interfaces(lp_interfaces(lp_ctx), &ifaces);
+               load_interfaces(ctx, lp_interfaces(lp_ctx), &ifaces);
                owner = iface_n_ip(ifaces, 0);
                if (!owner) {
                        owner = "0.0.0.0";
index e24ad8537694613e4737cf307b0436d17e33db12..6219e6de680021e64eee1c9887a6e0d946b15285 100644 (file)
@@ -980,7 +980,7 @@ NTSTATUS nbtd_winsserver_init(struct nbtd_server *nbtsrv)
 
        if (owner == NULL) {
                struct interface *ifaces;
-               load_interfaces(lp_interfaces(nbtsrv->task->lp_ctx), &ifaces);
+               load_interfaces(nbtsrv->task, lp_interfaces(nbtsrv->task->lp_ctx), &ifaces);
                owner = iface_n_ip(ifaces, 0);
        }
 
index 363d5971c9c20f3b7da68fb6234a15d8f0b56a8e..33a86851a86805056d4aefd1e3227ccae5cad800 100644 (file)
@@ -374,14 +374,16 @@ static NTSTATUS dcesrv_add_ep_tcp(struct dcesrv_context *dce_ctx,
                                  struct event_context *event_ctx, const struct model_ops *model_ops)
 {
        NTSTATUS status;
-       struct interface *ifaces;
-
-       load_interfaces(lp_interfaces(lp_ctx), &ifaces);
 
        /* Add TCP/IP sockets */
        if (lp_interfaces(lp_ctx) && lp_bind_interfaces_only(lp_ctx)) {
-               int num_interfaces = iface_count(ifaces);
+               int num_interfaces;
                int i;
+               struct interface *ifaces;
+
+               load_interfaces(dce_ctx, lp_interfaces(lp_ctx), &ifaces);
+
+               num_interfaces = iface_count(ifaces);
                for(i = 0; i < num_interfaces; i++) {
                        const char *address = iface_n_ip(ifaces, i);
                        status = add_socket_rpc_tcp_iface(dce_ctx, e, event_ctx, model_ops, address);
index cc1c3b4e3259dae1ebbb1fdf5a21f21c31509751..72ddf90231c5272217966b500b64d23e2d8b39c9 100644 (file)
@@ -36,12 +36,14 @@ static int ejs_sys_interfaces(MprVarHandle eid, int argc, struct MprVar **argv)
        struct MprVar ret = mprArray("interfaces");
        struct interface *ifaces;
 
-       load_interfaces(lp_interfaces(global_loadparm), &ifaces);
+       load_interfaces(NULL, lp_interfaces(global_loadparm), &ifaces);
 
        count = iface_count(ifaces);
        for (i=0;i<count;i++) {
                mprAddArray(&ret, i, mprString(iface_n_ip(ifaces, i)));
        }
+
+       talloc_free(ifaces);
        mpr_Return(eid, ret);
        return 0;       
 }
index 1dd022405a0b67eb322ac733f1cc4e09de802243..bc17d100c5511c96383c11e3aedf1533b0c8952c 100644 (file)
@@ -222,7 +222,7 @@ static void smbsrv_task_init(struct task_server *task)
                int i;
                struct interface *ifaces;
 
-               load_interfaces(lp_interfaces(task->lp_ctx), &ifaces);
+               load_interfaces(task, lp_interfaces(task->lp_ctx), &ifaces);
 
                num_interfaces = iface_count(ifaces);
 
index d8903eedac3f321e22d6af399270748ca47fda41..0315989d6685d0ff1ac8fe651374c648cb94e8c0 100644 (file)
@@ -89,7 +89,7 @@ static bool nbt_test_netlogon(struct torture_context *tctx)
                                   resolve_name(lp_resolve_context(tctx->lp_ctx), &name, tctx, &address, event_context_find(tctx)),
                                   talloc_asprintf(tctx, "Failed to resolve %s", name.name));
 
-       load_interfaces(lp_interfaces(tctx->lp_ctx), &ifaces);
+       load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces);
        myaddress = talloc_strdup(dgmsock, iface_best_ip(ifaces, address));
 
 
@@ -171,7 +171,7 @@ static bool nbt_test_netlogon2(struct torture_context *tctx)
                                   resolve_name(lp_resolve_context(tctx->lp_ctx), &name, tctx, &address, event_context_find(tctx)),
                                   talloc_asprintf(tctx, "Failed to resolve %s", name.name));
 
-       load_interfaces(lp_interfaces(tctx->lp_ctx), &ifaces);
+       load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces);
        myaddress = talloc_strdup(dgmsock, iface_best_ip(ifaces, address));
 
        socket_address = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name,
@@ -283,7 +283,7 @@ static bool nbt_test_ntlogon(struct torture_context *tctx)
                                   resolve_name(lp_resolve_context(tctx->lp_ctx), &name, tctx, &address, event_context_find(tctx)), 
                                   talloc_asprintf(tctx, "Failed to resolve %s", name.name));
 
-       load_interfaces(lp_interfaces(tctx->lp_ctx), &ifaces);
+       load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces);
        myaddress = talloc_strdup(dgmsock, iface_best_ip(ifaces, address));
 
        socket_address = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name,
index 090027be2ea835b5c198ae6098261c1e83f2317b..508c6b484040103d50690968a58fdf045e20b182 100644 (file)
@@ -54,7 +54,7 @@ static bool nbt_register_own(struct torture_context *tctx)
        if (!torture_nbt_get_name(tctx, &name, &address))
                return false;
 
-       load_interfaces(lp_interfaces(tctx->lp_ctx), &ifaces);
+       load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces);
 
        myaddress = iface_best_ip(ifaces, address);
 
@@ -123,7 +123,7 @@ static bool nbt_refresh_own(struct torture_context *tctx)
        if (!torture_nbt_get_name(tctx, &name, &address))
                return false;
        
-       load_interfaces(lp_interfaces(tctx->lp_ctx), &ifaces);
+       load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces);
 
        myaddress = iface_best_ip(ifaces, address);
 
index 0d895ddd0ddd986b25cdfc6d833e8baeb7e2c991..a236099a13d8a72503df9a82d68a8a848f64fe23 100644 (file)
@@ -58,7 +58,7 @@ static bool nbt_test_wins_name(struct torture_context *tctx, const char *address
        struct socket_address *socket_address;
        struct interface *ifaces;
 
-       load_interfaces(lp_interfaces(tctx->lp_ctx), &ifaces);
+       load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces);
 
        myaddress = talloc_strdup(tctx, iface_best_ip(ifaces, address));
 
index 95241a1a122cbabc40336aa9d24c5e921f3ffb74..db9371977e38dfa1a49d2125bf3e8d5a5a69e54c 100644 (file)
@@ -245,7 +245,7 @@ static bool bench_wins(struct torture_context *tctx)
        state->registered = talloc_zero_array(state, bool, state->num_names);
        state->wins_server = address;
        state->wins_port = lp_nbt_port(tctx->lp_ctx);
-       load_interfaces(lp_interfaces(tctx->lp_ctx), &ifaces);
+       load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces);
        state->my_ip = talloc_strdup(tctx, iface_best_ip(ifaces, address));
        state->ttl = timelimit;
 
index b90daa98c4605e92875693381aecae29cd48962e..d1c8e9a961a03852bd50517fed44247ac15c33cf 100644 (file)
@@ -613,7 +613,7 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx(
        ctx->nbtsock = nbt_name_socket_init(ctx, NULL);
        if (!ctx->nbtsock) return NULL;
 
-       load_interfaces(lp_interfaces(tctx->lp_ctx), &ifaces);
+       load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces);
 
        ctx->myaddr = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_best_ip(ifaces, address), 0);
        if (!ctx->myaddr) return NULL;
index 48ddcb6a6075e7e0cb07d7786ee98a70635d3321..559c50df4535bea9826830b21d899305871576da 100644 (file)
@@ -227,7 +227,7 @@ static bool test_RFFPCNEx(struct torture_context *tctx,
 
        lp_set_cmdline(tctx->lp_ctx, "dcerpc endpoint servers", "spoolss");
 
-       load_interfaces(lp_interfaces(tctx->lp_ctx), &ifaces);
+       load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces);
        address = iface_n_ip(ifaces, 0);
        torture_comment(tctx, "Listening for callbacks on %s\n", address);
        status = smbsrv_add_socket(p->conn->event_ctx, tctx->lp_ctx, &single_ops, address);
index 6c849fc0dbde1e6d0d24b05813271aec8e72b91e..7eae9c7765e0376d1bc7f08cda8d9e9c021bd36c 100644 (file)
@@ -355,7 +355,7 @@ int main(int argc, const char *argv[])
                exit(1);
        }
 
-       load_interfaces(lp_interfaces(cmdline_lp_ctx), &ifaces);
+       load_interfaces(NULL, lp_interfaces(cmdline_lp_ctx), &ifaces);
        
        while (poptPeekArg(pc)) {
                const char *name = poptGetArg(pc);
@@ -363,6 +363,8 @@ int main(int argc, const char *argv[])
                ret &= process_one(cmdline_lp_ctx, ifaces, name, lp_nbt_port(cmdline_lp_ctx));
        }
 
+       talloc_free(ifaces);
+
        poptFreeContext(pc);
 
        if (!ret) {
index 0fdb0bfb4ffa521c3fe88cbeaa306d3cf7a5960e..87cab2cc92496b7bb60f4845437434725fb2afe9 100644 (file)
@@ -255,7 +255,7 @@ static void websrv_task_init(struct task_server *task)
                int i;
                struct interface *ifaces;
 
-               load_interfaces(lp_interfaces(task->lp_ctx), &ifaces);
+               load_interfaces(NULL, lp_interfaces(task->lp_ctx), &ifaces);
 
                num_interfaces = iface_count(ifaces);
                for(i = 0; i < num_interfaces; i++) {
@@ -267,6 +267,8 @@ static void websrv_task_init(struct task_server *task)
                                                     task);
                        if (!NT_STATUS_IS_OK(status)) goto failed;
                }
+
+               talloc_free(ifaces);
        } else {
                status = stream_setup_socket(task->event_ctx, model_ops, 
                                             &web_stream_ops, 
index 74c524dc790cb2fbdac28c63c2a5324824480cb2..4d834a6a5ac4bb2142a36642b148817f3143f0cf 100644 (file)
@@ -280,7 +280,7 @@ NTSTATUS wreplsrv_setup_sockets(struct wreplsrv_service *service, struct loadpar
                int i;
                struct interface *ifaces;
 
-               load_interfaces(lp_interfaces(lp_ctx), &ifaces);
+               load_interfaces(task, lp_interfaces(lp_ctx), &ifaces);
 
                num_interfaces = iface_count(ifaces);
 
index c8ad80351e0d5e59731bf0ee1b311b0be79cd550..7d4be3e1b5171657b06e49cbb5f967842cd66ff2 100644 (file)
@@ -79,7 +79,7 @@ static NTSTATUS wreplsrv_open_winsdb(struct wreplsrv_service *service,
 
        if (owner == NULL) {
                struct interface *ifaces;
-               load_interfaces(lp_interfaces(lp_ctx), &ifaces);
+               load_interfaces(service, lp_interfaces(lp_ctx), &ifaces);
                owner = iface_n_ip(ifaces, 0);
        }