Commit 667d4100 authored by David Kilroy's avatar David Kilroy Committed by John W. Linville

orinoco: Multicast to the specified addresses

When multicasting the driver sets the number of group addresses using
the count from the previous set multicast command. In general this means
you have to set the multicast addresses twice to get the behaviour you
want.

If we were multicasting, and reduce the number of addresses we are
multicasting to, then the driver would write uninitialised data from the
stack into the group addresses to multicast to.

Only write the multicast addresses we have specifically set.
Signed-off-by: default avatarDavid Kilroy <kilroyd@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent f0b9f5cb
...@@ -1970,6 +1970,9 @@ __orinoco_set_multicast_list(struct net_device *dev) ...@@ -1970,6 +1970,9 @@ __orinoco_set_multicast_list(struct net_device *dev)
priv->promiscuous = promisc; priv->promiscuous = promisc;
} }
/* If we're not in promiscuous mode, then we need to set the
* group address if either we want to multicast, or if we were
* multicasting and want to stop */
if (! promisc && (mc_count || priv->mc_count) ) { if (! promisc && (mc_count || priv->mc_count) ) {
struct dev_mc_list *p = dev->mc_list; struct dev_mc_list *p = dev->mc_list;
struct hermes_multicast mclist; struct hermes_multicast mclist;
...@@ -1989,9 +1992,10 @@ __orinoco_set_multicast_list(struct net_device *dev) ...@@ -1989,9 +1992,10 @@ __orinoco_set_multicast_list(struct net_device *dev)
printk(KERN_WARNING "%s: Multicast list is " printk(KERN_WARNING "%s: Multicast list is "
"longer than mc_count\n", dev->name); "longer than mc_count\n", dev->name);
err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFGROUPADDRESSES, err = hermes_write_ltv(hw, USER_BAP,
HERMES_BYTES_TO_RECLEN(priv->mc_count * ETH_ALEN), HERMES_RID_CNFGROUPADDRESSES,
&mclist); HERMES_BYTES_TO_RECLEN(mc_count * ETH_ALEN),
&mclist);
if (err) if (err)
printk(KERN_ERR "%s: Error %d setting multicast list.\n", printk(KERN_ERR "%s: Error %d setting multicast list.\n",
dev->name, err); dev->name, err);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment