discover: Bring down configured interfaces on discover server exit.
[petitboot] / discover / network.c
index 7ddecc03b658a59e88e00bfcf9156114ca7f13c6..8cc01833d5875990358ea0bc897eea0bf5ab6fe0 100644 (file)
@@ -582,8 +582,13 @@ int network_shutdown(struct network *network)
        if (network->waiter)
                waiter_remove(network->waiter);
 
-       list_for_each_entry(&network->interfaces, interface, list)
+       list_for_each_entry(&network->interfaces, interface, list) {
+               if (interface->state == IFSTATE_IGNORED)
+                       continue;
+               if (!strcmp(interface->name, "lo"))
+                       continue;
                interface_down(interface);
+       }
 
        close(network->netlink_sd);
        talloc_free(network);