]> git.ozlabs.org Git - petitboot/commitdiff
discover/network: Fix incorrect udhcpc command if we have no platform definition
authorJeremy Kerr <jk@ozlabs.org>
Thu, 22 May 2014 08:03:19 +0000 (16:03 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Mon, 30 Jun 2014 03:32:00 +0000 (11:32 +0800)
If we don't have a platform defined, we generate an invalid uchdpc
command, as we've NULL-ed out the interface name.

This change fixes the no-platform case to terminate *after* the
interface name.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
discover/network.c

index 60d1f6e0f4e1790ba4b2bb2b18bd3a7b81efe70b..36807f0aecbd9881ef015b1a182f2091aabac60e 100644 (file)
@@ -245,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
        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);
 
 
        process = process_create(interface);