libnm: always serialize NMSettingVlan:flags property for D-Bus

We changed the default value for the NMSettingVlan:flags from 0 to
1 (NM_VLAN_FLAG_REORDER_HEADERS). That means, we will no longer serialize
a value of 1 over D-Bus.

This breaks older libnm clients, which treat a missing flags property as
the old default (0).

-- old clients here means: clients that still use an older version of libnm
   or clients that don't use libnm, but depend on the previous default value
   in the D-Bus API.

Enforce to always serialize the flags properties. This workaround has almost
no downsides except that for new clients we serialize more then absolutely
necessary.
But it ensures that old clients still receive the proper value.

https://bugzilla.redhat.com/show_bug.cgi?id=1250225

Fixes: 687b651598
This commit is contained in:
Thomas Haller 2015-10-08 09:52:48 +02:00
parent e9bc18d2a7
commit 7a14f19e09

View file

@ -558,6 +558,12 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
return TRUE;
}
static GVariant *
_override_flags_get (NMSetting *setting, const char *property)
{
return g_variant_new_uint32 (nm_setting_vlan_get_flags ((NMSettingVlan *) setting));
}
static GSList *
priority_strv_to_maplist (NMVlanPriorityMap map, char **strv)
{
@ -753,6 +759,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,
_override_flags_get,
NULL,
NULL);
/**
* NMSettingVlan:ingress-priority-map: