Skip to content

Commit

Permalink
virtio_net: use IFF_LIVE_ADDR_CHANGE priv_flag
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jiri Pirko authored and David S. Miller committed Jun 30, 2012
1 parent bb35f67 commit f2f2c8b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions drivers/net/virtio_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -679,12 +679,11 @@ static int virtnet_set_mac_address(struct net_device *dev, void *p)
{
struct virtnet_info *vi = netdev_priv(dev);
struct virtio_device *vdev = vi->vdev;
struct sockaddr *addr = p;
int ret;

if (!is_valid_ether_addr(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
dev->addr_assign_type &= ~NET_ADDR_RANDOM;
ret = eth_mac_addr(dev, p);
if (ret)
return ret;

if (virtio_has_feature(vdev, VIRTIO_NET_F_MAC))
vdev->config->set(vdev, offsetof(struct virtio_net_config, mac),
Expand Down Expand Up @@ -1063,7 +1062,7 @@ static int virtnet_probe(struct virtio_device *vdev)
return -ENOMEM;

/* Set up network device as normal. */
dev->priv_flags |= IFF_UNICAST_FLT;
dev->priv_flags |= IFF_UNICAST_FLT | IFF_LIVE_ADDR_CHANGE;
dev->netdev_ops = &virtnet_netdev;
dev->features = NETIF_F_HIGHDMA;

Expand Down

0 comments on commit f2f2c8b

Please sign in to comment.