Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Jan 2020 16:54:44 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r356453 - stable/12/usr.bin/netstat
Message-ID:  <202001071654.007Gsing086495@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bz
Date: Tue Jan  7 16:54:43 2020
New Revision: 356453
URL: https://svnweb.freebsd.org/changeset/base/356453

Log:
  MFC r354639:
  
    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

Modified:
  stable/12/usr.bin/netstat/inet.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.bin/netstat/inet.c
==============================================================================
--- stable/12/usr.bin/netstat/inet.c	Tue Jan  7 16:53:51 2020	(r356452)
+++ stable/12/usr.bin/netstat/inet.c	Tue Jan  7 16:54:43 2020	(r356453)
@@ -1229,10 +1229,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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202001071654.007Gsing086495>