X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=discover%2Fnetwork.c;h=c300f3dc7719619aa6092df5b476837ff8177b74;hp=8cc01833d5875990358ea0bc897eea0bf5ab6fe0;hb=5a271400e9b5396cb90258b7582fe7ac6bcc2230;hpb=729bcafedd3b117c031c413fac2e2d2096d62510 diff --git a/discover/network.c b/discover/network.c index 8cc0183..c300f3d 100644 --- a/discover/network.c +++ b/discover/network.c @@ -14,13 +14,13 @@ #include #include #include -#include #include #include #include "file.h" #include "network.h" #include "sysinfo.h" +#include "platform.h" #include "device-handler.h" #define HWADDR_SIZE 6 @@ -212,21 +212,31 @@ static void udhcpc_process_exit(struct process *process) static void configure_interface_dhcp(struct interface *interface) { + const struct platform *platform; + char pidfile[256], id[10]; struct process *process; - char pidfile[256]; int rc; const char *argv[] = { pb_system_apps.udhcpc, "-R", "-n", "-O", "pxeconffile", + "-O", "pxepathprefix", "-p", pidfile, "-i", interface->name, + "-x", id, /* [11,12] - dhcp client identifier */ NULL, }; + snprintf(pidfile, sizeof(pidfile), "%s/udhcpc-%s.pid", PIDFILE_BASE, interface->name); + platform = platform_get(); + if (platform && platform->dhcp_arch_id != 0xffff) + snprintf(id, sizeof(id), "0x5d:%04x", platform->dhcp_arch_id); + else + argv[11] = NULL; + process = process_create(interface); process->path = pb_system_apps.udhcpc;