X-Git-Url: https://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=discover%2Fnetwork.c;h=36807f0aecbd9881ef015b1a182f2091aabac60e;hp=9acd4cb5f0cf695637c4d087a066d87947442eb9;hb=a51beb34277a01ca577c35d6a66ceab38e6de67c;hpb=9c950743461770220231d320db8c372aa74f9163 diff --git a/discover/network.c b/discover/network.c index 9acd4cb..36807f0 100644 --- a/discover/network.c +++ b/discover/network.c @@ -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, @@ -235,7 +245,7 @@ static void configure_interface_dhcp(struct interface *interface) if (platform && platform->dhcp_arch_id != 0xffff) snprintf(id, sizeof(id), "0x5d:%04x", platform->dhcp_arch_id); else - argv[11] = NULL; + argv[12] = NULL; process = process_create(interface); @@ -584,7 +594,6 @@ err: return NULL; } - int network_shutdown(struct network *network) { struct interface *interface;