From: Joseph C. Lehner Date: Sun, 7 Feb 2016 20:06:09 +0000 (+0100) Subject: Prettify -L output X-Git-Tag: v0.9~30 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=6da9b2b160f14e6e2fe0ddd5e6f66e319cbd981b;p=oweals%2Fnmrpflash.git Prettify -L output --- diff --git a/ethsock.c b/ethsock.c index e2a6c95..caadf4c 100644 --- a/ethsock.c +++ b/ethsock.c @@ -446,8 +446,8 @@ int ethsock_list_all(void) memset(hwaddr, 0, 6); for (dev = devs; dev; dev = dev->next) { - if (!is_ethernet(dev->name)) { - if (verbosity > 1) { + if (!is_ethernet(dev->name) || dev->flags & PCAP_IF_LOOPBACK) { + if (verbosity) { printf("%s (not an ethernet device)\n", dev->name); } @@ -455,7 +455,7 @@ int ethsock_list_all(void) } if (!get_hwaddr(hwaddr, dev->name)) { - if (verbosity > 1) { + if (verbosity) { printf("%s (failed to get hardware address)\n", dev->name); } @@ -463,7 +463,7 @@ int ethsock_list_all(void) } #ifndef NMRPFLASH_WINDOWS - printf("%s", dev->name); + printf("%-15s", dev->name); #else /* Call this here so *_perror() calls don't happen within a line */ pretty = intf_get_pretty_name(dev->name); @@ -477,14 +477,14 @@ int ethsock_list_all(void) for (addr = dev->addresses; addr; addr = addr->next) { if (addr->addr->sa_family == AF_INET) { - printf(" %15s", + printf(" %-15s", inet_ntoa(((struct sockaddr_in*)addr->addr)->sin_addr)); break; } } if (!addr) { - printf(" "); + printf(" %-15s", "0.0.0.0"); } printf(" %02x:%02x:%02x:%02x:%02x:%02x", hwaddr[0], hwaddr[1],