#include <types/types.h>
#include <talloc/talloc.h>
#include <waiter/waiter.h>
-#include <pb-config/pb-config.h>
#include <process/process.h>
#include <system/system.h>
#include "file.h"
#include "network.h"
#include "sysinfo.h"
+#include "platform.h"
#include "device-handler.h"
#define HWADDR_SIZE 6
pb_system_apps.udhcpc,
"-R",
"-n",
+ "-O", "pxeconffile",
+ "-O", "pxepathprefix",
+ "-x", "0x5d:000a",
"-p", pidfile,
"-i", interface->name,
NULL,
memcpy(interface->hwaddr, ifaddr, sizeof(interface->hwaddr));
strncpy(interface->name, ifname, sizeof(interface->name) - 1);
add_interface(network, interface);
-
- /* tell the sysinfo code about this interface */
- if (strcmp(interface->name, "lo"))
- system_info_register_interface(
- sizeof(interface->hwaddr),
- interface->hwaddr, interface->name);
}
+ /* notify the sysinfo code about changes to this interface */
+ if (strcmp(interface->name, "lo"))
+ system_info_register_interface(
+ sizeof(interface->hwaddr),
+ interface->hwaddr, interface->name,
+ info->ifi_flags & IFF_LOWER_UP);
+
configure_interface(network, interface,
info->ifi_flags & IFF_UP,
info->ifi_flags & IFF_LOWER_UP);
network = talloc(handler, struct network);
list_init(&network->interfaces);
network->handler = handler;
- network->manual_config = false;
network->dry_run = dry_run;
+ network->manual_config = config_get()->network.n_interfaces != 0;
network_init_dns(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);