diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2014-01-17 16:12:42 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2014-01-30 21:59:10 +0800 |
commit | a984595cfb4910ba6f464c69c316f1613f10f894 (patch) | |
tree | 12af540bf1ac4f93aebb5f65585c9ebd751b8aff /discover/network.c | |
parent | 67e015d08f9a9f53b1ec0a6c301ce1a9516ea69a (diff) | |
download | petitboot-a984595cfb4910ba6f464c69c316f1613f10f894.zip petitboot-a984595cfb4910ba6f464c69c316f1613f10f894.tar.gz |
discover/network: Use platform definition for DHCP architecture ID
Allow a platform to specify a DHCP architecture ID, as this is
platform-specific.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/network.c')
-rw-r--r-- | discover/network.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/discover/network.c b/discover/network.c index 9da0f7a..c300f3d 100644 --- a/discover/network.c +++ b/discover/network.c @@ -212,8 +212,9 @@ 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, @@ -221,14 +222,21 @@ static void configure_interface_dhcp(struct interface *interface) "-n", "-O", "pxeconffile", "-O", "pxepathprefix", - "-x", "0x5d:000a", "-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; |