diff options
author | Volker Lendecke <vl@samba.org> | 2010-12-28 12:53:12 +0100 |
---|---|---|
committer | Volker Lendecke <vlendec@samba.org> | 2010-12-28 13:46:59 +0100 |
commit | 571711431885e8e556822c14b3d117025860bf81 (patch) | |
tree | 71b18d38cf64e5315e0895c58d1c5fa48fd49cf8 /source3/utils | |
parent | e1ab3c3470a7f1159d52ed0c1eacf4a5a7b6bc2b (diff) | |
download | samba-571711431885e8e556822c14b3d117025860bf81.tar.gz samba-571711431885e8e556822c14b3d117025860bf81.tar.bz2 samba-571711431885e8e556822c14b3d117025860bf81.zip |
s3: Make node_status_query return NTSTATUS
Also make the result talloc'ed
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Dec 28 13:46:59 CET 2010 on sn-devel-104
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/nmblookup.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/source3/utils/nmblookup.c b/source3/utils/nmblookup.c index e5cfe21806..5bbd06c994 100644 --- a/source3/utils/nmblookup.c +++ b/source3/utils/nmblookup.c @@ -113,33 +113,35 @@ static void do_node_status(int fd, { struct nmb_name nname; int count, i, j; - struct node_status *status; + struct node_status *addrs; struct node_status_extra extra; fstring cleanname; char addr[INET6_ADDRSTRLEN]; + NTSTATUS status; print_sockaddr(addr, sizeof(addr), pss); d_printf("Looking up status of %s\n",addr); make_nmb_name(&nname, name, type); - status = node_status_query(fd, &nname, pss, &count, &extra); - if (status) { + status = node_status_query(fd, &nname, pss, talloc_tos(), + &addrs, &count, &extra); + if (NT_STATUS_IS_OK(status)) { for (i=0;i<count;i++) { - pull_ascii_fstring(cleanname, status[i].name); + pull_ascii_fstring(cleanname, addrs[i].name); for (j=0;cleanname[j];j++) { if (!isprint((int)cleanname[j])) { cleanname[j] = '.'; } } d_printf("\t%-15s <%02x> - %s\n", - cleanname,status[i].type, - node_status_flags(status[i].flags)); + cleanname,addrs[i].type, + node_status_flags(addrs[i].flags)); } d_printf("\n\tMAC Address = %02X-%02X-%02X-%02X-%02X-%02X\n", extra.mac_addr[0], extra.mac_addr[1], extra.mac_addr[2], extra.mac_addr[3], extra.mac_addr[4], extra.mac_addr[5]); d_printf("\n"); - SAFE_FREE(status); + TALLOC_FREE(addrs); } else { d_printf("No reply from %s\n\n",addr); } |