[Xorp-cvs] XORP cvs commit: xorp/fea/data_plane/io
Pavlin Radoslavov
pavlin at icir.org
Thu Oct 18 18:12:28 PDT 2007
CVSROOT: /usr/local/share/doc/apache/cvs
Module name: xorp
Changes by: pavlin at xorpc.icir.org 2007-10-19 01:12:28 UTC
XORP CVS repository
Modified files:
fea/data_plane/io io_link_pcap.cc io_link_pcap.hh
Log message:
Fix the mechanism for joining L2 MAC addresses:
* We need to use a regular socket "socket(AF_INET, SOCK_DGRAM, 0)"
for the ioctl(SIOCADDMULTI) and ioctl(SIOCDELMULTI) system calls
instead of the pcap(3) derived file descriptor.
* On FreeBSD and DragonFlyBSD the MAC address needs to be setup
inside sockaddr_dl aligned address storage in a special way
that is different from NetBSD and OpenBSD (and Linux).
Note that as of FreeBSD-6.2, the FreeBSD kernel has some bugs
when it comes to using ioctl(SIOCADDMULTI) and ioctl(SIOCDELMULTI)
to manipulate directly the L2 multicast membership on interface.
In particular, the kernel doesn't deal with duplicate joins, the
leave requests fail, and "netstat -ian" fails to print the joined
groups. See the following email thread for details:
http://lists.freebsd.org/pipermail/freebsd-net/2007-February/013120.html
However, those problems have been fixed (by Bruce M. Simpson) in the
FreeBSD CVS repository. The RELENG_6 fixes are:
src/usr.bin/netstat/mcast.c,v 1.2.8.1 2007/03/14 14:10:22 bms
src/sys/net/if.c,v 1.234.2.18 2007/03/08 13:15:27 bms
After the fix, "netstat -gn" will print the L2 joined groups as well.
Those fixes are in FreeBSD-current as well so they should appear
in the next FreeBSD release.
It appears that DragonFlyBSD (as of DragonFlyBSD-1.8) has similar
problems, but there is no indication it has been fixed even in the
most recent DragonFly-1.10.1 release.
For the record, the ioctl(SIOCADDMULTI) and ioctl(SIOCDELMULTI)
mechanism seems to work fine on NetBSD-3.1 and OpenBSD-4.1.
However, on NetBSD the ifmcstat(8) program needs to be used
to print the L2 membership ("netstat -ian" or "netstat -gn" don't
print it).
It appears that OpenBSD doesn't have ifmcstat(8), and "netstat"
doesn't print that info, so it is unclear what OS tool can be used
for that purpose.
Apparently, the NetBSD source code for ifmcstat(8) from NetBSD can
be compiled as-is on OpenBSD and it actually works.
Revision Changes Path
1.8 +56 -10; commitid: 1498a4717fbee7ea6; xorp/fea/data_plane/io/io_link_pcap.cc
1.5 +2 -1; commitid: 1498a4717fbee7ea6; xorp/fea/data_plane/io/io_link_pcap.hh
More information about the Xorp-cvs
mailing list