diff options
Diffstat (limited to 'drivers/net/82596.c')
-rw-r--r-- | drivers/net/82596.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/82596.c b/drivers/net/82596.c index 638ce3b29854..f94d17d78bb0 100644 --- a/drivers/net/82596.c +++ b/drivers/net/82596.c @@ -1550,13 +1550,16 @@ static void set_multicast_list(struct net_device *dev) return; cmd = &lp->mc_cmd; cmd->cmd.command = CmdMulticastList; - cmd->mc_cnt = netdev_mc_count(dev) * 6; + cmd->mc_cnt = cnt * ETH_ALEN; cp = cmd->mc_addrs; - for (dmi = dev->mc_list; cnt && dmi != NULL; dmi = dmi->next, cnt--, cp += 6) { - memcpy(cp, dmi->dmi_addr, 6); + netdev_for_each_mc_addr(dmi, dev) { + if (!cnt--) + break; + memcpy(cp, dmi->dmi_addr, ETH_ALEN); if (i596_debug > 1) DEB(DEB_MULTI,printk(KERN_INFO "%s: Adding address %pM\n", dev->name, cp)); + cp += ETH_ALEN; } i596_add_cmd(dev, &cmd->cmd); } |