summaryrefslogtreecommitdiff
path: root/libnm-core/nm-keyfile-writer.c
diff options
context:
space:
mode:
Diffstat (limited to 'libnm-core/nm-keyfile-writer.c')
-rw-r--r--libnm-core/nm-keyfile-writer.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/libnm-core/nm-keyfile-writer.c b/libnm-core/nm-keyfile-writer.c
index ead1305534..ccf516ea12 100644
--- a/libnm-core/nm-keyfile-writer.c
+++ b/libnm-core/nm-keyfile-writer.c
@@ -29,19 +29,7 @@
#include <arpa/inet.h>
#include <string.h>
-#include "nm-default.h"
-#include "nm-setting.h"
-#include "nm-setting-connection.h"
-#include "nm-setting-ip4-config.h"
-#include "nm-setting-ip6-config.h"
-#include "nm-setting-vpn.h"
-#include "nm-setting-wired.h"
-#include "nm-setting-wireless.h"
-#include "nm-setting-ip4-config.h"
-#include "nm-setting-bluetooth.h"
-#include "nm-setting-8021x.h"
-#include "nm-utils.h"
-
+#include "nm-core-internal.h"
#include "nm-keyfile-internal.h"
#include "nm-keyfile-utils.h"
@@ -596,6 +584,15 @@ static KeyWriter key_writers[] = {
{ NULL, NULL, NULL }
};
+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;
+
+ return TRUE;
+}
+
static void
write_setting_value (NMSetting *setting,
const char *key,
@@ -626,7 +623,8 @@ write_setting_value (NMSetting *setting,
/* If the value is the default value, remove the item from the keyfile */
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (setting), key);
if (pspec) {
- if (g_param_value_defaults (pspec, (GValue *) value)) {
+ if ( can_omit_default_value (setting, key)
+ && g_param_value_defaults (pspec, (GValue *) value)) {
g_key_file_remove_key (info->keyfile, setting_name, key, NULL);
return;
}