summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiří Klimeš <jklimes@redhat.com>2015-08-27 17:24:36 +0200
committerJiří Klimeš <jklimes@redhat.com>2015-08-28 13:58:36 +0200
commitcefc99ee5a04809ad4dad341887de74046b60ef9 (patch)
tree08826fcc94e6f98f375810142b27c06f9e429615
parenta922d5e58798e8a243c13bcc3f5286a50e674ec5 (diff)
downloadNetworkManager-jk/vlan-reorder-hdr-rh1250225.tar.gz
libnm/vlan: default to vlan.flags=REORDER_HDR for new connection (rh #1250225)jk/vlan-reorder-hdr-rh1250225
The kernel defaults REORDER_HDR to 1 when creating a new VLAN, but NetworkManager's VLAN flags property defaults to 0 and thus REORDER_HDR is not set by default for default NM created VLANs. We want to match kernel defaults (only for newly created connection). So we set REORDER_HDR if the flag is not present in D-Bus hash. https://bugzilla.redhat.com/show_bug.cgi?id=1250225
-rw-r--r--libnm-core/nm-setting-vlan.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/libnm-core/nm-setting-vlan.c b/libnm-core/nm-setting-vlan.c
index dd3746a83d..cbdc0a1bf4 100644
--- a/libnm-core/nm-setting-vlan.c
+++ b/libnm-core/nm-setting-vlan.c
@@ -558,6 +558,20 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
return TRUE;
}
+static void
+nm_setting_vlan_no_flags (NMSetting *setting,
+ GVariant *connection_dict,
+ const char *property)
+{
+ /* We want to default to REORDER_HDR flag in order to be compatible
+ * with kernel default setting, see rh #1250225. */
+ guint32 flags = NM_VLAN_FLAG_REORDER_HEADERS;
+
+ g_object_set (G_OBJECT (setting),
+ NM_SETTING_VLAN_FLAGS, flags,
+ NULL);
+}
+
static GSList *
priority_strv_to_maplist (NMVlanPriorityMap map, char **strv)
{
@@ -753,6 +767,11 @@ nm_setting_vlan_class_init (NMSettingVlanClass *setting_class)
G_PARAM_CONSTRUCT |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS));
+ _nm_setting_class_override_property (parent_class, NM_SETTING_VLAN_FLAGS,
+ NULL,
+ NULL,
+ NULL,
+ nm_setting_vlan_no_flags);
/**
* NMSettingVlan:ingress-priority-map: