summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2020-09-14 09:49:28 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2020-09-14 09:49:28 +0200
commit8ad6f0c7ec841c2bf41f238585f9452b4a9db933 (patch)
tree1ae4b356493600513bbae2e3dd3d0101ab75d60a
parent6dc712652132c8f184755698f4f8e4f3e093e83a (diff)
downloadnetwork-manager-applet-bg/ip6-privacy-default.tar.gz
editor: add 'default' item to the ip6-privacy combo boxbg/ip6-privacy-default
Add missing 'default' item to the ip6-privacy combo box in the IPv6 page. The enum value is called 'unknown' in NetworkManager, but 'default' seems more clear. https://gitlab.gnome.org/GNOME/network-manager-applet/-/issues/111
-rw-r--r--src/connection-editor/ce-page-ip6.ui4
-rw-r--r--src/connection-editor/page-ip6.c15
2 files changed, 15 insertions, 4 deletions
diff --git a/src/connection-editor/ce-page-ip6.ui b/src/connection-editor/ce-page-ip6.ui
index 0323c66e..290d62f0 100644
--- a/src/connection-editor/ce-page-ip6.ui
+++ b/src/connection-editor/ce-page-ip6.ui
@@ -32,6 +32,9 @@
</columns>
<data>
<row>
+ <col id="0" translatable="yes">Default</col>
+ </row>
+ <row>
<col id="0" translatable="yes">Disabled</col>
</row>
<row>
@@ -298,6 +301,7 @@
<object class="GtkComboBox" id="ip6_privacy_combo">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes">If enabled, it makes the kernel generate a temporary IPv6 address in addition to the public one generated from MAC address. This enhances privacy, but could cause problems in some applications. If set to "Default", the value from NetworkManager global configuration is used. If that is also unset, use the kernel default value read from file "/proc/sys/net/ipv6/conf/default/use_tempaddr"</property>
<property name="hexpand">False</property>
<property name="model">model2</property>
<child>
diff --git a/src/connection-editor/page-ip6.c b/src/connection-editor/page-ip6.c
index 13cbc3cc..cf552cb1 100644
--- a/src/connection-editor/page-ip6.c
+++ b/src/connection-editor/page-ip6.c
@@ -98,9 +98,10 @@ typedef struct {
#define IP6_METHOD_SHARED 6
#define IP6_METHOD_DISABLED 7
-#define IP6_PRIVACY_DISABLED 0
-#define IP6_PRIVACY_PREFER_PUBLIC 1
-#define IP6_PRIVACY_PREFER_TEMP 2
+#define IP6_PRIVACY_UNKNOWN 0
+#define IP6_PRIVACY_DISABLED 1
+#define IP6_PRIVACY_PREFER_PUBLIC 2
+#define IP6_PRIVACY_PREFER_TEMP 3
#define IP6_ADDR_GEN_MODE_EUI64 0
#define IP6_ADDR_GEN_MODE_STABLE 1
@@ -481,6 +482,9 @@ populate_ui (CEPageIP6 *self)
/* IPv6 privacy extensions */
ip6_privacy = nm_setting_ip6_config_get_ip6_privacy (NM_SETTING_IP6_CONFIG (setting));
switch (ip6_privacy) {
+ case NM_SETTING_IP6_CONFIG_PRIVACY_UNKNOWN:
+ ip6_privacy_idx = IP6_PRIVACY_UNKNOWN;
+ break;
case NM_SETTING_IP6_CONFIG_PRIVACY_DISABLED:
ip6_privacy_idx = IP6_PRIVACY_DISABLED;
break;
@@ -491,7 +495,7 @@ populate_ui (CEPageIP6 *self)
ip6_privacy_idx = IP6_PRIVACY_PREFER_TEMP;
break;
default:
- ip6_privacy_idx = IP6_PRIVACY_DISABLED;
+ ip6_privacy_idx = IP6_PRIVACY_UNKNOWN;
break;
}
gtk_combo_box_set_active (priv->ip6_privacy_combo, ip6_privacy_idx);
@@ -1384,6 +1388,9 @@ ui_to_setting (CEPageIP6 *self, GError **error)
/* IPv6 Privacy */
switch (gtk_combo_box_get_active (priv->ip6_privacy_combo)) {
+ case IP6_PRIVACY_UNKNOWN:
+ ip6_privacy = NM_SETTING_IP6_CONFIG_PRIVACY_UNKNOWN;
+ break;
case IP6_PRIVACY_DISABLED:
ip6_privacy = NM_SETTING_IP6_CONFIG_PRIVACY_DISABLED;
break;