svn commit: r354639 - head/usr.bin/netstat

Bjoern A. Zeeb bz at FreeBSD.org
Tue Nov 12 13:57:18 UTC 2019


Author: bz
Date: Tue Nov 12 13:57:17 2019
New Revision: 354639
URL: https://svnweb.freebsd.org/changeset/base/354639

Log:
  netstat: igmp stats, error on unexpected information, not only warn
  
  The igmp stats tend to print two lines of warning for an unexpected
  version and length.  Despite an invalid version and struct size it
  continues to try to do something with the data.  Do not try to parse
  the remainder of the struct and error on warning.
  
  Note the underlying issue of the data not being available properly
  is still there and needs to be fixed seperately.
  
  Reported by:	test cases, lwhsu
  MFC after:	3 weeks

Modified:
  head/usr.bin/netstat/inet.c

Modified: head/usr.bin/netstat/inet.c
==============================================================================
--- head/usr.bin/netstat/inet.c	Tue Nov 12 11:00:01 2019	(r354638)
+++ head/usr.bin/netstat/inet.c	Tue Nov 12 13:57:17 2019	(r354639)
@@ -1230,10 +1230,12 @@ igmp_stats(u_long off, const char *name, int af1 __unu
 	if (igmpstat.igps_version != IGPS_VERSION_3) {
 		xo_warnx("%s: version mismatch (%d != %d)", __func__,
 		    igmpstat.igps_version, IGPS_VERSION_3);
+		return;
 	}
 	if (igmpstat.igps_len != IGPS_VERSION3_LEN) {
 		xo_warnx("%s: size mismatch (%d != %d)", __func__,
 		    igmpstat.igps_len, IGPS_VERSION3_LEN);
+		return;
 	}
 
 	xo_open_container(name);


More information about the svn-src-head mailing list