]> git.ozlabs.org Git - petitboot/blobdiff - discover/network.c
discover/network: flush addresses when bringing an interface down
[petitboot] / discover / network.c
index ca4cc44acf1ba3d1334452b547326041c33f8b13..2b7e94cbbdad0a4987cb7cb54d820a2df8f0d3dc 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) {