diff options
author | Jiri Pirko <jpirko@redhat.com> | 2012-06-29 01:10:05 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-30 04:08:00 -0400 |
commit | bb35f67195fcdbe79faa7a15ce148a67c9ab923d (patch) | |
tree | d02ca3cb76bec3d9f0c86b0a44c49478e5e9c0d1 | |
parent | 03292745b02d1166e2a215504407e096b8427be5 (diff) |
net: introduce new priv_flag indicating iface capable of change mac when running
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>
-rw-r--r-- | include/linux/if.h | 2 | ||||
-rw-r--r-- | net/ethernet/eth.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/if.h b/include/linux/if.h index f995c663c493..1ec407b01e46 100644 --- a/include/linux/if.h +++ b/include/linux/if.h | |||
@@ -81,6 +81,8 @@ | |||
81 | #define IFF_UNICAST_FLT 0x20000 /* Supports unicast filtering */ | 81 | #define IFF_UNICAST_FLT 0x20000 /* Supports unicast filtering */ |
82 | #define IFF_TEAM_PORT 0x40000 /* device used as team port */ | 82 | #define IFF_TEAM_PORT 0x40000 /* device used as team port */ |
83 | #define IFF_SUPP_NOFCS 0x80000 /* device supports sending custom FCS */ | 83 | #define IFF_SUPP_NOFCS 0x80000 /* device supports sending custom FCS */ |
84 | #define IFF_LIVE_ADDR_CHANGE 0x100000 /* device supports hardware address | ||
85 | * change when it's running */ | ||
84 | 86 | ||
85 | 87 | ||
86 | #define IF_GET_IFACE 0x0001 /* for querying only */ | 88 | #define IF_GET_IFACE 0x0001 /* for querying only */ |
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c index 36e58800a9e3..db6a6c17d790 100644 --- a/net/ethernet/eth.c +++ b/net/ethernet/eth.c | |||
@@ -283,7 +283,7 @@ int eth_mac_addr(struct net_device *dev, void *p) | |||
283 | { | 283 | { |
284 | struct sockaddr *addr = p; | 284 | struct sockaddr *addr = p; |
285 | 285 | ||
286 | if (netif_running(dev)) | 286 | if (!(dev->priv_flags & IFF_LIVE_ADDR_CHANGE) && netif_running(dev)) |
287 | return -EBUSY; | 287 | return -EBUSY; |
288 | if (!is_valid_ether_addr(addr->sa_data)) | 288 | if (!is_valid_ether_addr(addr->sa_data)) |
289 | return -EADDRNOTAVAIL; | 289 | return -EADDRNOTAVAIL; |