diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-12-11 22:23:14 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:49:32 +0100 |
commit | 6f2252dace1629d7b5c5637b103caa28d2c89b07 (patch) | |
tree | fc09abaf04401ef510d55866066738840d052ebf /source4/wrepl_server | |
parent | f9948d18d73fb8d8711c3b5a46b1d83c881a0084 (diff) | |
download | samba-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/wrepl_server')
-rw-r--r-- | source4/wrepl_server/wrepl_in_connection.c | 9 | ||||
-rw-r--r-- | source4/wrepl_server/wrepl_server.c | 11 |
2 files changed, 17 insertions, 3 deletions
diff --git a/source4/wrepl_server/wrepl_in_connection.c b/source4/wrepl_server/wrepl_in_connection.c index 089bdd5f3e..74c524dc79 100644 --- a/source4/wrepl_server/wrepl_in_connection.c +++ b/source4/wrepl_server/wrepl_in_connection.c @@ -276,15 +276,20 @@ NTSTATUS wreplsrv_setup_sockets(struct wreplsrv_service *service, struct loadpar } if (lp_interfaces(lp_ctx) && lp_bind_interfaces_only(lp_ctx)) { - int num_interfaces = iface_count(lp_ctx); + int num_interfaces; int i; + struct interface *ifaces; + + load_interfaces(lp_interfaces(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++) { - address = iface_n_ip(lp_ctx, i); + address = iface_n_ip(ifaces, i); status = stream_setup_socket(task->event_ctx, model_ops, &wreplsrv_stream_ops, "ipv4", address, &port, lp_socket_options(task->lp_ctx), diff --git a/source4/wrepl_server/wrepl_server.c b/source4/wrepl_server/wrepl_server.c index 7455c57d75..c8ad80351e 100644 --- a/source4/wrepl_server/wrepl_server.c +++ b/source4/wrepl_server/wrepl_server.c @@ -32,6 +32,7 @@ #include "auth/auth.h" #include "ldb_wrap.h" #include "param/param.h" +#include "lib/socket/netif.h" static struct ldb_context *wins_config_db_connect(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx) @@ -74,7 +75,15 @@ failed: static NTSTATUS wreplsrv_open_winsdb(struct wreplsrv_service *service, struct loadparm_context *lp_ctx) { - service->wins_db = winsdb_connect(service, lp_ctx, WINSDB_HANDLE_CALLER_WREPL); + const char *owner = lp_parm_string(lp_ctx, NULL, "winsdb", "local_owner"); + + if (owner == NULL) { + struct interface *ifaces; + load_interfaces(lp_interfaces(lp_ctx), &ifaces); + owner = iface_n_ip(ifaces, 0); + } + + service->wins_db = winsdb_connect(service, lp_ctx, owner, WINSDB_HANDLE_CALLER_WREPL); if (!service->wins_db) { return NT_STATUS_INTERNAL_DB_ERROR; } |