FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 01-25-2011, 05:50 PM
David Cantrell
 
Default Initialize loaderData values in kickstart network command.

Ack.

On Fri, 21 Jan 2011, Radek Vykydal wrote:


Related: rhbz#638131

This adds to my recent 11 patches. The initialization is
needed for additional network commands which used to be ignored
before in loader.

NOTE: --device option is not initialized to keep present behaviour
of using ksdevice boot option as default. For other than first
network commands handled in loader (those having new option
--activate) the device of previous network command would be used
as default, which is incorrect, but acceptable IMO because for
existing kickstarts additional commands will still be ignored
(they don't have --activate option) and for the new behaviour
we can require --device option to be obligatory. Solution
fixing this would require hack similar (more complicated)
to patch [11/11] or substantial fix of loader network configuration
code.

---
loader/net.c | 37 +++++++++++++++++++++++++++++++------
1 files changed, 31 insertions(+), 6 deletions(-)

diff --git a/loader/net.c b/loader/net.c
index 729628a..c6ffb86 100644
--- a/loader/net.c
+++ b/loader/net.c
@@ -1564,6 +1564,37 @@ void setKickstartNetwork(struct loaderData_s * loaderData, int argc,
};

iface_init_iface_t(&iface);
+ /* initialize loaderData struct */
+ /* except for --device which we want to take over from cmdline */
+ /* ksdevice for the first command */
+ free(loaderData->ipv4);
+ loaderData->ipv4 = NULL;
+ loaderData->ipinfo_set = 0;
+ free(loaderData->dns);
+ loaderData->dns = NULL;
+ free(loaderData->netmask);
+ loaderData->netmask = NULL;
+ free(loaderData->hostname);
+ loaderData->hostname = NULL;
+ free(loaderData->gateway);
+ loaderData->gateway = NULL;
+ free(loaderData->netCls);
+ loaderData->netCls = NULL;
+ loaderData->netCls_set = 0;
+ free(loaderData->ethtool);
+ loaderData->ethtool = NULL;
+ loaderData->essid = NULL;
+ free(loaderData->wepkey);
+ loaderData->wepkey = NULL;
+ loaderData->mtu = 0;
+
+#ifdef ENABLE_IPV6
+ free(loaderData->ipv6);
+ loaderData->ipv6 = NULL;
+ loaderData->ipv6info_set = 0;
+ free(loaderData->gateway6);
+ loaderData->gateway6 = NULL;
+#endif

g_option_context_set_help_enabled(optCon, FALSE);
g_option_context_add_main_entries(optCon, ksOptions, NULL);
@@ -1642,22 +1673,16 @@ void setKickstartNetwork(struct loaderData_s * loaderData, int argc,
}

if (ethtool) {
- if (loaderData->ethtool)
- free(loaderData->ethtool);
loaderData->ethtool = strdup(ethtool);
free(ethtool);
}

if (essid) {
- if (loaderData->essid)
- free(loaderData->essid);
loaderData->essid = strdup(essid);
free(essid);
}

if (wepkey) {
- if (loaderData->wepkey)
- free(loaderData->wepkey);
loaderData->wepkey = strdup(wepkey);
free(wepkey);
}



--
David Cantrell <dcantrell@redhat.com>
Supervisor, Installer Engineering Team
Red Hat, Inc. | Honolulu, HI | UTC-10

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

Thread Tools




All times are GMT. The time now is 04:45 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org