Viewing multicast group membership?

Bruce M Simpson bms at spc.org
Mon Nov 10 11:14:58 PST 2003


On Mon, Nov 10, 2003 at 01:14:59PM -0500, Robert Watson wrote:
> I can't speak to existing code for this, but I can say I have a preference
> for having a sysctl version of the code available in the vague hopes that
> someday we can drop the setgid kmem bit from netstat...

During operation, the kernel routing socket will report multicast group
joins/leaves using RTM_NEWMADDR/RTM_DELADDR messages. These contain an
ifma_msghdr structure, which encapsulates multicast addresses in an address
family independent manner. However, there is no mechanism to report currently
existing associations.

Maybe the way to go is to extend getifaddrs(), or create a new API
a lot like it. Right now, it uses the NET_RT_IFLIST sysctl to retrieve
the interface list; the kernel appends RTM_NEWADDR messages to the
buffer contents returned by the sysctl to report each address family.
The function sysctl_iflist() in net/rtsock.c is responsible for this.

However, not all getifaddrs() consumers are likely to be interested in
multicast associations, so this could end up adding bloat. The getifaddrs()
libc function and sysctl_iflist() kernel code do not touch
ifnet->if_multiaddrs at all.

So my next question is: Do I create a new API function and sysctl, or
integrate into the existing code path?

BMS
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 167 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-net/attachments/20031110/98ace572/attachment.bin


More information about the freebsd-net mailing list