log: Allow runtime selection of 'debug' log level
[petitboot] / discover / network.c
index ca4cc44acf1ba3d1334452b547326041c33f8b13..60d1f6e0f4e1790ba4b2bb2b18bd3a7b81efe70b 100644 (file)
@@ -181,6 +181,15 @@ static int interface_change(struct interface *interface, bool up)
                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) {
@@ -220,6 +229,7 @@ static void configure_interface_dhcp(struct interface *interface)
                pb_system_apps.udhcpc,
                "-R",
                "-n",
+               "-f",
                "-O", "pxeconffile",
                "-O", "pxepathprefix",
                "-p", pidfile,