]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/net/virtio_net.c
net: convert unicast addr list
[net-next-2.6.git] / drivers / net / virtio_net.c
index 6cc5bcd34fb0ab329be4514790205bb50e900c02..0c9ca67f66e6db4e4ecb0480b5c9cbe5de8a332c 100644 (file)
@@ -680,6 +680,7 @@ static void virtnet_set_rx_mode(struct net_device *dev)
        u8 promisc, allmulti;
        struct virtio_net_ctrl_mac *mac_data;
        struct dev_addr_list *addr;
+       struct netdev_hw_addr *ha;
        void *buf;
        int i;
 
@@ -718,9 +719,9 @@ static void virtnet_set_rx_mode(struct net_device *dev)
 
        /* Store the unicast list and count in the front of the buffer */
        mac_data->entries = dev->uc_count;
-       addr = dev->uc_list;
-       for (i = 0; i < dev->uc_count; i++, addr = addr->next)
-               memcpy(&mac_data->macs[i][0], addr->da_addr, ETH_ALEN);
+       i = 0;
+       list_for_each_entry(ha, &dev->uc_list, list)
+               memcpy(&mac_data->macs[i++][0], ha->addr, ETH_ALEN);
 
        sg_set_buf(&sg[0], mac_data,
                   sizeof(mac_data->entries) + (dev->uc_count * ETH_ALEN));