RTM_GETMULTICAST reports IPv4 and IPv6 multicast group membership, but does not include the per-group user count. Userspace therefore still has to parse /proc/net/igmp and /proc/net/igmp6 to obtain the Users column. In particular, this prevents iproute2 from moving "ip maddr show" entirely from procfs to rtnetlink.
Add IFA_MC_USERS to carry the user count in RTM_GETMULTICAST dumps and RTM_NEWMULTICAST / RTM_DELMULTICAST notifications for both address families. Update the rt-addr YNL specification and extend the rtnetlink selftest to verify that two joins increase the reported count by two. Yuyang Huang (3): net: ipv4: report multicast group user count net: ipv6: report multicast group user count selftests: net: check multicast group user count Documentation/netlink/specs/rt-addr.yaml | 4 + include/uapi/linux/if_addr.h | 1 + net/ipv4/igmp.c | 2 + net/ipv6/addrconf.c | 1 + net/ipv6/mcast.c | 1 + tools/testing/selftests/net/rtnetlink.py | 101 ++++++++++++++++++++--- 6 files changed, 99 insertions(+), 11 deletions(-) -- 2.43.0

