summaryrefslogtreecommitdiff
path: root/source4/nbt_server
diff options
context:
space:
mode:
Diffstat (limited to 'source4/nbt_server')
-rw-r--r--source4/nbt_server/interfaces.c10
-rw-r--r--source4/nbt_server/nbt_server.c2
-rw-r--r--source4/nbt_server/wins/wins_ldb.c5
-rw-r--r--source4/nbt_server/wins/winsdb.c2
4 files changed, 10 insertions, 9 deletions
diff --git a/source4/nbt_server/interfaces.c b/source4/nbt_server/interfaces.c
index c40cd6322c..21ebada3c8 100644
--- a/source4/nbt_server/interfaces.c
+++ b/source4/nbt_server/interfaces.c
@@ -218,7 +218,7 @@ static NTSTATUS nbtd_add_wins_socket(struct nbtd_server *nbtsrv)
*/
NTSTATUS nbtd_startup_interfaces(struct nbtd_server *nbtsrv, struct loadparm_context *lp_ctx)
{
- int num_interfaces = iface_count();
+ int num_interfaces = iface_count(lp_ctx);
int i;
TALLOC_CTX *tmp_ctx = talloc_new(nbtsrv);
NTSTATUS status;
@@ -232,7 +232,7 @@ NTSTATUS nbtd_startup_interfaces(struct nbtd_server *nbtsrv, struct loadparm_con
for non-WINS queries not made on a specific
interface */
if (num_interfaces > 0) {
- primary_address = iface_n_ip(0);
+ primary_address = iface_n_ip(lp_ctx, 0);
} else {
primary_address = inet_ntoa(interpret_addr2(
lp_netbios_name(lp_ctx)));
@@ -250,15 +250,15 @@ NTSTATUS nbtd_startup_interfaces(struct nbtd_server *nbtsrv, struct loadparm_con
}
for (i=0; i<num_interfaces; i++) {
- const char *bcast = iface_n_bcast(i);
+ const char *bcast = iface_n_bcast(lp_ctx, i);
const char *address, *netmask;
/* we can't assume every interface is broadcast capable */
if (bcast == NULL) continue;
- address = talloc_strdup(tmp_ctx, iface_n_ip(i));
+ address = talloc_strdup(tmp_ctx, iface_n_ip(lp_ctx, i));
bcast = talloc_strdup(tmp_ctx, bcast);
- netmask = talloc_strdup(tmp_ctx, iface_n_netmask(i));
+ netmask = talloc_strdup(tmp_ctx, iface_n_netmask(lp_ctx, i));
status = nbtd_add_socket(nbtsrv, lp_ctx,
address, address, bcast, netmask);
diff --git a/source4/nbt_server/nbt_server.c b/source4/nbt_server/nbt_server.c
index 29715e925f..22f46dec69 100644
--- a/source4/nbt_server/nbt_server.c
+++ b/source4/nbt_server/nbt_server.c
@@ -38,7 +38,7 @@ static void nbtd_task_init(struct task_server *task)
struct nbtd_server *nbtsrv;
NTSTATUS status;
- if (iface_count() == 0) {
+ if (iface_count(task->lp_ctx) == 0) {
task_server_terminate(task, "nbtd: no network interfaces configured");
return;
}
diff --git a/source4/nbt_server/wins/wins_ldb.c b/source4/nbt_server/wins/wins_ldb.c
index 3d22b5fe1b..7caab34aaa 100644
--- a/source4/nbt_server/wins/wins_ldb.c
+++ b/source4/nbt_server/wins/wins_ldb.c
@@ -84,12 +84,13 @@ static int wins_ldb_init(struct ldb_module *ctx)
{
struct winsdb_handle *h;
const char *owner;
+ struct loadparm_context *lp_ctx = ldb_get_opaque(ctx->ldb, "loadparm");
ctx->private_data = NULL;
- owner = lp_parm_string(global_loadparm, NULL, "winsdb", "local_owner");
+ owner = lp_parm_string(lp_ctx, NULL, "winsdb", "local_owner");
if (!owner) {
- owner = iface_n_ip(0);
+ owner = iface_n_ip(lp_ctx, 0);
if (!owner) {
owner = "0.0.0.0";
}
diff --git a/source4/nbt_server/wins/winsdb.c b/source4/nbt_server/wins/winsdb.c
index 438fb12b58..428b154731 100644
--- a/source4/nbt_server/wins/winsdb.c
+++ b/source4/nbt_server/wins/winsdb.c
@@ -1035,7 +1035,7 @@ struct winsdb_handle *winsdb_connect(TALLOC_CTX *mem_ctx, struct loadparm_contex
owner = lp_parm_string(lp_ctx, NULL, "winsdb", "local_owner");
if (!owner) {
- owner = iface_n_ip(0);
+ owner = iface_n_ip(lp_ctx, 0);
}
h->local_owner = talloc_strdup(h, owner);