summaryrefslogtreecommitdiffstats
path: root/loader2/net.c
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2006-07-27 18:43:50 +0000
committerDavid Cantrell <dcantrell@redhat.com>2006-07-27 18:43:50 +0000
commit178e15d17644fe5b8aef868fe746501889ed2316 (patch)
treee57ef6df01817d5c0fde67719ed958e55dbff12c /loader2/net.c
parentf516c56ac2b3bc7f0f03222f4770639ed926e867 (diff)
downloadanaconda-178e15d17644fe5b8aef868fe746501889ed2316.tar.gz
anaconda-178e15d17644fe5b8aef868fe746501889ed2316.tar.xz
anaconda-178e15d17644fe5b8aef868fe746501889ed2316.zip
* loader2/cdinstall.c: loaderData->method is now an int.
* loader2/hdinstall.c: Whitespace consistency, loaderData->method is now an int. * loader2/loader.c (doLoaderMain): loaderData->method is now an int, pass methodNum to readNetConfig(). * loader2/loader.h: char * method -> int method. * loader2/method.c: Set loaderData->method to appropriate METHOD_ value since it's now an int. * loader2/method.h: Add METHOD_* macros. * loader2/net.c (cidrCallback): Dialog wording change. * loader2/net.c (readNetConfig): Take methodNum as a param, pass methodNum to configureTCPIP(). * loader2/net.c (configureTCPIP): Take methodNum as a param, if user selects METHOD_NFS and unchecks IPv4, display error dialog and ask user to try again. * loader2/net.c (kickstartNetworkUp): Pass methodNum to readNetConfig(). * loader2/net.h: Prototype updates. * loader2/nfsinstall.c: loaderData->method is now an int. * loader2/urlinstall.c: loaderData->method is now an int.
Diffstat (limited to 'loader2/net.c')
-rw-r--r--loader2/net.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/loader2/net.c b/loader2/net.c
index df0f39cee..ce92fe07f 100644
--- a/loader2/net.c
+++ b/loader2/net.c
@@ -1,5 +1,5 @@
/*
- * Copyright 1999-2004 Red Hat, Inc.
+ * Copyright 1999-2006 Red Hat, Inc.
*
* David Cantrell <dcantrell@redhat.com>
*
@@ -52,6 +52,7 @@
#include "loader.h"
#include "loadermisc.h"
#include "log.h"
+#include "method.h"
#include "net.h"
#include "windows.h"
@@ -93,8 +94,8 @@ static void cidrCallback(newtComponent co, void * dptr) {
if (upper != 0) {
if (cidr < 1 || cidr > upper) {
- newtWinMessage(_("Invalid CIDR Mask"), _("Retry"),
- _("CIDR mask value must be between 1 and 32 "
+ newtWinMessage(_("Invalid Prefix"), _("Retry"),
+ _("Prefix must be between 1 and 32 "
"for IPv4 networks or between 1 and 128 "
"for IPv6 networks"));
}
@@ -504,7 +505,7 @@ void setupNetworkDeviceConfig(struct networkDeviceConfig * cfg,
}
int readNetConfig(char * device, struct networkDeviceConfig * cfg,
- char * dhcpclass) {
+ char * dhcpclass, int methodNum) {
struct networkDeviceConfig newCfg;
int ret;
int i = 0;
@@ -562,7 +563,8 @@ int readNetConfig(char * device, struct networkDeviceConfig * cfg,
/* dhcp/manual network configuration loop */
i = 1;
while (i == 1) {
- ret = configureTCPIP(device, cfg, &newCfg, &ipv4Choice, &ipv6Choice);
+ ret = configureTCPIP(device, cfg, &newCfg, &ipv4Choice, &ipv6Choice,
+ methodNum);
if (ret == LOADER_NOOP) {
/* dhcp selected, proceed */
@@ -651,7 +653,7 @@ int readNetConfig(char * device, struct networkDeviceConfig * cfg,
int configureTCPIP(char * device, struct networkDeviceConfig * cfg,
struct networkDeviceConfig * newCfg,
- char * ipv4Choice, char * ipv6Choice) {
+ char * ipv4Choice, char * ipv6Choice, int methodNum) {
int i = 0;
char dhcpChoice;
char *dret = NULL;
@@ -748,6 +750,12 @@ int configureTCPIP(char * device, struct networkDeviceConfig * cfg,
return LOADER_BACK;
}
+ if (*ipv4Choice == ' ' && methodNum == METHOD_NFS) {
+ newtWinMessage(_("IPv4 Needed for NFS"), _("Retry"),
+ _("NFS installation method requires IPv4 support."));
+ continue;
+ }
+
if (dhcpChoice == ' ') {
if (*ipv4Choice == ' ' && *ipv6Choice == ' ') {
newtWinMessage(_("Missing Protocol"), _("Retry"),
@@ -1703,7 +1711,8 @@ int kickstartNetworkUp(struct loaderData_s * loaderData,
setupNetworkDeviceConfig(netCfgPtr, loaderData);
- rc = readNetConfig(loaderData->netDev, netCfgPtr, loaderData->netCls);
+ rc = readNetConfig(loaderData->netDev, netCfgPtr, loaderData->netCls,
+ loaderData->method);
if ((rc == LOADER_BACK) || (rc == LOADER_ERROR)) {
logMessage(ERROR, "unable to setup networking");
return -1;