[network-manager-applet] Revert "Revert "editor: support IPv6 DHCP-only configurations"" (rh #612445)



commit 90be64b2c44a903cbe2cabe12307ae078ed29cf9
Author: Dan Williams <dcbw redhat com>
Date:   Tue Jul 27 21:28:47 2010 -0700

    Revert "Revert "editor: support IPv6 DHCP-only configurations"" (rh #612445)
    
    This reverts commit c4ae3843be35c1118c50c1a3e28aea1637d2b803.
    
    Turns out we can do DHCPv6 only.

 src/connection-editor/page-ip6.c |   29 ++++++++++++++++++++++++++---
 1 files changed, 26 insertions(+), 3 deletions(-)
---
diff --git a/src/connection-editor/page-ip6.c b/src/connection-editor/page-ip6.c
index cb4cd5c..cc9d95a 100644
--- a/src/connection-editor/page-ip6.c
+++ b/src/connection-editor/page-ip6.c
@@ -33,6 +33,8 @@
 
 #include <nm-setting-connection.h>
 #include <nm-setting-ip6-config.h>
+#include <nm-setting-wired.h>
+#include <nm-setting-wireless.h>
 #include <nm-setting-gsm.h>
 #include <nm-setting-cdma.h>
 #include <nm-setting-pppoe.h>
@@ -94,9 +96,10 @@ typedef struct {
 #define IP6_METHOD_IGNORE          0
 #define IP6_METHOD_AUTO            1
 #define IP6_METHOD_AUTO_ADDRESSES  2
-#define IP6_METHOD_MANUAL          3
-#define IP6_METHOD_LINK_LOCAL      4
-#define IP6_METHOD_SHARED          5
+#define IP6_METHOD_AUTO_DHCP_ONLY  3
+#define IP6_METHOD_MANUAL          4
+#define IP6_METHOD_LINK_LOCAL      5
+#define IP6_METHOD_SHARED          6
 
 static void
 ip6_private_init (CEPageIP6 *self, NMConnection *connection)
@@ -161,6 +164,17 @@ ip6_private_init (CEPageIP6 *self, NMConnection *connection)
 						METHOD_COL_ENABLED, TRUE,
 	                    -1);
 
+	/* DHCP only used on wifi and wired for now */
+	if (   priv->connection_type == NM_TYPE_SETTING_WIRED
+	    || priv->connection_type == NM_TYPE_SETTING_WIRELESS) {
+		gtk_list_store_append (priv->method_store, &iter);
+		gtk_list_store_set (priv->method_store, &iter,
+		                    METHOD_COL_NAME, _("Automatic, DHCP only"),
+		                    METHOD_COL_NUM, IP6_METHOD_AUTO_DHCP_ONLY,
+							METHOD_COL_ENABLED, TRUE,
+		                    -1);
+	}
+
 	/* Manual is pointless for Mobile Broadband */
 	if (   priv->connection_type != NM_TYPE_SETTING_GSM
 	    && priv->connection_type != NM_TYPE_SETTING_CDMA
@@ -242,6 +256,10 @@ method_changed (GtkComboBox *combo, gpointer user_data)
 		addr_enabled = FALSE;
 		dns_enabled = routes_enabled = TRUE;
 		break;
+	case IP6_METHOD_AUTO_DHCP_ONLY:
+		addr_enabled = FALSE;
+		routes_enabled = TRUE;
+		break;
 	case IP6_METHOD_MANUAL:
 		addr_enabled = dns_enabled = routes_enabled = TRUE;
 		break;
@@ -318,6 +336,8 @@ populate_ui (CEPageIP6 *self)
 	if (str_method) {
 		if (!strcmp (str_method, NM_SETTING_IP6_CONFIG_METHOD_AUTO))
 			method = IP6_METHOD_AUTO;
+		if (!strcmp (str_method, NM_SETTING_IP6_CONFIG_METHOD_DHCP))
+			method = IP6_METHOD_AUTO_DHCP_ONLY;
 		else if (!strcmp (str_method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL))
 			method = IP6_METHOD_LINK_LOCAL;
 		else if (!strcmp (str_method, NM_SETTING_IP6_CONFIG_METHOD_MANUAL))
@@ -847,6 +867,9 @@ ui_to_setting (CEPageIP6 *self)
 	case IP6_METHOD_SHARED:
 		method = NM_SETTING_IP6_CONFIG_METHOD_SHARED;
 		break;
+	case IP6_METHOD_AUTO_DHCP_ONLY:
+		method = NM_SETTING_IP6_CONFIG_METHOD_DHCP;
+		break;
 	case IP6_METHOD_AUTO_ADDRESSES:
 		ignore_auto_dns = TRUE;
 		/* fall through */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]