r2706: The code that prints the remote MAC address (from the statistics section
authorChristopher R. Hertel <crh@samba.org>
Tue, 28 Sep 2004 02:13:53 +0000 (02:13 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:52:49 +0000 (10:52 -0500)
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 -)-----
(This used to be commit 2a5d66791fa5e1b19e0ec9072af254142245d0c2)

source3/utils/nmblookup.c

index 7285712c0b7b7e63a0953c11f15eb19490f83108..4ed42847867eec7dc1558223eabdcf7a234d8e9b 100644 (file)
@@ -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");
 }