diff options
author | David Cantrell <dcantrell@redhat.com> | 2006-08-29 15:52:18 +0000 |
---|---|---|
committer | David Cantrell <dcantrell@redhat.com> | 2006-08-29 15:52:18 +0000 |
commit | 13de0825836d8e72f115c7f48bd7bdb89ba02b90 (patch) | |
tree | fd479f9022acf0d81cfc713d8a2d8882958c8ddd | |
parent | 156d77cc513c460a43aa497c92711e269b38a276 (diff) | |
download | anaconda-13de0825836d8e72f115c7f48bd7bdb89ba02b90.tar.gz anaconda-13de0825836d8e72f115c7f48bd7bdb89ba02b90.tar.xz anaconda-13de0825836d8e72f115c7f48bd7bdb89ba02b90.zip |
* loader2/net.c: Remember manual TCP/IP settings if user selects
Back and then re-enters the TCP/IP entry dialog again.
* gptsync/Makefile: Remove .depend in clean target.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | gptsync/Makefile | 5 | ||||
-rw-r--r-- | loader2/net.c | 65 |
3 files changed, 55 insertions, 22 deletions
@@ -1,3 +1,10 @@ +2006-08-29 David Cantrell <dcantrell@redhat.com> + + * loader2/net.c: Remember manual TCP/IP settings if user selects + Back and then re-enters the TCP/IP entry dialog again. + + * gptsync/Makefile: Remove .depend in clean target. + 2006-08-29 Jeremy Katz <katzj@redhat.com> * scripts/mk-images.ia64 (image): Fix ia64 pxeboot dir (#199274) diff --git a/gptsync/Makefile b/gptsync/Makefile index 8302933d3..8ba73595a 100644 --- a/gptsync/Makefile +++ b/gptsync/Makefile @@ -24,10 +24,7 @@ $(OBJS): %.o: %.c # cleanup clean: - $(RM) *.o *~ *% $(TARGET) - -distclean: clean - $(RM) .depend + $(RM) *.o *~ *% $(TARGET) .depend # automatic dependencies diff --git a/loader2/net.c b/loader2/net.c index 75159173f..156ce2525 100644 --- a/loader2/net.c +++ b/loader2/net.c @@ -822,7 +822,7 @@ int manualNetConfig(char * device, struct networkDeviceConfig * cfg, struct intfconfig_s * ipcomps, int ipv4Choice, int ipv6Choice) { int ifour, isix, rows, pos, primary, prefix, cidr; - char buf[4]; + char *buf = NULL; char ret[48]; ip_addr_t *tip; struct in_addr addr; @@ -873,14 +873,24 @@ int manualNetConfig(char * device, struct networkDeviceConfig * cfg, newtComponentAddCallback(ipcomps->cidr4Entry, cidrCallback, &ipcomps); /* populate fields if we have data already */ - if (cfg->dev.set & PUMP_INTFINFO_HAS_IPV4_IP) { + tip = NULL; + if (cfg->dev.set & PUMP_INTFINFO_HAS_IPV4_IP) tip = &(cfg->dev.ipv4); + else if (newCfg->dev.set & PUMP_INTFINFO_HAS_IPV4_IP) + tip = &(newCfg->dev.ipv4); + + if (tip) { inet_ntop(tip->sa_family, IP_ADDR(tip), ret, IP_STRLEN(tip)); newtEntrySet(ipcomps->ipv4Entry, ret, 1); } - if (cfg->dev.set & PUMP_INTFINFO_HAS_NETMASK) { + tip = NULL; + if (cfg->dev.set & PUMP_INTFINFO_HAS_NETMASK) tip = &(cfg->dev.netmask); + else if (newCfg->dev.set & PUMP_INTFINFO_HAS_NETMASK) + tip = &(newCfg->dev.netmask); + + if (tip) { inet_ntop(tip->sa_family, IP_ADDR(tip), ret, IP_STRLEN(tip)); newtEntrySet(ipcomps->cidr4Entry, ret, 1); } @@ -915,16 +925,25 @@ int manualNetConfig(char * device, struct networkDeviceConfig * cfg, newtComponentAddCallback(ipcomps->cidr6Entry, cidrCallback, &ipcomps); /* populate fields if we have data already */ - if (cfg->dev.set & PUMP_INTFINFO_HAS_IPV6_IP) { + tip = NULL; + if (cfg->dev.set & PUMP_INTFINFO_HAS_IPV6_IP) tip = &(cfg->dev.ipv6); + else if (newCfg->dev.set & PUMP_INTFINFO_HAS_IPV6_IP) + tip = &(newCfg->dev.ipv6); + + if (tip) { inet_ntop(tip->sa_family, IP_ADDR(tip), ret, IP_STRLEN(tip)); newtEntrySet(ipcomps->ipv6Entry, ret, 1); } - if (cfg->dev.set & PUMP_INTFINFO_HAS_IPV6_PREFIX) { - sprintf(buf, "%d", cfg->dev.ipv6_prefixlen); - memcpy(ipcomps->cidr4Entry, buf, strlen(buf)); - newtEntrySet(ipcomps->cidr4Entry, ret, 1); + if (cfg->dev.set & PUMP_INTFINFO_HAS_IPV6_PREFIX) + asprintf(&buf, "%d", cfg->dev.ipv6_prefixlen); + else if (newCfg->dev.set & PUMP_INTFINFO_HAS_IPV6_PREFIX) + asprintf(&buf, "%d", newCfg->dev.ipv6_prefixlen); + + if (buf) { + newtEntrySet(ipcomps->cidr6Entry, buf, 1); + free(buf); } pos++; @@ -948,14 +967,24 @@ int manualNetConfig(char * device, struct networkDeviceConfig * cfg, newtGridSetField(egrid, 1, pos, NEWT_GRID_COMPONENT, ipcomps->nsEntry, 1, 0, 0, 0, NEWT_ANCHOR_LEFT, 0); - if (cfg->dev.set & PUMP_NETINFO_HAS_GATEWAY) { + tip = NULL; + if (cfg->dev.set & PUMP_NETINFO_HAS_GATEWAY) tip = &(cfg->dev.gateway); + else if (newCfg->dev.set & PUMP_NETINFO_HAS_GATEWAY) + tip = &(newCfg->dev.gateway); + + if (tip) { inet_ntop(tip->sa_family, IP_ADDR(tip), ret, IP_STRLEN(tip)); newtEntrySet(ipcomps->gwEntry, ret, 1); } - if (cfg->dev.numDns) { + tip = NULL; + if (cfg->dev.numDns) tip = &(cfg->dev.dnsServers[0]); + else if (newCfg->dev.numDns) + tip = &(newCfg->dev.dnsServers[0]); + + if (tip) { inet_ntop(tip->sa_family, IP_ADDR(tip), ret, IP_STRLEN(tip)); newtEntrySet(ipcomps->nsEntry, ret, 1); } @@ -990,14 +1019,7 @@ int manualNetConfig(char * device, struct networkDeviceConfig * cfg, isix = 2; answer = newtRunForm(f); - - if (answer == back) { - newtFormDestroy(f); - newtPopWindow(); - return LOADER_BACK; - } - - memset(newCfg, 0, sizeof(*newCfg)); + /* memset(newCfg, 0, sizeof(*newCfg)); */ /* collect IPv4 data */ if (ipv4Choice) { @@ -1097,6 +1119,13 @@ int manualNetConfig(char * device, struct networkDeviceConfig * cfg, } } + /* user selected back, but we've saved what they entered already */ + if (answer == back) { + newtFormDestroy(f); + newtPopWindow(); + return LOADER_BACK; + } + /* we might be done now */ if (ifour != 2) { newtWinMessage(_("Missing Information"), _("Retry"), |