FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 08-16-2010, 02:01 PM
Ales Kozumplik
 
Default loader: parseCmdLineIp* takes just the value as an argument now.

Also see 8f0ffbce8df1e05cd63ffd67e1057cb870ef96ad.
---
loader/loader.c | 33 +++++++++++++++++++--------------
1 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/loader/loader.c b/loader/loader.c
index 760c352..f2ec285 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -821,17 +821,16 @@ static void readNetInfo(struct loaderData_s ** ld) {
*/
static void parseCmdLineIp(struct loaderData_s * loaderData, char *argv)
{
+ char *start, *end;
+ /* if there's "ip=" at the beginning, jump past it */
+ if (!strncmp(argv, "ip=", 3)) {
+ start = argv + 3;
+ } else {
+ start = argv;
+ }
+
/* Detect pxelinux */
if (strstr(argv, ":") != NULL) {
- char *start, *end;
-
- /* IP */
- if (!strncmp(argv, "ip=", 3)) {
- start = argv + 3;
- } else {
- start = argv;
- }
-
end = strstr(start, ":");
loaderData->ipv4 = strndup(start, end-start);
loaderData->ipinfo_set = 1;
@@ -862,7 +861,7 @@ static void parseCmdLineIp(struct loaderData_s * loaderData, char *argv)
start = end + 1;
loaderData->netmask = strdup(start);
} else {
- loaderData->ipv4 = strdup(argv + 3);
+ loaderData->ipv4 = strdup(start);
loaderData->ipinfo_set = 1;
}

@@ -876,15 +875,23 @@ static void parseCmdLineIp(struct loaderData_s * loaderData, char *argv)
*/
static void parseCmdLineIpv6(struct loaderData_s * loaderData, char *argv)
{
+ char *start;
+ /* if there's "ip=" at the beginning, jump past it */
+ if (!strncmp(argv, "ip=", 3)) {
+ start = argv + 3;
+ } else {
+ start = argv;
+ }
+
/* right now we only accept ipv6= arguments equal to:
* dhcp DHCPv6 call
* auto RFC 2461 neighbor discovery
*/
loaderData->ipv6 = NULL;

- if (!strncasecmp(argv, "ipv6=dhcp", 9)) {
+ if (!strncasecmp(start, "dhcp", 4)) {
loaderData->ipv6 = strdup("dhcp");
- } else if (!strncasecmp(argv, "ipv6=auto", 9)) {
+ } else if (!strncasecmp(start, "auto", 4)) {
loaderData->ipv6 = strdup("auto");
}

@@ -892,8 +899,6 @@ static void parseCmdLineIpv6(struct loaderData_s * loaderData, char *argv)
loaderData->ipv6info_set = 1;
flags |= LOADER_FLAGS_IPV6_PARAM;
}
-
- return;
}
#endif

--
1.7.1.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 10:10 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org