IPv4 multicast: fix netstat -g
authorMike Karels <karels@FreeBSD.org>
Mon, 21 Mar 2022 19:59:13 +0000 (14:59 -0500)
committerMike Karels <karels@FreeBSD.org>
Tue, 22 Mar 2022 12:38:01 +0000 (07:38 -0500)
commit04cd74b4cdb1203bc0fbfb85d8490a5b45eadf64
treeedd52ba35659402a8abe1dd910512c04012da7e2
parent2cf1e120c654df5d02b115dd8dc278dcfcb4a80d
IPv4 multicast: fix netstat -g

The vif structure includes fields at the end which are #ifdef KERNEL,
causing a mismatch between the structure sizes between kernel and
user level.  netstat -g failed with an ENOMEM on the sysctl to fetch
the vif table.  Change the vif sysctl code in ip_mroute to copy out
only the user-level-visible portion of each table entry.

Reviewed by: bz, wma
Differential Revision: https://reviews.freebsd.org/D34627
sys/netinet/ip_mroute.c
sys/netinet/ip_mroute.h