Testing SIOCADDMULTI?
Tim Kientzle
tim at kientzle.com
Fri Feb 1 06:23:35 UTC 2013
On Jan 28, 2013, at 8:09 AM, John Baldwin wrote:
> 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.
>>
>> DELMULTI seems trickier. ...
>> ... 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.
>> ...
>> Is there a better approach?
>
> You should always reprogram the full table while holding if_maddr_rlock().
Thanks. That's ultimately what I did. I was able to dump
the table from the controller to eyeball that the entries looked
right but haven't yet done any testing beyond that.
>> 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.
I tried this first, but the test program worked fine even
without ADDMULTI/DELMULTI support. Watching
tcpdump -e, it appears that IP4 multicast UDP uses
broadcast at the Ethernet layer.
> 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 mutest.
Ahhh…. I wasn't aware of these tools; I'll take a look.
Thanks for the pointer!
Tim
More information about the freebsd-hackers
mailing list