br_device: unify return value of .ndo_set_mac_address if address is invalid
authorDanny Kukawka <danny.kukawka@bisect.de>
Tue, 21 Feb 2012 02:07:52 +0000 (02:07 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 23 Feb 2012 22:03:20 +0000 (17:03 -0500)
Unify return value of .ndo_set_mac_address if the given address
isn't valid. Return -EADDRNOTAVAIL as eth_mac_addr() already does
if is_valid_ether_addr() fails.

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_device.c

index a157bf827d87b13d548c74a36714cc14284bb5fb..ba829de84423e24cf05a1ccb1e73009669281bd9 100644 (file)
@@ -167,7 +167,7 @@ static int br_set_mac_address(struct net_device *dev, void *p)
        struct sockaddr *addr = p;
 
        if (!is_valid_ether_addr(addr->sa_data))
-               return -EINVAL;
+               return -EADDRNOTAVAIL;
 
        spin_lock_bh(&br->lock);
        if (compare_ether_addr(dev->dev_addr, addr->sa_data)) {