namerec->data.refresh_time = (time_t)refresh_time;
namerec->data.id = id_low;
#if defined(HAVE_LONGLONG)
- namerec->data.id |= ((SMB_BIG_UINT)id_high << 32);
+ namerec->data.id |= ((uint64_t)id_high << 32);
#endif
namerec->data.wins_ip.s_addr = saddr;
namerec->data.wins_flags = wins_flags,
Return the general ID value and increase it if requested.
*****************************************************************************/
-static void get_global_id_and_update(SMB_BIG_UINT *current_id, bool update)
+static void get_global_id_and_update(uint64_t *current_id, bool update)
{
/*
* it's kept as a static here, to prevent people from messing
* with the value directly
*/
- static SMB_BIG_UINT general_id = 1;
+ static uint64_t general_id = 1;
DEBUG(5,("get_global_id_and_update: updating version ID: %d\n", (int)general_id));
}
/* Open the wins.tdb. */
- wins_tdb = tdb_open_log(lock_path("wins.tdb"), 0, TDB_DEFAULT|TDB_CLEAR_IF_FIRST, O_CREAT|O_RDWR, 0600);
+ wins_tdb = tdb_open_log(state_path("wins.tdb"), 0, TDB_DEFAULT|TDB_CLEAR_IF_FIRST, O_CREAT|O_RDWR, 0600);
if (!wins_tdb) {
DEBUG(0,("initialise_wins: failed to open wins.tdb. Error was %s\n",
strerror(errno) ));
next_token_talloc(frame,&ptr,&ttl_str,NULL);
for(i = 0; i < num_ips; i++) {
next_token_talloc(frame,&ptr, &ip_str, NULL);
- (void)interpret_addr2(&ip_list[i], ip_str);
+ ip_list[i] = interpret_addr2(ip_str);
}
next_token_talloc(frame,&ptr,&nb_flags_str,NULL);
struct in_addr from_ip;
struct in_addr our_fake_ip;
- (void)interpret_addr2(&our_fake_ip, "0.0.0.0");
+ our_fake_ip = interpret_addr2("0.0.0.0");
putip( (char *)&from_ip, &nmb->additional->rdata[2] );
if(bcast) {
DEBUG(3,("wins_register_query_success: Original client at IP %s still wants the \
name %s. Rejecting registration request.\n", inet_ntoa(ip), nmb_namestr(question_name) ));
- send_wins_name_registration_response(RFS_ERR, 0, orig_reg_packet);
+ send_wins_name_registration_response(ACT_ERR, 0, orig_reg_packet);
orig_reg_packet->locked = False;
free_packet(orig_reg_packet);
bool registering_group_name = (nb_flags & NB_GROUP) ? True : False;
struct in_addr our_fake_ip;
- (void)interpret_addr2(&our_fake_ip, "0.0.0.0");
+ our_fake_ip = interpret_addr2("0.0.0.0");
putip((char *)&from_ip,&nmb->additional->rdata[2]);
if(bcast) {
*/
if(registering_group_name && (question->name_type != 0x1c)) {
- (void)interpret_addr2(&from_ip, "255.255.255.255");
+ from_ip = interpret_addr2("255.255.255.255");
}
/*
int ttl;
struct in_addr our_fake_ip;
- (void)interpret_addr2(&our_fake_ip, "0.0.0.0");
+ our_fake_ip = interpret_addr2("0.0.0.0");
memcpy((char *)&orig_reg_packet, userdata->data, sizeof(struct packet_struct *));
nmb = &orig_reg_packet->packet.nmb;
struct in_addr our_fake_ip;
unstring qname;
- (void)interpret_addr2(&our_fake_ip, "0.0.0.0");
+ our_fake_ip = interpret_addr2("0.0.0.0");
putip((char *)&from_ip,&nmb->additional->rdata[2]);
if(bcast) {
struct name_record *namerec = NULL;
struct in_addr our_fake_ip;
- (void)interpret_addr2(&our_fake_ip, "0.0.0.0");
+ our_fake_ip = interpret_addr2("0.0.0.0");
if (kbuf.dsize != sizeof(unstring) + 1) {
return 0;
}
}
}
- if (asprintf(&fname, "%s/%s", get_dyn_STATEDIR(), WINS_LIST) < 0) {
+ if (!(fname = state_path(WINS_LIST))) {
goto err_exit;
}
/* This is safe as the 0 length means "don't expand". */
err_exit:
- SAFE_FREE(fname);
SAFE_FREE(fnamenew);
+ TALLOC_FREE(fname);
if (background) {
_exit(0);
struct in_addr our_fake_ip;
int i;
- (void)interpret_addr2(&our_fake_ip, "0.0.0.0");
+ our_fake_ip = interpret_addr2("0.0.0.0");
if (buf==NULL) {
return;
}