summaryrefslogtreecommitdiffstats
path: root/loader2
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2007-06-01 14:57:53 +0000
committerDavid Cantrell <dcantrell@redhat.com>2007-06-01 14:57:53 +0000
commitd8fdd8c43e43952f2ffb9b084ae986c344a5db31 (patch)
tree16312643082cfc712f2d3d909d5588ec50d0ff56 /loader2
parent556cfd273c13b9d54b28985ec7a8da28bc5f45fe (diff)
downloadanaconda-d8fdd8c43e43952f2ffb9b084ae986c344a5db31.tar.gz
anaconda-d8fdd8c43e43952f2ffb9b084ae986c344a5db31.tar.xz
anaconda-d8fdd8c43e43952f2ffb9b084ae986c344a5db31.zip
* loader2/net.c (manualNetConfig): Make sure the ip structure member
in the pumpNetIntf structure contains the IPv4 address if it exists, otherwise static network configuration fails (#221660).
Diffstat (limited to 'loader2')
-rw-r--r--loader2/net.c33
1 files changed, 10 insertions, 23 deletions
diff --git a/loader2/net.c b/loader2/net.c
index c393f0047..a5a21b90e 100644
--- a/loader2/net.c
+++ b/loader2/net.c
@@ -887,7 +887,7 @@ int configureTCPIP(char * device, struct networkDeviceConfig * cfg,
int manualNetConfig(char * device, struct networkDeviceConfig * cfg,
struct networkDeviceConfig * newCfg,
struct intfconfig_s * ipcomps, struct netconfopts * opts) {
- int i, rows, pos, primary, prefix, cidr, q, have[2], stack[2];
+ int i, rows, pos, prefix, cidr, q, have[2], stack[2];
char *buf = NULL;
char ret[48];
ip_addr_t *tip;
@@ -1147,39 +1147,26 @@ int manualNetConfig(char * device, struct networkDeviceConfig * cfg,
/* collect common network settings */
if (ipcomps->gw) {
- primary = 0;
-
if (inet_pton(AF_INET, ipcomps->gw, &addr) >= 1) {
newCfg->dev.gateway = ip_addr_in(&addr);
newCfg->dev.set |= PUMP_NETINFO_HAS_GATEWAY;
- primary = AF_INET;
} else if (inet_pton(AF_INET6, ipcomps->gw, &addr6) >= 1) {
newCfg->dev.gateway = ip_addr_in6(&addr6);
newCfg->dev.set |= PUMP_NETINFO_HAS_GATEWAY;
- primary = AF_INET6;
}
+ }
- /* We set cfg->dev.ip to the IP address of the dominant
- * network. Determine that by the address family of the
- * gateway.
- */
- if (primary == AF_INET) {
- if (ipcomps->ipv4) {
- if (inet_pton(AF_INET, ipcomps->ipv4, &addr) >= 1) {
- newCfg->dev.ip = ip_addr_in(&addr);
- newCfg->dev.set |= PUMP_INTFINFO_HAS_IP;
- }
- }
- } else if (primary == AF_INET6) {
- if (ipcomps->ipv6) {
- if (inet_pton(AF_INET6, ipcomps->ipv6, &addr) >= 1) {
- newCfg->dev.ip = ip_addr_in6(&addr6);
- newCfg->dev.set |= PUMP_INTFINFO_HAS_IP;
- }
- }
+ /* The cfg->dev.ip field needs to store the IPv4 address if
+ * there is one.
+ */
+ if (ipcomps->ipv4) {
+ if (inet_pton(AF_INET, ipcomps->ipv4, &addr) >= 1) {
+ newCfg->dev.ip = ip_addr_in(&addr);
+ newCfg->dev.set |= PUMP_INTFINFO_HAS_IP;
}
}
+ /* gather nameservers */
if (ipcomps->ns) {
if (inet_pton(AF_INET, ipcomps->ns, &addr) >= 1) {
cfg->dev.dnsServers[0] = ip_addr_in(&addr);