[gnome-control-center/mcatanzaro/#593: 2/2] Fix setting to disable IPv6



commit ed15c1a2f0817a0b4d7cc20c35cfcf63caf75bfe
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Thu Jul 16 11:12:14 2020 -0500

    Fix setting to disable IPv6
    
    The setting to disable IPv6 did not actually work. Instead, it just
    caused NetworkManager to ignore IPv6 entirely. From the libnm
    documentation of NM_SETTING_IP6_CONFIG_METHOD_IGNORE: "IPv6 is not
    required or is handled by some other mechanism, and NetworkManager
    should not configure IPv6 for this connection." It's just the wrong enum
    to use here.
    
    I considered adding a new radio button to use the older ignore setting,
    but it doesn't make a ton of sense since that setting allows IPv6 to be
    configured outside NetworkManager, and what is the point of exposing
    graphical configuration for that? So instead, we can have the GUI change
    the value from IGNORE to DISABLED if set.
    
    Fixes #593

 meson.build                                    |  2 +-
 panels/network/connection-editor/ce-page-ip6.c | 11 ++++++-----
 2 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/meson.build b/meson.build
index aac6789e1c..56c15767bb 100644
--- a/meson.build
+++ b/meson.build
@@ -218,7 +218,7 @@ config_h.set('HAVE_MALCONTENT', enable_malcontent,
 if host_is_linux
   # network manager
   network_manager_deps = [
-    dependency('libnm', version: '>= 1.12.0'),
+    dependency('libnm', version: '>= 1.20.0'),
     dependency('libnma', version: '>= 1.8.0'),
     dependency('mm-glib', version: '>= 0.7')
   ]
diff --git a/panels/network/connection-editor/ce-page-ip6.c b/panels/network/connection-editor/ce-page-ip6.c
index a86cd89ffb..8442841cc9 100644
--- a/panels/network/connection-editor/ce-page-ip6.c
+++ b/panels/network/connection-editor/ce-page-ip6.c
@@ -79,7 +79,7 @@ enum {
         IP6_METHOD_MANUAL,
         IP6_METHOD_LINK_LOCAL,
         IP6_METHOD_SHARED,
-        IP6_METHOD_IGNORE
+        IP6_METHOD_DISABLED
 };
 
 static void
@@ -498,8 +498,9 @@ connect_ip6_page (CEPageIP6 *self)
                 method = IP6_METHOD_MANUAL;
         } else if (g_strcmp0 (str_method, NM_SETTING_IP6_CONFIG_METHOD_SHARED) == 0) {
                 method = IP6_METHOD_SHARED;
-        } else if (g_strcmp0 (str_method, NM_SETTING_IP6_CONFIG_METHOD_IGNORE) == 0) {
-                method = IP6_METHOD_IGNORE;
+        } else if (g_strcmp0 (str_method, NM_SETTING_IP6_CONFIG_METHOD_DISABLED ||
+                   g_strcmp_0 (str_method, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) == 0) {
+                method = IP6_METHOD_DISABLED;
         }
 
         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (self->never_default_check),
@@ -528,7 +529,7 @@ connect_ip6_page (CEPageIP6 *self)
         case IP6_METHOD_SHARED:
                 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (self->shared_radio), TRUE);
                 break;
-        case IP6_METHOD_IGNORE:
+        case IP6_METHOD_DISABLED:
                 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (self->disabled_radio), TRUE);
                 break;
         default:
@@ -552,7 +553,7 @@ ui_to_setting (CEPageIP6 *self)
         guint i;
 
         if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (self->disabled_radio)))
-                method = NM_SETTING_IP6_CONFIG_METHOD_IGNORE;
+                method = NM_SETTING_IP6_CONFIG_METHOD_DISABLED;
         else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (self->manual_radio)))
                 method = NM_SETTING_IP6_CONFIG_METHOD_MANUAL;
         else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (self->local_radio)))


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