File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -679,12 +679,11 @@ static int virtnet_set_mac_address(struct net_device *dev, void *p)
679
679
{
680
680
struct virtnet_info * vi = netdev_priv (dev );
681
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 ))
685
- return - EADDRNOTAVAIL ;
686
- memcpy (dev -> dev_addr , addr -> sa_data , ETH_ALEN );
687
- dev -> addr_assign_type &= ~NET_ADDR_RANDOM ;
684
+ ret = eth_mac_addr (dev , p );
685
+ if (ret )
686
+ return ret ;
688
687
689
688
if (virtio_has_feature (vdev , VIRTIO_NET_F_MAC ))
690
689
vdev -> config -> set (vdev , offsetof(struct virtio_net_config , mac ),
@@ -1063,7 +1062,7 @@ static int virtnet_probe(struct virtio_device *vdev)
1063
1062
return - ENOMEM ;
1064
1063
1065
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
1066
dev -> netdev_ops = & virtnet_netdev ;
1068
1067
dev -> features = NETIF_F_HIGHDMA ;
1069
1068
You can’t perform that action at this time.
0 commit comments