libnm: treat missing NMSettingVlan:flags property as old default value
authorThomas Haller <thaller@redhat.com>
Thu, 8 Oct 2015 08:02:48 +0000 (10:02 +0200)
committerThomas Haller <thaller@redhat.com>
Fri, 23 Oct 2015 09:23:46 +0000 (11:23 +0200)
commit21674d5bfbd7858f2a19037bfbde4f3eea8beaa6
treea1450a440e6cc0e2c34727edb5a53057c4b32bb6
parent7a14f19e0937bc7b8546dfa361f92319d5d8a351
libnm: treat missing NMSettingVlan:flags property as old default value

We changed the default value of MSettingVlan:flags from 0 to
1 (NM_VLAN_FLAG_REORDER_HEADERS). That means, that old libnm
clients will not serialize 0 (their default).
This change broke the D-Bus API. The D-Bus API allows to omit a value
when meaning the default value. That means, we cannot change the
default value (in the D-Bus API!) without breaking previous assumptions.

A newer libnm version should treat a missing flags argument as the
old default value and thus preserve the original default value (in the
D-Bus API).

This has the downside that for the future we will continue to treat a missing
value as the old default value (0), and in order to get the new default
value (1), the client must explicitly set the flags.

We also must restore the original default value in libnm-glib.
libnm-glib does not support _nm_setting_class_override_property()
and thus it must keep thinking that the default value for the GObject
property continues to be 0. Otherwise, it would not serialize a 1, which
a new libnm would now interpret as 0.

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

Fixes: 687b6515980c08cdbb9734bd112a594166c4d6dd
libnm-core/nm-setting-vlan.c
libnm-util/nm-setting-vlan.c