File tree Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change 40
40
41
41
static int numdummies = 1 ;
42
42
43
- static int dummy_set_address (struct net_device * dev , void * p )
44
- {
45
- struct sockaddr * sa = p ;
46
-
47
- if (!is_valid_ether_addr (sa -> sa_data ))
48
- return - EADDRNOTAVAIL ;
49
-
50
- dev -> addr_assign_type &= ~NET_ADDR_RANDOM ;
51
- memcpy (dev -> dev_addr , sa -> sa_data , ETH_ALEN );
52
- return 0 ;
53
- }
54
-
55
43
/* fake multicast ability */
56
44
static void set_multicast_list (struct net_device * dev )
57
45
{
@@ -118,7 +106,7 @@ static const struct net_device_ops dummy_netdev_ops = {
118
106
.ndo_start_xmit = dummy_xmit ,
119
107
.ndo_validate_addr = eth_validate_addr ,
120
108
.ndo_set_rx_mode = set_multicast_list ,
121
- .ndo_set_mac_address = dummy_set_address ,
109
+ .ndo_set_mac_address = eth_mac_addr ,
122
110
.ndo_get_stats64 = dummy_get_stats64 ,
123
111
};
124
112
@@ -134,6 +122,7 @@ static void dummy_setup(struct net_device *dev)
134
122
dev -> tx_queue_len = 0 ;
135
123
dev -> flags |= IFF_NOARP ;
136
124
dev -> flags &= ~IFF_MULTICAST ;
125
+ dev -> priv_flags |= IFF_LIVE_ADDR_CHANGE ;
137
126
dev -> features |= NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_TSO ;
138
127
dev -> features |= NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_LLTX ;
139
128
eth_hw_addr_random (dev );
You can’t perform that action at this time.
0 commit comments