Add active state flag to avoid deactivating an interface which is
already off.
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
if (ret)
return ret;
+ intf->active = true;
+
return 0;
}
*/
void gb_interface_deactivate(struct gb_interface *intf)
{
+ if (!intf->active)
+ return;
+
gb_interface_route_destroy(intf);
+
+ intf->active = false;
}
/*
bool disconnected;
bool ejected;
+ bool active;
bool enabled;
};
#define to_gb_interface(d) container_of(d, struct gb_interface, dev)