mirror of
https://github.com/openvswitch/ovs
synced 2025-09-03 15:55:19 +00:00
netdev-linux: Skip NETDEV_UP test in netdev_linux_set_etheraddr() for taps.
netdev_turn_flags_off() does nothing if the flags that one turns off are already off. Reported-by: Ethan Jackson <ethan@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
This commit is contained in:
@@ -977,11 +977,7 @@ netdev_linux_set_etheraddr(struct netdev *netdev_,
|
||||
|
||||
/* Tap devices must be brought down before setting the address. */
|
||||
if (is_tap_netdev(netdev_)) {
|
||||
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) {
|
||||
|
Reference in New Issue
Block a user