Date: Fri, 6 Nov 2015 14:50:23 +0000 (UTC) From: Hajimu UMEMOTO <ume@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290449 - head/usr.bin/netstat Message-ID: <201511061450.tA6EoNmG040122@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ume Date: Fri Nov 6 14:50:23 2015 New Revision: 290449 URL: https://svnweb.freebsd.org/changeset/base/290449 Log: Do not truncate addresses when printing in encoded format. Modified: head/usr.bin/netstat/if.c Modified: head/usr.bin/netstat/if.c ============================================================================== --- head/usr.bin/netstat/if.c Fri Nov 6 14:40:51 2015 (r290448) +++ head/usr.bin/netstat/if.c Fri Nov 6 14:50:23 2015 (r290449) @@ -324,6 +324,7 @@ intpr(void (*pfunc)(char *), int af) for (ifa = ifap; ifa; ifa = ifa->ifa_next) { bool network = false, link = false; char *name, *xname, buf[IFNAMSIZ+1]; + const char *nn, *rn; if (interface != NULL && strcmp(ifa->ifa_name, interface) != 0) continue; @@ -375,18 +376,18 @@ intpr(void (*pfunc)(char *), int af) #ifdef INET6 case AF_INET6: #endif /* INET6 */ + nn = netname(ifa->ifa_addr, ifa->ifa_netmask); + rn = routename(ifa->ifa_addr, numeric_addr); if (Wflag) { - xo_emit("{t:network/%-*s} ", net_len, - netname(ifa->ifa_addr, ifa->ifa_netmask)); - xo_emit("{t:address/%-*s} ", addr_len, - routename(ifa->ifa_addr, numeric_addr)); + xo_emit("{et:network/%s}{d:/%-*s} ", + nn, net_len, nn); + xo_emit("{et:address/%s}{d:/%-*s} ", + rn, addr_len, rn); } else { - xo_emit("{t:network/%-*.*s} ", - net_len, net_len, - netname(ifa->ifa_addr, ifa->ifa_netmask)); - xo_emit("{t:address/%-*.*s} ", - addr_len, addr_len, - routename(ifa->ifa_addr, numeric_addr)); + xo_emit("{et:network/%s}{d:/%-*.*s} ", + nn, net_len, net_len, nn); + xo_emit("{et:address/%s}{d:/%-*.*s} ", + rn, addr_len, addr_len, rn); } network = true;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511061450.tA6EoNmG040122>