svn commit: r279017 - head/usr.bin/netstat
Gleb Smirnoff
glebius at FreeBSD.org
Thu Feb 19 19:36:55 UTC 2015
Author: glebius
Date: Thu Feb 19 19:36:54 2015
New Revision: 279017
URL: https://svnweb.freebsd.org/changeset/base/279017
Log:
Burn bridges to FreeBSD 7.x IGMP stats.
Modified:
head/usr.bin/netstat/inet.c
Modified: head/usr.bin/netstat/inet.c
==============================================================================
--- head/usr.bin/netstat/inet.c Thu Feb 19 18:56:39 2015 (r279016)
+++ head/usr.bin/netstat/inet.c Thu Feb 19 19:36:54 2015 (r279017)
@@ -1093,47 +1093,6 @@ icmp_stats(u_long off, const char *name,
}
}
-#ifndef BURN_BRIDGES
-/*
- * Dump IGMP statistics structure (pre 8.x kernel).
- */
-static void
-igmp_stats_live_old(const char *name)
-{
- struct oigmpstat oigmpstat, zerostat;
- size_t len = sizeof(oigmpstat);
-
- if (zflag)
- memset(&zerostat, 0, len);
- if (sysctlbyname("net.inet.igmp.stats", &oigmpstat, &len,
- zflag ? &zerostat : NULL, zflag ? len : 0) < 0) {
- warn("sysctl: net.inet.igmp.stats");
- return;
- }
-
- printf("%s:\n", name);
-
-#define p(f, m) if (oigmpstat.f || sflag <= 1) \
- printf(m, oigmpstat.f, plural(oigmpstat.f))
-#define py(f, m) if (oigmpstat.f || sflag <= 1) \
- printf(m, oigmpstat.f, oigmpstat.f != 1 ? "ies" : "y")
- p(igps_rcv_total, "\t%u message%s received\n");
- p(igps_rcv_tooshort, "\t%u message%s received with too few bytes\n");
- p(igps_rcv_badsum, "\t%u message%s received with bad checksum\n");
- py(igps_rcv_queries, "\t%u membership quer%s received\n");
- py(igps_rcv_badqueries,
- "\t%u membership quer%s received with invalid field(s)\n");
- p(igps_rcv_reports, "\t%u membership report%s received\n");
- p(igps_rcv_badreports,
- "\t%u membership report%s received with invalid field(s)\n");
- p(igps_rcv_ourreports,
-"\t%u membership report%s received for groups to which we belong\n");
- p(igps_snd_reports, "\t%u membership report%s sent\n");
-#undef p
-#undef py
-}
-#endif /* !BURN_BRIDGES */
-
/*
* Dump IGMP statistics structure.
*/
@@ -1143,27 +1102,6 @@ igmp_stats(u_long off, const char *name,
struct igmpstat igmpstat, zerostat;
size_t len;
-#ifndef BURN_BRIDGES
- if (live) {
- /*
- * Detect if we are being run against a pre-IGMPv3 kernel.
- * We cannot do this for a core file as the legacy
- * struct igmpstat has no size field, nor does it
- * export it in any readily-available symbols.
- */
- len = 0;
- if (sysctlbyname("net.inet.igmp.stats", NULL, &len, NULL,
- 0) < 0) {
- warn("sysctl: net.inet.igmp.stats");
- return;
- }
- if (len < sizeof(igmpstat)) {
- igmp_stats_live_old(name);
- return;
- }
- }
-#endif /* !BURN_BRIDGES */
-
len = sizeof(igmpstat);
if (live) {
if (zflag)
More information about the svn-src-head
mailing list