From 3cc724e575f6499e6ff827e164b7d2fdc2af3968 Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Thu, 8 Mar 2007 23:14:29 +0000 Subject: * loader2/loader.c (parseCmdLineFlags): If BOOTIF= is passed as a boot argument, pull the MAC address from it and replace hyphens with colons so that the MAC address is usable in loader (#209284). --- loader2/loader.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'loader2') diff --git a/loader2/loader.c b/loader2/loader.c index 807ccf0fd..9874bca04 100644 --- a/loader2/loader.c +++ b/loader2/loader.c @@ -578,6 +578,7 @@ static void parseCmdLineFlags(struct loaderData_s * loaderData, int argc; int numExtraArgs = 0; int i; + char *front; /* if we have any explicit cmdline (probably test mode), we don't want * to parse /proc/cmdline */ @@ -693,6 +694,17 @@ static void parseCmdLineFlags(struct loaderData_s * loaderData, else if (!strncmp(argv[i], "BOOTIF=", 7)) { /* +10 so that we skip over the leading 01- */ loaderData->bootIf = strdup(argv[i] + 10); + + /* scan the BOOTIF value and replace '-' with ':' */ + front = loaderData->bootIf; + if (front) { + while (*front != '\0') { + if (*front == '-') + *front = ':'; + front++; + } + } + loaderData->bootIf_set = 1; } else if (!strncasecmp(argv[i], "dhcpclass=", 10)) { loaderData->netCls = strdup(argv[i] + 10); -- cgit