net: introduce new priv_flag indicating iface capable of change mac when running
authorJiri Pirko <jpirko@redhat.com>
Fri, 29 Jun 2012 05:10:05 +0000 (05:10 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 30 Jun 2012 08:08:00 +0000 (01:08 -0700)
Introduce IFF_LIVE_ADDR_CHANGE priv_flag and use it to disable
netif_running() check in eth_mac_addr()

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/if.h
net/ethernet/eth.c

index f995c663c493baf4d369bcf05d3bed20d38dcd1f..1ec407b01e46fe73308547b02bd548fd150616ec 100644 (file)
@@ -81,6 +81,8 @@
 #define IFF_UNICAST_FLT        0x20000         /* Supports unicast filtering   */
 #define IFF_TEAM_PORT  0x40000         /* device used as team port */
 #define IFF_SUPP_NOFCS 0x80000         /* device supports sending custom FCS */
+#define IFF_LIVE_ADDR_CHANGE 0x100000  /* device supports hardware address
+                                        * change when it's running */
 
 
 #define IF_GET_IFACE   0x0001          /* for querying only */
index 36e58800a9e34b1f9683e09b92bf92b349eb99ab..db6a6c17d7906e1e8fabcd33b6237be0f7416538 100644 (file)
@@ -283,7 +283,7 @@ int eth_mac_addr(struct net_device *dev, void *p)
 {
        struct sockaddr *addr = p;
 
-       if (netif_running(dev))
+       if (!(dev->priv_flags & IFF_LIVE_ADDR_CHANGE) && netif_running(dev))
                return -EBUSY;
        if (!is_valid_ether_addr(addr->sa_data))
                return -EADDRNOTAVAIL;