When removing an interface, we must make sure it's not still up (ie. we need to

bring it down in that case). This fixes the problem that you couldn't bring an
ethernet interface up again, after you deleted it once.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19524 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-12-15 14:10:25 +00:00
parent 1cdfc4880c
commit f6d219a166

View File

@ -157,6 +157,12 @@ create_interface(net_domain *domain, const char *name, const char *baseName,
void
delete_interface(net_interface_private *interface)
{
if ((interface->flags & IFF_UP) != 0) {
// the interface is still up - we need to change that before deleting it
interface->flags &= ~IFF_UP;
interface->device_interface->module->down(interface->device_interface->device);
}
put_device_interface(interface->device_interface);
free(interface->address);