[ovs-dev] [PATCH] netdev-linux: Skip NETDEV_UP test in netdev_linux_set_etheraddr() for taps.

Ethan Jackson ethan at nicira.com
Mon May 13 19:47:34 UTC 2013


Acked-by: Ethan Jackson <ethan at nicira.com>

On Fri, May 10, 2013 at 1:34 PM, Ben Pfaff <blp at nicira.com> wrote:
> netdev_turn_flags_off() does nothing if the flags that one turns off are
> already off.
>
> Reported-by: Ethan Jackson <ethan at nicira.com>
> Signed-off-by: Ben Pfaff <blp at nicira.com>
> ---
>  lib/netdev-linux.c |    6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
> index 30cd0f6..9e2708d 100644
> --- a/lib/netdev-linux.c
> +++ b/lib/netdev-linux.c
> @@ -1019,11 +1019,7 @@ netdev_linux_set_etheraddr(struct netdev *netdev_,
>
>      /* Tap devices must be brought down before setting the address. */
>      if (!strcmp(netdev_get_type(netdev_), "tap")) {
> -        enum netdev_flags flags;
> -
> -        if (!netdev_get_flags(netdev_, &flags) && (flags & NETDEV_UP)) {
> -            netdev_turn_flags_off(netdev_, NETDEV_UP, &sf);
> -        }
> +        netdev_turn_flags_off(netdev_, NETDEV_UP, &sf);
>      }
>      error = set_etheraddr(netdev_get_name(netdev_), mac);
>      if (!error || error == ENODEV) {
> --
> 1.7.10.4
>



More information about the dev mailing list