Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
const char *name,
int name_type,
struct sockaddr_storage **return_iplist,
- int *return_count);
+ size_t *return_count);
#endif /* __LIBNBT_H__ */
const char *name,
int name_type,
struct sockaddr_storage **return_iplist,
- int *return_count)
+ size_t *return_count)
{
/*
* "lmhosts" means parse the local lmhosts file.
break;
}
- if ((int)ret_count < 0) {
- TALLOC_FREE(ctx);
- endlmhosts(fp);
- return NT_STATUS_INVALID_PARAMETER;
- }
*return_count = ret_count;
*return_iplist = talloc_move(mem_ctx, &iplist);
TALLOC_FREE(ctx);
}
goto done;
} else if (strequal(tok, "lmhosts")) {
+ size_t lmcount = 0;
status = resolve_lmhosts_file_as_sockaddr(
talloc_tos(),
get_dyn_LMHOSTSFILE(),
name,
name_type,
&ss_list,
- &icount);
+ &lmcount);
if (!NT_STATUS_IS_OK(status)) {
continue;
}
+ /*
+ * This uglyness will go away once
+ * all resolve_XXX() return size_t *
+ * number of addresses.
+ */
+ icount = (int)lmcount;
goto done;
} else if (strequal(tok, "wins")) {
size_t wcount = 0;
struct composite_context *c;
struct resolve_lmhosts_state *state;
struct sockaddr_storage *resolved_iplist;
- int resolved_count, i;
+ size_t resolved_count = 0, i;
if (event_ctx == NULL) {
return NULL;