/*! Removes the interface from its domain, and deletes it. You need to hold the domain's lock when calling this function. */ status_t remove_interface_from_domain(net_interface* interface) { net_domain_private* domain = (net_domain_private*)interface->domain; list_remove_item(&domain->interfaces, interface); notify_interface_removed(interface); delete_interface((net_interface_private*)interface); return B_OK; }
/*! Removes the interface from the list, and puts the stack's reference to it. */ void remove_interface(Interface* interface) { interface->SetDown(); interface->RemoveAddresses(); RecursiveLocker locker(sLock); sInterfaces.Remove(interface); locker.Unlock(); notify_interface_removed(interface); interface->ReleaseReference(); }