diff options
author | Christopher R. Hertel <crh@samba.org> | 2004-09-28 02:13:53 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:52:49 -0500 |
commit | 2a5d66791fa5e1b19e0ec9072af254142245d0c2 (patch) | |
tree | a88d3dc1e8c78f7bb9a38ae8da361ca8ce6ac91b | |
parent | ba69c7229c27e917a24e6d608d59e7c0bdd47551 (diff) | |
download | samba-2a5d66791fa5e1b19e0ec9072af254142245d0c2.tar.gz samba-2a5d66791fa5e1b19e0ec9072af254142245d0c2.tar.xz samba-2a5d66791fa5e1b19e0ec9072af254142245d0c2.zip |
r2706: The code that prints the remote MAC address (from the statistics section
of the response packet) was outside of the if() that determined whether
the query was successful or not. As a result, the MAC address would print
out even if there was no MAC address. At least the garbage it printed was
relatively consistent. :)
I moved the MAC printing into the if() block and added an 'else' to print
"No reply..." if the query fails.
Chris -)-----
-rw-r--r-- | source/utils/nmblookup.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source/utils/nmblookup.c b/source/utils/nmblookup.c index 7285712c0b7..4ed42847867 100644 --- a/source/utils/nmblookup.c +++ b/source/utils/nmblookup.c @@ -118,12 +118,15 @@ static void do_node_status(int fd, const char *name, int type, struct in_addr ip cleanname,status[i].type, node_status_flags(status[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); + } else { + d_printf("No reply from %s\n\n",inet_ntoa(ip)); } - 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"); } |