aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2019-11-12 13:57:17 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2019-11-12 13:57:17 +0000
commit4df8c94283e0981885af288035c1eab720a8476a (patch)
tree57f6b64784a916f725b27b9ba660129fa3ad65e6 /usr.bin
parent78f18516132e0a5f17b9a440f3fd2fa507f894c5 (diff)
downloadsrc-4df8c94283e0981885af288035c1eab720a8476a.tar.gz
src-4df8c94283e0981885af288035c1eab720a8476a.zip
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
Notes
Notes: svn path=/head/; revision=354639
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/netstat/inet.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c
index 7adf3215e16d..6712cd66e578 100644
--- a/usr.bin/netstat/inet.c
+++ b/usr.bin/netstat/inet.c
@@ -1230,10 +1230,12 @@ igmp_stats(u_long off, const char *name, int af1 __unused, int proto __unused)
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);