[Bridge] [PATCH 4/4] br_device: unify return value of .ndo_set_mac_address if address is invalid

Stephen Hemminger shemminger at vyatta.com
Tue Feb 21 17:22:13 UTC 2012


On Tue, 21 Feb 2012 13:07:52 +0100
Danny Kukawka <danny.kukawka at bisect.de> wrote:

> 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 at bisect.de>
> ---
>  net/bridge/br_device.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
> index a157bf8..ba829de 100644
> --- a/net/bridge/br_device.c
> +++ b/net/bridge/br_device.c
> @@ -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)) {

Acked-by: Stephen Hemminger <shemminger at vyatta.com>


More information about the Bridge mailing list