discover/network: leave udhcpc processes running
[petitboot] / discover / network.c
index ca4cc44acf1ba3d1334452b547326041c33f8b13..1801710773b975106e43d6592de4a85d8ad55322 100644 (file)
@@ -181,6 +181,15 @@ static int interface_change(struct interface *interface, bool up)
                process_release(interface->udhcpc_process);
        }
 
                process_release(interface->udhcpc_process);
        }
 
+       if (!up) {
+               rc = process_run_simple(interface, pb_system_apps.ip,
+                               "address", "flush", "dev", interface->name,
+                               NULL);
+               if (rc)
+                       pb_log("failed to flush addresses from interface %s\n",
+                               interface->name);
+       }
+
        rc = process_run_simple(interface, pb_system_apps.ip,
                        "link", "set", interface->name, statestr, NULL);
        if (rc) {
        rc = process_run_simple(interface, pb_system_apps.ip,
                        "link", "set", interface->name, statestr, NULL);
        if (rc) {
@@ -219,7 +228,7 @@ static void configure_interface_dhcp(struct interface *interface)
        const char *argv[] = {
                pb_system_apps.udhcpc,
                "-R",
        const char *argv[] = {
                pb_system_apps.udhcpc,
                "-R",
-               "-n",
+               "-f",
                "-O", "pxeconffile",
                "-O", "pxepathprefix",
                "-p", pidfile,
                "-O", "pxeconffile",
                "-O", "pxepathprefix",
                "-p", pidfile,