diff options
author | David Cantrell <dcantrell@redhat.com> | 2008-10-06 13:00:31 -1000 |
---|---|---|
committer | David Cantrell <dcantrell@redhat.com> | 2008-10-06 16:25:45 -1000 |
commit | 7001773b6c6fb5043cff537ac4fda15b84415f7f (patch) | |
tree | bd94f499c5a692bb49473bd3c71a970827b76bc8 /loader | |
parent | fad9363ac6ad0f60d93dc50895d22a47bb2e82d2 (diff) | |
download | anaconda-7001773b6c6fb5043cff537ac4fda15b84415f7f.tar.gz anaconda-7001773b6c6fb5043cff537ac4fda15b84415f7f.tar.xz anaconda-7001773b6c6fb5043cff537ac4fda15b84415f7f.zip |
Disable more IPv6 code in loader for now.
Wrapping more IPv6 code in ENABLE_IPV6 since NM does not yet
support IPv6.
Diffstat (limited to 'loader')
-rw-r--r-- | loader/loader.h | 15 | ||||
-rw-r--r-- | loader/net.c | 37 | ||||
-rw-r--r-- | loader/net.h | 13 |
3 files changed, 55 insertions, 10 deletions
diff --git a/loader/loader.h b/loader/loader.h index 590632f24..96190710f 100644 --- a/loader/loader.h +++ b/loader/loader.h @@ -58,9 +58,13 @@ #define LOADER_FLAGS_CMDLINE (((uint64_t) 1) << 28) #define LOADER_FLAGS_GRAPHICAL (((uint64_t) 1) << 29) #define LOADER_FLAGS_NOIPV4 (((uint64_t) 1) << 31) +#ifdef ENABLE_IPV6 #define LOADER_FLAGS_NOIPV6 (((uint64_t) 1) << 32) +#endif #define LOADER_FLAGS_IP_PARAM (((uint64_t) 1) << 33) +#ifdef ENABLE_IPV6 #define LOADER_FLAGS_IPV6_PARAM (((uint64_t) 1) << 34) +#endif #define LOADER_FLAGS_IS_KICKSTART (((uint64_t) 1) << 35) #define LOADER_FLAGS_ALLOW_WIRELESS (((uint64_t) 1) << 36) #define LOADER_FLAGS_HAVE_CMSCONF (((uint64_t) 1) << 37) @@ -88,9 +92,13 @@ #define FL_VIRTPCONSOLE(a) ((a) & LOADER_FLAGS_VIRTPCONSOLE) #define FL_ASKNETWORK(a) ((a) & LOADER_FLAGS_ASKNETWORK) #define FL_NOIPV4(a) ((a) & LOADER_FLAGS_NOIPV4) +#ifdef ENABLE_IPV6 #define FL_NOIPV6(a) ((a) & LOADER_FLAGS_NOIPV6) +#endif #define FL_IP_PARAM(a) ((a) & LOADER_FLAGS_IP_PARAM) +#ifdef ENABLE_IPV6 #define FL_IPV6_PARAM(a) ((a) & LOADER_FLAGS_IPV6_PARAM) +#endif #define FL_IS_KICKSTART(a) ((a) & LOADER_FLAGS_IS_KICKSTART) #define FL_ALLOW_WIRELESS(a) ((a) & LOADER_FLAGS_ALLOW_WIRELESS) #define FL_HAVE_CMSCONF(a) ((a) & LOADER_FLAGS_HAVE_CMSCONF) @@ -117,12 +125,15 @@ struct loaderData_s { int bootIf_set; char * netCls; int netCls_set; - char *ipv4, *ipv6, *netmask, *gateway, *dns, *hostname, *peerid, *ethtool, *subchannels, *portname, *essid, *wepkey, *nettype, *ctcprot, *layer2, *macaddr; + char *ipv4, *netmask, *gateway, *dns, *hostname, *peerid, *ethtool, *subchannels, *portname, *essid, *wepkey, *nettype, *ctcprot, *layer2, *macaddr; +#ifdef ENABLE_IPV6 + char *ipv6; + int ipv6info_set; +#endif int mtu; int noDns; int dhcpTimeout; int ipinfo_set; - int ipv6info_set; char * ksFile; int method; char * ddsrc; diff --git a/loader/net.c b/loader/net.c index 0e004fbca..e4ce88592 100644 --- a/loader/net.c +++ b/loader/net.c @@ -84,6 +84,7 @@ static void cidrCallback(newtComponent co, void * dptr) { if (strcmp(data->ipv4, "")) upper = 32; +#ifdef ENABLE_IPV6 } else if (co == data->cidr6Entry) { if (data->cidr6 == NULL && data->ipv6 == NULL) return; @@ -98,6 +99,7 @@ static void cidrCallback(newtComponent co, void * dptr) { if (strcmp(data->ipv6, "")) upper = 128; +#endif } if (upper != 0) { @@ -141,9 +143,11 @@ static void ipCallback(newtComponent co, void * dptr) { } return; +#ifdef ENABLE_IPV6 } else if (co == data->ipv6Entry) { /* users must provide a mask, we can't guess for ipv6 */ return; +#endif } } @@ -269,17 +273,21 @@ void setupNetworkDeviceConfig(iface_t * iface, iface->flags &= ~IFACE_FLAGS_IS_DYNAMIC; iface->flags |= IFACE_FLAGS_IS_PRESET; } +#ifdef ENABLE_IPV6 } else if (loaderData->ipv6) { if (inet_pton(AF_INET6, loaderData->ipv6, &addr6) >= 1) { memcpy(&iface->ip6addr, &addr6, sizeof(struct in6_addr)); iface->flags &= ~IFACE_FLAGS_IS_DYNAMIC; iface->flags |= IFACE_FLAGS_IS_PRESET; } +#endif } else { /* invalid ip information, disable the setting of ip info */ loaderData->ipinfo_set = 0; iface->flags &= ~IFACE_FLAGS_IS_DYNAMIC; loaderData->ipv4 = NULL; +#ifdef ENABLE_IPV6 loaderData->ipv6 = NULL; +#endif } } @@ -385,16 +393,20 @@ int readNetConfig(char * device, iface_t * iface, /* ipcomps contains the user interface components */ ipcomps.ipv4 = NULL; - ipcomps.ipv6 = NULL; ipcomps.cidr4 = NULL; - ipcomps.cidr6 = NULL; ipcomps.gw = NULL; +#ifdef ENABLE_IPV6 + ipcomps.ipv6 = NULL; + ipcomps.cidr6 = NULL; ipcomps.gw6 = NULL; +#endif ipcomps.ns = NULL; /* init opts */ opts.ipv4Choice = 0; +#ifdef ENABLE_IPV6 opts.ipv6Choice = 0; +#endif /* JKFIXME: we really need a way to override this and be able to change * our network config */ @@ -603,15 +615,17 @@ int configureTCPIP(char * device, iface_t * iface, return LOADER_BACK; } -#ifdef ENABLE_IPV6 /* need at least one stack */ +#ifdef ENABLE_IPV6 if (opts->ipv4Choice == ' ' && opts->ipv6Choice == ' ') { +#else + if (opts->ipv4Choice == ' ') { +#endif newtWinMessage(_("Missing Protocol"), _("Retry"), _("You must select at least one protocol (IPv4 " "or IPv6).")); continue; } -#endif /* NFS only works over IPv4 */ if (opts->ipv4Choice == ' ' && methodNum == METHOD_NFS) { @@ -695,12 +709,13 @@ int configureTCPIP(char * device, iface_t * iface, int manualNetConfig(char * device, iface_t * iface, struct intfconfig_s * ipcomps, struct netconfopts * opts) { - int i, rows, pos, prefix, cidr, have[2], stack[2]; + int i, rows, pos, cidr, have[2], stack[2]; char *buf = NULL; char ret[48]; struct in_addr addr; #ifdef ENABLE_IPV6 struct in6_addr addr6; + int prefix; #endif struct in_addr *tmpaddr = NULL; newtComponent f, okay, back, answer; @@ -991,6 +1006,7 @@ int manualNetConfig(char * device, iface_t * iface, } } +#ifdef ENABLE_IPV6 /* collect IPv6 data */ if (stack[IPV6]) { if (ipcomps->ipv6) { @@ -1019,6 +1035,7 @@ int manualNetConfig(char * device, iface_t * iface, } } } +#endif /* collect common network settings */ if (ipcomps->gw) { @@ -1204,6 +1221,7 @@ int writeEnabledNetInfo(iface_t *iface) { } } +#ifdef ENABLE_IPV6 if (!FL_NOIPV6(flags)) { if (iface->ipv6method == IPV6_AUTO_METHOD || iface->ipv6method == IPV6_DHCP_METHOD || @@ -1231,6 +1249,7 @@ int writeEnabledNetInfo(iface_t *iface) { } } } +#endif if (iface->numdns > 0) { for (i = 0; i < iface->numdns; i++) { @@ -1287,9 +1306,11 @@ int writeEnabledNetInfo(iface_t *iface) { fprintf(fp, "NETWORKING=yes\n"); } +#ifdef ENABLE_IPV6 if (!FL_NOIPV6(flags)) { fprintf(fp, "NETWORKING_IPV6=yes\n"); } +#endif if (iface->hostname != NULL) { fprintf(fp, "HOSTNAME=%s\n", iface->hostname); @@ -1447,8 +1468,10 @@ void setKickstartNetwork(struct loaderData_s * loaderData, int argc, if (noipv4) flags |= LOADER_FLAGS_NOIPV4; +#ifdef ENABLE_IPV6 if (noipv6) flags |= LOADER_FLAGS_NOIPV6; +#endif } if (noDns) { @@ -1672,7 +1695,11 @@ int kickstartNetworkUp(struct loaderData_s * loaderData, iface_t * iface) { int rc; /* we may have networking already, so return to the caller */ +#ifdef ENABLE_IPV6 if ((loaderData->ipinfo_set == 1) || (loaderData->ipv6info_set == 1)) +#else + if (loaderData->ipinfo_set == 1) +#endif return 0; memset(iface, 0, sizeof(*iface)); diff --git a/loader/net.h b/loader/net.h index c765c9cec..a8dbed9ee 100644 --- a/loader/net.h +++ b/loader/net.h @@ -25,22 +25,29 @@ #include "loader.h" #define DHCP_METHOD_STR _("Dynamic IP configuration (DHCP)") -#define DHCPV6_METHOD_STR _("Dynamic IP configuration (DHCPv6)") #define MANUAL_METHOD_STR _("Manual configuration") +#ifdef ENABLE_IPV6 +#define DHCPV6_METHOD_STR _("Dynamic IP configuration (DHCPv6)") #define AUTO_METHOD_STR _("Automatic neighbor discovery") +#endif struct intfconfig_s { newtComponent ipv4Entry, cidr4Entry; - newtComponent ipv6Entry, cidr6Entry; newtComponent gwEntry, nsEntry; const char *ipv4, *cidr4; +#ifdef ENABLE_IPV6 + newtComponent ipv6Entry, cidr6Entry; const char *ipv6, *cidr6; - const char *gw, *gw6, *ns; + const char *gw6; +#endif + const char *gw, *ns; }; struct netconfopts { char ipv4Choice; +#ifdef ENABLE_IPV6 char ipv6Choice; +#endif }; typedef int int32; |