Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Nov 2003 19:14:54 +0000
From:      Bruce M Simpson <bms@spc.org>
To:        Robert Watson <rwatson@freebsd.org>
Cc:        freebsd-net@freebsd.org
Subject:   Re: Viewing multicast group membership?
Message-ID:  <20031110191454.GC662@saboteur.dek.spc.org>
In-Reply-To: <Pine.NEB.3.96L.1031110131422.59199A-100000@fledge.watson.org>
References:  <20031110073822.GA20611@saboteur.dek.spc.org> <Pine.NEB.3.96L.1031110131422.59199A-100000@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--tKW2IUtsqtDRztdT
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

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

--tKW2IUtsqtDRztdT
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Comment: ''

iD8DBQE/r+OtueUpAYYNtTsRAtVmAJ47SuDA9kUxnPSIYiPWY5RRPV+dHgCgrRJA
uYDx/jIVpXksVWceB5DjvPc=
=7AAL
-----END PGP SIGNATURE-----

--tKW2IUtsqtDRztdT--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031110191454.GC662>