GNOME Bugzilla – Bug 740140
deal with naive clients failing to recognize new properties
Last modified: 2014-11-15 14:54:15 UTC
As discussed on IRC yesterday, we have a problem where non-libnm-based clients might do something like: settings = conn.GetSettings() settings['ipv4']['addresses'].push(myNewIPAddress) conn.Update(settings) which currently would end up having no effect, because the 'address-data' element in settings will take precedence over 'addresses'. The danw/compat-props-bgoXXXXXX branch fixes this by making the (libnm) client side not send the legacy properties, and making the daemon side prefer the legacy properties to the new ones if both are set (under the assumption that any client sending both of them doesn't realize that it's sending redundant data). (We had talked before about having the client set some 'yes-i-actually-meant-to-send-address-data' property, but it seemed wrong to force clients to have to jump through an extra hoop if they want to use the preferred properties.) (This also ends up highlighting a bit of weirdness in NMSettingIPConfig where the :addresses property sort of represents the "addresses" D-Bus property and sort of represents the "address-data" property. I need to fix that better at some point.)
The branch looks good to me, but I think we should add some code-doc to the legacy NMSetting properties that say that for backwards compat, the legacy properties are preferred if both are sent. Clients that wish to use '*-data' should not send the legacy properties at all.
(In reply to comment #1) > The branch looks good to me, but I think we should add some code-doc to the > legacy NMSetting properties that say that for backwards compat, the legacy > properties are preferred if both are sent. Clients that wish to use '*-data' > should not send the legacy properties at all. Well, at the moment we're not documenting address-data and route-data at all, since the docs are still generated from libnm-util. It's on my todo list...