From 9b9c23b19be5a90821e1075a76f8b94fdb2424e2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 1 Feb 2005 04:12:44 +0000 Subject: r5155: define ipv4address as a based IDL type, mapped to a "const char *" in the header, and defined on the wire as a 4 byte network byte order IP. This means the calling code doesn't have to worry about network byte order conversions. (This used to be commit 72048e37179dd5b9ada0c5280d2f0d8c23d1a17d) --- source4/libcli/nbt/namequery.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'source4/libcli/nbt/namequery.c') diff --git a/source4/libcli/nbt/namequery.c b/source4/libcli/nbt/namequery.c index d77482fc2b..072b1e459a 100644 --- a/source4/libcli/nbt/namequery.c +++ b/source4/libcli/nbt/namequery.c @@ -72,8 +72,6 @@ NTSTATUS nbt_name_query_recv(struct nbt_name_request *req, { NTSTATUS status; struct nbt_name_packet *packet; - const char *addr; - struct in_addr in; int i; status = nbt_name_request_recv(req); @@ -102,13 +100,8 @@ NTSTATUS nbt_name_query_recv(struct nbt_name_request *req, } for (i=0;iout.num_addrs;i++) { - in.s_addr = htonl(packet->answers[0].rdata.netbios.addresses[i].ipaddr.addr); - addr = inet_ntoa(in); - if (addr == NULL) { - talloc_free(req); - return NT_STATUS_NO_MEMORY; - } - io->out.reply_addrs[i] = talloc_strdup(mem_ctx, addr); + io->out.reply_addrs[i] = talloc_steal(mem_ctx, + packet->answers[0].rdata.netbios.addresses[i].ipaddr); } talloc_steal(mem_ctx, io->out.name.name); -- cgit