diff options
| author | Michael Biebl <biebl@debian.org> | 2016-01-20 16:26:51 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2016-01-20 16:26:51 +0100 |
| commit | 494f296a3baab08522617b24b1f126d8f9a17502 (patch) | |
| tree | c8ef32fb0dd1c4ff35a0b38e787abb58692de0cd /libnm-core/nm-keyfile-writer.c | |
| parent | 54f6333410ffd570e62717d9e77c5c987175e397 (diff) | |
Imported Upstream version 1.1.90 upstream/1.1.90
Diffstat (limited to 'libnm-core/nm-keyfile-writer.c')
| -rw-r--r-- | libnm-core/nm-keyfile-writer.c | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/libnm-core/nm-keyfile-writer.c b/libnm-core/nm-keyfile-writer.c index 1dac5c32..ba1736b9 100644 --- a/libnm-core/nm-keyfile-writer.c +++ b/libnm-core/nm-keyfile-writer.c @@ -28,11 +28,8 @@ #include <errno.h> #include <arpa/inet.h> #include <string.h> -#include <glib/gi18n-lib.h> #include "nm-core-internal.h" -#include "gsystem-local-alloc.h" -#include "nm-glib-compat.h" #include "nm-keyfile-internal.h" #include "nm-keyfile-utils.h" @@ -106,6 +103,24 @@ dns_writer (KeyfileWriterInfo *info, } static void +ip6_addr_gen_mode_writer (KeyfileWriterInfo *info, + NMSetting *setting, + const char *key, + const GValue *value) +{ + NMSettingIP6ConfigAddrGenMode addr_gen_mode; + gs_free char *str = NULL; + + addr_gen_mode = (NMSettingIP6ConfigAddrGenMode) g_value_get_int (value); + str = nm_utils_enum_to_str (nm_setting_ip6_config_addr_gen_mode_get_type (), + addr_gen_mode); + nm_keyfile_plugin_kf_set_string (info->keyfile, + nm_setting_get_name (setting), + key, + str); +} + +static void write_ip_values (GKeyFile *file, const char *setting_name, GPtrArray *array, @@ -560,6 +575,9 @@ static KeyWriter key_writers[] = { { NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_DNS, dns_writer }, + { NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE, + ip6_addr_gen_mode_writer }, { NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_SSID, ssid_writer }, @@ -590,8 +608,16 @@ static KeyWriter key_writers[] = { static gboolean can_omit_default_value (NMSetting *setting, const char *property) { - if (NM_IS_SETTING_VLAN (setting) && !strcmp (property, NM_SETTING_VLAN_FLAGS)) - return FALSE; + if (NM_IS_SETTING_VLAN (setting)) { + if (!strcmp (property, NM_SETTING_VLAN_FLAGS)) + return FALSE; + } else if (NM_IS_SETTING_IP6_CONFIG (setting)) { + if (!strcmp (property, NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE)) + return FALSE; + } else if (NM_IS_SETTING_WIRELESS (setting)) { + if (!strcmp (property, NM_SETTING_WIRELESS_MAC_ADDRESS_RANDOMIZATION)) + return FALSE; + } return TRUE; } |