Get multicast addresses from interface

Bruce M Simpson bms at spc.org
Thu Oct 14 11:55:14 PDT 2004


On Thu, Oct 14, 2004 at 08:01:49AM -0700, Brooks Davis wrote:
> On Thu, Oct 14, 2004 at 05:44:57PM +0400, Grigory Klyuchnikov wrote:
> > How can a user process get IPv6 multicast addresses of ethernet
> > interfaces? I have FreeBSD 5.2.1 and get interface addresses
> > via ioctl(SIOCGIFCONF) or sysctl(witch NET_RT_IFLIST),
> > but all returned addresses are unicast.
> 
> getifaddrs(3) and getifmaddrs(3) may do what you want.

See http://people.freebsd.org/~bms/dump/mcastlist/ for the original
code (harti@ submitted most of the kernel bits).

I didn't specifically set out to test getifmaddrs(3) with AF_INET6
addresses when I wrote it, but I seem to recall that it should work
with them, from testing.

If not, please feel free to submit a PR with a patch.

Thanks,
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/20041014/f6afee68/attachment.bin


More information about the freebsd-net mailing list