diff options
author | hrs <hrs@FreeBSD.org> | 2013-01-03 22:27:57 +0000 |
---|---|---|
committer | hrs <hrs@FreeBSD.org> | 2013-01-03 22:27:57 +0000 |
commit | 138a713204eb7a4956fcf6b797f0750099015ac3 (patch) | |
tree | dcd770886339c8c8a52c80297d5f2b1c7da755ca /usr.sbin/ifmcstat | |
parent | d35d00318611405595606c99dddda9d64626a380 (diff) | |
download | FreeBSD-src-138a713204eb7a4956fcf6b797f0750099015ac3.zip FreeBSD-src-138a713204eb7a4956fcf6b797f0750099015ac3.tar.gz |
- Print scopeid for link-local scope addresses.
- Do not print the flags= part when flags == 0.
Diffstat (limited to 'usr.sbin/ifmcstat')
-rw-r--r-- | usr.sbin/ifmcstat/ifmcstat.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/usr.sbin/ifmcstat/ifmcstat.c b/usr.sbin/ifmcstat/ifmcstat.c index 9f58680..599e850 100644 --- a/usr.sbin/ifmcstat/ifmcstat.c +++ b/usr.sbin/ifmcstat/ifmcstat.c @@ -296,7 +296,8 @@ in_ifinfo(struct igmp_ifinfo *igi) printf("igmpv?(%d)", igi->igi_version); break; } - printb(" flags", igi->igi_flags, "\020\1SILENT\2LOOPBACK"); + if (igi->igi_flags) + printb(" flags", igi->igi_flags, "\020\1SILENT\2LOOPBACK"); if (igi->igi_version == IGMP_VERSION_3) { printf(" rv %u qi %u qri %u uri %u", igi->igi_rv, igi->igi_qi, igi->igi_qri, igi->igi_uri); @@ -752,7 +753,8 @@ in6_ifinfo(struct mld_ifinfo *mli) printf("mldv?(%d)", mli->mli_version); break; } - printb(" flags", mli->mli_flags, "\020\1SILENT\2USEALLOW"); + if (mli->mli_flags) + printb(" flags", mli->mli_flags, "\020\1SILENT\2USEALLOW"); if (mli->mli_version == MLD_VERSION_2) { printf(" rv %u qi %u qri %u uri %u", mli->mli_rv, mli->mli_qi, mli->mli_qri, mli->mli_uri); @@ -1129,7 +1131,14 @@ ifmcstat_getifmaddrs(void) break; } - fprintf(stdout, "\t%s %s\n", pafname, addrbuf); + fprintf(stdout, "\t%s %s", pafname, addrbuf); +#ifdef INET6 + if (pifasa->sa.sa_family == AF_INET6 && + pifasa->sin6.sin6_scope_id) + fprintf(stdout, " scopeid 0x%x", + pifasa->sin6.sin6_scope_id); +#endif + fprintf(stdout, "\n"); #ifdef INET /* * Print per-link IGMP information, if available. @@ -1202,6 +1211,12 @@ next_ifnet: } fprintf(stdout, "\t\tgroup %s", addrbuf); +#ifdef INET6 + if (pgsa->sa.sa_family == AF_INET6 && + pgsa->sin6.sin6_scope_id) + fprintf(stdout, " scopeid 0x%x", + pgsa->sin6.sin6_scope_id); +#endif #ifdef INET if (pgsa->sa.sa_family == AF_INET) { inm_print_sources_sysctl(thisifindex, |