G'day all,
I am working on adding multicast / promiscuous mode support to the CDCEther
driver (USB Communication Device Class, Ethernet control model - and don't
blame me for the name...)
The question I have relates to how multicast and promiscuous stuff gets
enabled. Sorry about the newbie type nature, but I am mainly a USB coder.
Promiscuous mode first:
I take it that, to enable promiscuous mode, ifconfig (or equivalant) sets the
net_device.flags with IFF_PROMISC, and then calls
net_device.set_multicast_list. To disable, we clear IFF_PROMISC and then call
net_device.set_multicast_list.
Multicast mode:
If we want all the multicast addresses, ifconfig sets net->flags with
IFF_ALLMULTI and then calls net_device.set_multicast_list. Same to disable
receiving every multicast address.
If we just want some of the multicast addresses, we set IFF_MULTICAST, and get
the number of addresses as net_device.mc_count and the addresses as a linked
list as net_device.mc_list, and then a call to net_device.set_multicast_list.
No problems so far, I hope.
What is the interaction between promiscuous mode and multicast mode? If I set
promiscuous mode, is there any required changes to multicast mode (enabled or
disabled)?
What is the interaction between IFF_ALLMULTI and IFF_MULTICAST? If I set
specific addresses, should ALL_MULTI be disabled? If I set ALL_MULTI, should
the list of addresses be cleared?
If I have previously set a multicast list, and the user changes it with
ifconfig, will I get the whole list again, or just the changes? If just
changes, how do I know that I have to delete some?
If multicast is disabled (IFF_MULTICAST == 0), should I clear the multicast
list?
Brad
|