Overview: When netstat clears the socket stats it causes the igmp version to be cleared also. This causes the display of the igmp stats to display an error. Steps to Reproduce: # netstat -sz # netstat -sp igmp Actual Results: After running netstat with "-sz" any subsequent display of the igmp protocol will result in the following error messages being displayed netstat: igmp_stats: version mismatch (0 != 3) Expected Results: No error message after clearing stats Build Date & Hardware: 12.0 FreeBSD FreeBSD_12.0_ghuckriede 12.0-RELEASE-p3 FreeBSD 12.0-RELEASE-p3 GENERIC amd64 HEAD uname -a FreeBSD FreeBSD_head_ghuckriede 13.0-CURRENT FreeBSD 13.0-CURRENT #2 r358592: Tue Mar 3 15:38:05 EST 2020 ghuckriede@FreeBSD_head_ghuckriede:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64 Additional Information: Using a debugger shows that the entire igmpstat structure is getting cleared after the netstat -sz command. The define for igmpstat is here https://svnweb.freebsd.org/base/head/sys/netinet/igmp.c?revision=358013&view=markup&pathrev=358013#l234
Take.
A commit references this bug: Author: hrs Date: Sat Mar 7 08:41:11 UTC 2020 New revision: 358730 URL: https://svnweb.freebsd.org/changeset/base/358730 Log: Fix an issue of net.inet.igmp.stats handler. The header of (struct igmpstat) could be cleared by sysctl(3). This can be reproduced by "netstat -s -z -p igmp". PR: 244584 MFC after: 1 week Changes: head/sys/netinet/igmp.c head/usr.bin/netstat/inet.c
Was committed prior to stable/13 branch, not merged to stable/12. hrs@ should we merge it there too?