diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | loader2/loader.c | 24 | ||||
-rw-r--r-- | loader2/net.c | 8 |
3 files changed, 32 insertions, 8 deletions
@@ -1,3 +1,11 @@ +2007-05-23 David Cantrell <dcantrell@redhat.com> + + * loader2/loader.c (doLoaderMain): Don't crash if the user selects back + twice during network configuration (#239958). + + * loader2/net.c (cidrCallback): Only warn for an empty prefix if the + user also provided an IP address. + 2007-05-22 David Cantrell <dcantrell@redhat.com> * fsset.py: Be a little more careful about certain assumptions so we diff --git a/loader2/loader.c b/loader2/loader.c index b8effb274..7e1140442 100644 --- a/loader2/loader.c +++ b/loader2/loader.c @@ -1134,9 +1134,15 @@ static char *doLoaderMain(char * location, loaderData->ipinfo_set = 0; } else { if (loaderData->ipv4 == NULL) { - ret = (char *) inet_ntop(AF_INET, - IP_ADDR(&(netDev.dev.ip)), ret, - IP_STRLEN(&(netDev.dev.ip))); + if (strcmp((char *) &(netDev.dev.ip), "")) { + ret = (char *) inet_ntop(AF_INET, + IP_ADDR(&(netDev.dev.ip)), ret, + IP_STRLEN(&(netDev.dev.ip))); + } else { + ret = NULL; + netDev.isDynamic = 1; + } + if (netDev.isDynamic || ret == NULL) { loaderData->ipv4 = strdup("dhcp"); } else { @@ -1151,9 +1157,15 @@ static char *doLoaderMain(char * location, loaderData->ipv6info_set = 0; } else { if (loaderData->ipv6 == NULL) { - ret = (char *) inet_ntop(AF_INET6, - IP_ADDR(&(netDev.dev.ip)), ret, - IP_STRLEN(&(netDev.dev.ip))); + if (strcmp((char *) &(netDev.dev.ip), "")) { + ret = (char *) inet_ntop(AF_INET6, + IP_ADDR(&(netDev.dev.ip)), ret, + IP_STRLEN(&(netDev.dev.ip))); + } else { + ret = NULL; + netDev.isDynamic = 1; + } + if (netDev.isDynamic || ret == NULL) { loaderData->ipv6 = strdup("dhcpv6"); } else { diff --git a/loader2/net.c b/loader2/net.c index 08aedd3ee..c393f0047 100644 --- a/loader2/net.c +++ b/loader2/net.c @@ -79,13 +79,17 @@ static void cidrCallback(newtComponent co, void * dptr) { return; cidr = atoi(data->cidr4); - upper = 32; + + if (strcmp(data->ipv4, "")) + upper = 32; } else if (co == data->cidr6Entry) { if (data->cidr6 == NULL && data->ipv6 == NULL) return; cidr = atoi(data->cidr6); - upper = 128; + + if (strcmp(data->ipv6, "")) + upper = 128; } if (upper != 0) { |