diff options
Diffstat (limited to 'drivers/net/virtio_net.c')
-rw-r--r-- | drivers/net/virtio_net.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 6cc5bcd34fb0..0c9ca67f66e6 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -680,6 +680,7 @@ static void virtnet_set_rx_mode(struct net_device *dev) | |||
680 | u8 promisc, allmulti; | 680 | u8 promisc, allmulti; |
681 | struct virtio_net_ctrl_mac *mac_data; | 681 | struct virtio_net_ctrl_mac *mac_data; |
682 | struct dev_addr_list *addr; | 682 | struct dev_addr_list *addr; |
683 | struct netdev_hw_addr *ha; | ||
683 | void *buf; | 684 | void *buf; |
684 | int i; | 685 | int i; |
685 | 686 | ||
@@ -718,9 +719,9 @@ static void virtnet_set_rx_mode(struct net_device *dev) | |||
718 | 719 | ||
719 | /* Store the unicast list and count in the front of the buffer */ | 720 | /* Store the unicast list and count in the front of the buffer */ |
720 | mac_data->entries = dev->uc_count; | 721 | mac_data->entries = dev->uc_count; |
721 | addr = dev->uc_list; | 722 | i = 0; |
722 | for (i = 0; i < dev->uc_count; i++, addr = addr->next) | 723 | list_for_each_entry(ha, &dev->uc_list, list) |
723 | memcpy(&mac_data->macs[i][0], addr->da_addr, ETH_ALEN); | 724 | memcpy(&mac_data->macs[i++][0], ha->addr, ETH_ALEN); |
724 | 725 | ||
725 | sg_set_buf(&sg[0], mac_data, | 726 | sg_set_buf(&sg[0], mac_data, |
726 | sizeof(mac_data->entries) + (dev->uc_count * ETH_ALEN)); | 727 | sizeof(mac_data->entries) + (dev->uc_count * ETH_ALEN)); |