[prev in list] [next in list] [prev in thread] [next in thread]
List: freebsd-hackers
Subject: Re: Testing SIOCADDMULTI?
From: John Baldwin <jhb () freebsd ! org>
Date: 2013-01-28 16:09:24
Message-ID: 201301281109.24879.jhb () freebsd ! org
[Download RAW message or body]
On Sunday, January 27, 2013 1:51:12 am Tim Kientzle wrote:
>
> On Jan 26, 2013, at 3:56 PM, Tim Kientzle wrote:
>
> > My next TODO items for this network driver is to implement
> > the SIOCADDMULTI and SIOCDELMULTI ioctls.
>
> Looking through other drivers (and net/if.c), I've
> managed to implement ADDMULTI by adding
> the multicast ethernet address to the list maintained
> by the controller.
>
> DELMULTI seems trickier. Since if.c does not pass
> the specific address being removed down to the
> driver, it looks like I have no choice but to remove
> every multicast address from the controller and then
> re-insert all of the ones that are still valid.
>
> (This controller doesn't use a hash filter; it uses
> a list of valid multicast addresses.)
>
> Is there a better approach?
You should always reprogram the full table while holding if_maddr_rlock().
All the ioctl's tell you is that an entry was added or removed from that
list. There is currently no race-free way for the stack to tell you which
specific address to add or remove.
> > I'm not quite sure what they do, though, and have
> > no idea how to test them to see if they are working
> > correctly.
>
> Would still appreciate any suggestions for how to test these.
You can write a simple app to listen for UDP packets and have it join a
multicast group and have another machine on the same network write a packet to
the multicast group.
However, a simpler test is to toggle the sysctl to enable multicast ping
replies and to ping a multicast address from another machine after joining it
on the test machine using mtest.
--
John Baldwin
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic