]> git.ozlabs.org Git - petitboot/blobdiff - discover/network.c
discover/network: Use platform definition for DHCP architecture ID
[petitboot] / discover / network.c
index 9da0f7a72526837011c67191152e4653c048e12c..c300f3dc7719619aa6092df5b476837ff8177b74 100644 (file)
@@ -212,8 +212,9 @@ static void udhcpc_process_exit(struct process *process)
 
 static void configure_interface_dhcp(struct interface *interface)
 {
 
 static void configure_interface_dhcp(struct interface *interface)
 {
+       const struct platform *platform;
+       char pidfile[256], id[10];
        struct process *process;
        struct process *process;
-       char pidfile[256];
        int rc;
        const char *argv[] = {
                pb_system_apps.udhcpc,
        int rc;
        const char *argv[] = {
                pb_system_apps.udhcpc,
@@ -221,14 +222,21 @@ static void configure_interface_dhcp(struct interface *interface)
                "-n",
                "-O", "pxeconffile",
                "-O", "pxepathprefix",
                "-n",
                "-O", "pxeconffile",
                "-O", "pxepathprefix",
-               "-x", "0x5d:000a",
                "-p", pidfile,
                "-i", interface->name,
                "-p", pidfile,
                "-i", interface->name,
+               "-x", id, /* [11,12] - dhcp client identifier */
                NULL,
        };
                NULL,
        };
+
        snprintf(pidfile, sizeof(pidfile), "%s/udhcpc-%s.pid",
                        PIDFILE_BASE, interface->name);
 
        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;
        process = process_create(interface);
 
        process->path = pb_system_apps.udhcpc;