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 > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 07-16-2010, 03:05 PM
Radek Vykydal
 
Default Support for ks: --ipv6 command, and ipv6 values for --gateway (#490794)

---
loader/net.c | 40 ++++++++++++++++++++++++++++++++++++++--
1 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/loader/net.c b/loader/net.c
index c5bf2e5..0a15224 100644
--- a/loader/net.c
+++ b/loader/net.c
@@ -1516,18 +1516,26 @@ void setKickstartNetwork(struct loaderData_s * loaderData, int argc,
char ** argv) {
iface_t iface;
gchar *bootProto = NULL, *device = NULL, *class = NULL, *ethtool = NULL;
- gchar *essid = NULL, *wepkey = NULL, *onboot = NULL;
+ gchar *essid = NULL, *wepkey = NULL, *onboot = NULL, *gateway = NULL;
gint mtu = 1500, dhcpTimeout = -1;
gboolean noipv4 = FALSE, noipv6 = FALSE, noDns = FALSE, noksdev = FALSE;
GOptionContext *optCon = g_option_context_new(NULL);
GError *optErr = NULL;
+ struct in_addr addr;
+#ifdef ENABLE_IPV6
+ struct in6_addr addr6;
+#endif
+ int rc;
GOptionEntry ksOptions[] = {
{ "bootproto", 0, 0, G_OPTION_ARG_STRING, &bootProto, NULL, NULL },
{ "device", 0, 0, G_OPTION_ARG_STRING, &device, NULL, NULL },
{ "dhcpclass", 0, 0, G_OPTION_ARG_STRING, &class, NULL, NULL },
- { "gateway", 'g', 0, G_OPTION_ARG_STRING, &loaderData->gateway,
+ { "gateway", 'g', 0, G_OPTION_ARG_STRING, &gateway,
NULL, NULL },
{ "ip", 'i', 0, G_OPTION_ARG_STRING, &loaderData->ipv4, NULL, NULL },
+#ifdef ENABLE_IPV6
+ { "ipv6", 0, 0, G_OPTION_ARG_STRING, &loaderData->ipv6, NULL, NULL },
+#endif
{ "mtu", 0, 0, G_OPTION_ARG_INT, &mtu, NULL, NULL },
{ "nameserver", 'n', 0, G_OPTION_ARG_STRING, &loaderData->dns,
NULL, NULL },
@@ -1579,6 +1587,30 @@ void setKickstartNetwork(struct loaderData_s * loaderData, int argc,
bootProto);
}

+ /* --gateway is common for ipv4 and ipv6, same as in loader UI */
+ if (gateway) {
+ if ((rc = inet_pton(AF_INET, gateway, &addr)) == 1) {
+ loaderData->gateway = strdup(gateway);
+ } else if (rc == 0) {
+#ifdef ENABLE_IPV6
+ if ((rc = inet_pton(AF_INET6, gateway, &addr6)) == 1) {
+ loaderData->gateway6 = strdup(gateway);
+ } else if (rc == 0) {
+#endif
+ logMessage(WARNING,
+ "invalid address in kickstart --gateway");
+#ifdef ENABLE_IPV6
+ } else {
+ logMessage(ERROR, "%s (%d): %s", __func__, __LINE__,
+ strerror(errno));
+ }
+#endif
+ } else {
+ logMessage(ERROR, "%s (%d): %s", __func__, __LINE__,
+ strerror(errno));
+ }
+ }
+
if (!noksdev) {
if (device) {
/* If --device=MAC was given, translate into a device name now. */
@@ -1626,6 +1658,10 @@ void setKickstartNetwork(struct loaderData_s * loaderData, int argc,
#ifdef ENABLE_IPV6
if (noipv6)
flags |= LOADER_FLAGS_NOIPV6;
+
+ if (loaderData->ipv6) {
+ loaderData->ipv6info_set = 1;
+ }
#endif
}

--
1.6.0.6

_______________________________________________
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 08:46 AM.

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