summaryrefslogtreecommitdiff
path: root/source4/nbt_server
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-09-08 16:46:30 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:05:43 -0500
commit98b57d5eb61094a9c88e2f7d90d3e21b7e74e9d8 (patch)
tree044b24a249cc2b63c2f69214d7e7da288c170c74 /source4/nbt_server
parentce0ff008b5c5af931526d14fa6232f8647e0880f (diff)
downloadsamba-98b57d5eb61094a9c88e2f7d90d3e21b7e74e9d8.tar.gz
samba-98b57d5eb61094a9c88e2f7d90d3e21b7e74e9d8.tar.bz2
samba-98b57d5eb61094a9c88e2f7d90d3e21b7e74e9d8.zip
r25035: Fix some more warnings, use service pointer rather than service number in more places.
(This used to be commit df9cebcb97e20564359097148665bd519f31bc6f)
Diffstat (limited to 'source4/nbt_server')
-rw-r--r--source4/nbt_server/packet.c2
-rw-r--r--source4/nbt_server/register.c4
-rw-r--r--source4/nbt_server/wins/wins_ldb.c2
-rw-r--r--source4/nbt_server/wins/winsclient.c4
-rw-r--r--source4/nbt_server/wins/winsdb.c6
-rw-r--r--source4/nbt_server/wins/winsserver.c12
6 files changed, 16 insertions, 14 deletions
diff --git a/source4/nbt_server/packet.c b/source4/nbt_server/packet.c
index f53d355daf..747b41076c 100644
--- a/source4/nbt_server/packet.c
+++ b/source4/nbt_server/packet.c
@@ -327,7 +327,7 @@ void nbtd_wack_reply(struct nbt_name_socket *nbtsock,
packet->answers[0].rr_class = NBT_QCLASS_IP;
packet->answers[0].ttl = ttl;
packet->answers[0].rdata.data.length = 2;
- packet->answers[0].rdata.data.data = talloc_size(packet, 2);
+ packet->answers[0].rdata.data.data = talloc_array(packet, uint8_t, 2);
if (packet->answers[0].rdata.data.data == NULL) goto failed;
RSSVAL(packet->answers[0].rdata.data.data, 0, request_packet->operation);
diff --git a/source4/nbt_server/register.c b/source4/nbt_server/register.c
index 3b81d65bd2..d22903d519 100644
--- a/source4/nbt_server/register.c
+++ b/source4/nbt_server/register.c
@@ -118,7 +118,7 @@ static void name_refresh_handler(struct event_context *ev, struct timed_event *t
static void nbtd_start_refresh_timer(struct nbtd_iface_name *iname)
{
uint32_t refresh_time;
- uint32_t max_refresh_time = lp_parm_int(-1, "nbtd", "max_refresh_time", 7200);
+ uint32_t max_refresh_time = lp_parm_int(NULL, "nbtd", "max_refresh_time", 7200);
refresh_time = MIN(max_refresh_time, iname->ttl/2);
@@ -188,7 +188,7 @@ static void nbtd_register_name_iface(struct nbtd_interface *iface,
iname->name.scope = NULL;
}
iname->nb_flags = nb_flags;
- iname->ttl = lp_parm_int(-1, "nbtd", "bcast_ttl", 300000);
+ iname->ttl = lp_parm_int(NULL, "nbtd", "bcast_ttl", 300000);
iname->registration_time = timeval_zero();
iname->wins_server = NULL;
diff --git a/source4/nbt_server/wins/wins_ldb.c b/source4/nbt_server/wins/wins_ldb.c
index 1fa073dc0d..2e5889fb1e 100644
--- a/source4/nbt_server/wins/wins_ldb.c
+++ b/source4/nbt_server/wins/wins_ldb.c
@@ -87,7 +87,7 @@ static int wins_ldb_init(struct ldb_module *ctx)
ctx->private_data = NULL;
- owner = lp_parm_string(-1, "winsdb", "local_owner");
+ owner = lp_parm_string(NULL, "winsdb", "local_owner");
if (!owner) {
owner = iface_n_ip(0);
if (!owner) {
diff --git a/source4/nbt_server/wins/winsclient.c b/source4/nbt_server/wins/winsclient.c
index 279462289d..e18885c327 100644
--- a/source4/nbt_server/wins/winsclient.c
+++ b/source4/nbt_server/wins/winsclient.c
@@ -58,7 +58,7 @@ static void nbtd_wins_register_retry(struct event_context *ev, struct timed_even
static void nbtd_wins_start_refresh_timer(struct nbtd_iface_name *iname)
{
uint32_t refresh_time;
- uint32_t max_refresh_time = lp_parm_int(-1, "nbtd", "max_refresh_time", 7200);
+ uint32_t max_refresh_time = lp_parm_int(NULL, "nbtd", "max_refresh_time", 7200);
refresh_time = MIN(max_refresh_time, iname->ttl/2);
@@ -179,7 +179,7 @@ static void nbtd_wins_register_handler(struct composite_context *c)
if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
/* none of the WINS servers responded - try again
periodically */
- int wins_retry_time = lp_parm_int(-1, "nbtd", "wins_retry", 300);
+ int wins_retry_time = lp_parm_int(NULL, "nbtd", "wins_retry", 300);
event_add_timed(iname->iface->nbtsrv->task->event_ctx,
iname,
timeval_current_ofs(wins_retry_time, 0),
diff --git a/source4/nbt_server/wins/winsdb.c b/source4/nbt_server/wins/winsdb.c
index cfaee05020..6b26ba2d63 100644
--- a/source4/nbt_server/wins/winsdb.c
+++ b/source4/nbt_server/wins/winsdb.c
@@ -988,7 +988,7 @@ static BOOL winsdb_check_or_add_module_list(struct winsdb_handle *h)
talloc_free(h->ldb);
h->ldb = NULL;
- if (lp_parm_bool(-1,"winsdb", "nosync", False)) {
+ if (lp_parm_bool(NULL,"winsdb", "nosync", false)) {
flags |= LDB_FLG_NOSYNC;
}
@@ -1021,7 +1021,7 @@ struct winsdb_handle *winsdb_connect(TALLOC_CTX *mem_ctx, enum winsdb_handle_cal
h = talloc(mem_ctx, struct winsdb_handle);
if (!h) return NULL;
- if (lp_parm_bool(-1,"winsdb", "nosync", False)) {
+ if (lp_parm_bool(NULL,"winsdb", "nosync", false)) {
flags |= LDB_FLG_NOSYNC;
}
@@ -1031,7 +1031,7 @@ struct winsdb_handle *winsdb_connect(TALLOC_CTX *mem_ctx, enum winsdb_handle_cal
h->caller = caller;
- owner = lp_parm_string(-1, "winsdb", "local_owner");
+ owner = lp_parm_string(NULL, "winsdb", "local_owner");
if (!owner) {
owner = iface_n_ip(0);
}
diff --git a/source4/nbt_server/wins/winsserver.c b/source4/nbt_server/wins/winsserver.c
index 47d2540386..fd0188cbf0 100644
--- a/source4/nbt_server/wins/winsserver.c
+++ b/source4/nbt_server/wins/winsserver.c
@@ -615,7 +615,7 @@ static void nbtd_wins_randomize1Clist(const char **addresses, struct socket_addr
ldb_qsort(addresses, num_addrs , sizeof(addresses[0]),
src, (ldb_qsort_cmp_fn_t)nbtd_wins_randomize1Clist_sort);
- mask = lp_parm_string(-1, "nbtd", "wins_randomize1Clist_mask");
+ mask = lp_parm_string(NULL, "nbtd", "wins_randomize1Clist_mask");
if (!mask) {
mask = "255.255.255.0";
}
@@ -691,7 +691,8 @@ static void nbtd_winsserver_query(struct nbt_name_socket *nbtsock,
* Typ: Daten REG_DWORD
* Value: 0 = deactivated, 1 = activated
*/
- if (name->type == NBT_NAME_LOGON && lp_parm_bool(-1, "nbtd", "wins_prepend1Bto1Cqueries", True)) {
+ if (name->type == NBT_NAME_LOGON &&
+ lp_parm_bool(NULL, "nbtd", "wins_prepend1Bto1Cqueries", true)) {
struct nbt_name name_1b;
name_1b = *name;
@@ -786,7 +787,8 @@ static void nbtd_winsserver_query(struct nbt_name_socket *nbtsock,
* Typ: Daten REG_DWORD
* Value: 0 = deactivated, 1 = activated
*/
- if (name->type == NBT_NAME_LOGON && lp_parm_bool(-1, "nbtd", "wins_randomize1Clist", False)) {
+ if (name->type == NBT_NAME_LOGON &&
+ lp_parm_bool(NULL, "nbtd", "wins_randomize1Clist", false)) {
nbtd_wins_randomize1Clist(addresses, src);
}
@@ -965,9 +967,9 @@ NTSTATUS nbtd_winsserver_init(struct nbtd_server *nbtsrv)
nbtsrv->winssrv->config.max_renew_interval = lp_max_wins_ttl();
nbtsrv->winssrv->config.min_renew_interval = lp_min_wins_ttl();
- tmp = lp_parm_int(-1,"wreplsrv","tombstone_interval", 6*24*60*60);
+ tmp = lp_parm_int(NULL, "wreplsrv", "tombstone_interval", 6*24*60*60);
nbtsrv->winssrv->config.tombstone_interval = tmp;
- tmp = lp_parm_int(-1,"wreplsrv","tombstone_timeout", 1*24*60*60);
+ tmp = lp_parm_int(NULL, "wreplsrv"," tombstone_timeout", 1*24*60*60);
nbtsrv->winssrv->config.tombstone_timeout = tmp;
nbtsrv->winssrv->wins_db = winsdb_connect(nbtsrv->winssrv, WINSDB_HANDLE_CALLER_NBTD);