diff options
author | Jiri Pirko <jpirko@redhat.com> | 2012-06-29 01:10:06 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-30 04:08:00 -0400 |
commit | f2f2c8b42d5b1858e1680133fcd4bea5c8dcdb2c (patch) | |
tree | 277f7daa2ea17676e7749583f7a7513b54aa088a /drivers/net | |
parent | bb35f67195fcdbe79faa7a15ce148a67c9ab923d (diff) |
virtio_net: use IFF_LIVE_ADDR_CHANGE priv_flag
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/virtio_net.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 36a16d581f71..1db445b2ecc7 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -679,12 +679,11 @@ static int virtnet_set_mac_address(struct net_device *dev, void *p) | |||
679 | { | 679 | { |
680 | struct virtnet_info *vi = netdev_priv(dev); | 680 | struct virtnet_info *vi = netdev_priv(dev); |
681 | struct virtio_device *vdev = vi->vdev; | 681 | struct virtio_device *vdev = vi->vdev; |
682 | struct sockaddr *addr = p; | 682 | int ret; |
683 | 683 | ||
684 | if (!is_valid_ether_addr(addr->sa_data)) | 684 | ret = eth_mac_addr(dev, p); |
685 | return -EADDRNOTAVAIL; | 685 | if (ret) |
686 | memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); | 686 | return ret; |
687 | dev->addr_assign_type &= ~NET_ADDR_RANDOM; | ||
688 | 687 | ||
689 | if (virtio_has_feature(vdev, VIRTIO_NET_F_MAC)) | 688 | if (virtio_has_feature(vdev, VIRTIO_NET_F_MAC)) |
690 | vdev->config->set(vdev, offsetof(struct virtio_net_config, mac), | 689 | vdev->config->set(vdev, offsetof(struct virtio_net_config, mac), |
@@ -1063,7 +1062,7 @@ static int virtnet_probe(struct virtio_device *vdev) | |||
1063 | return -ENOMEM; | 1062 | return -ENOMEM; |
1064 | 1063 | ||
1065 | /* Set up network device as normal. */ | 1064 | /* Set up network device as normal. */ |
1066 | dev->priv_flags |= IFF_UNICAST_FLT; | 1065 | dev->priv_flags |= IFF_UNICAST_FLT | IFF_LIVE_ADDR_CHANGE; |
1067 | dev->netdev_ops = &virtnet_netdev; | 1066 | dev->netdev_ops = &virtnet_netdev; |
1068 | dev->features = NETIF_F_HIGHDMA; | 1067 | dev->features = NETIF_F_HIGHDMA; |
1069 | 1068 | ||