Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   CentOS (http://www.linux-archive.org/centos/)
-   -   Always return correct network config, when kickstartNetworkUp returns 0 (#495042) (http://www.linux-archive.org/centos/295091-always-return-correct-network-config-when-kickstartnetworkup-returns-0-495042-a.html)

Martin Sivak 12-14-2009 01:45 PM

Always return correct network config, when kickstartNetworkUp returns 0 (#495042)
 
If kickstartNetworkUp finishes successfully, copy the network config to
persistent store. If we call it again with network already configured,
just return 0 and fill the net configuration from the recorded state.
---
loader2/net.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/loader2/net.c b/loader2/net.c
index 58af1db..526df3d 100644
--- a/loader2/net.c
+++ b/loader2/net.c
@@ -2424,10 +2424,14 @@ int chooseNetworkInterface(struct loaderData_s * loaderData) {
int kickstartNetworkUp(struct loaderData_s * loaderData,
struct networkDeviceConfig *netCfgPtr) {
int rc, query;
+ static struct networkDeviceConfig netCfgStore;

/* we may have networking already, so return to the caller */
if ((loaderData->ipinfo_set == 1) || (loaderData->ipv6info_set == 1)) {
logMessage(INFO, "networking already configured in kickstartNetworkUp");
+
+ /* Give the network information to the caller (#495042) */
+ memcpy(netCfgPtr, &netCfgStore, sizeof(netCfgStore));
return 0;
}

@@ -2493,6 +2497,9 @@ int kickstartNetworkUp(struct loaderData_s * loaderData,
break;
} while (1);

+ /* Store all information for possible subsequent calls (#495042) */
+ memcpy(&netCfgStore, netCfgPtr, sizeof(netCfgStore));
+
return 0;
}

--
1.6.4.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


All times are GMT. The time now is 10:00 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.