Skip to content

Commit

Permalink
net: introduce new priv_flag indicating iface capable of change mac w…
Browse files Browse the repository at this point in the history
…hen 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>
  • Loading branch information
Jiri Pirko authored and David S. Miller committed Jun 30, 2012
1 parent 0329274 commit bb35f67
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions include/linux/if.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion net/ethernet/eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit bb35f67

Please sign in to comment.