libnm: refactor to_dbus_fcn() for "ipv6.dns" property

The goal is to get rid of gprop_to_dbus_fcn() uses.

Note that there is a change in behavior. The "dns" GPtrArray in
NMSettingIPConfig is never NULL (the default of the boxed property),
thus the previous code always serialized the property, even the
empty list.

Now, empty dns properties are omitted from D-Bus.
This commit is contained in:
Thomas Haller
2021-06-29 21:53:55 +02:00
parent c07f617bff
commit bb5c89e017
5 changed files with 46 additions and 13 deletions

View File

@@ -65,4 +65,6 @@ GVariant *_nm_team_settings_property_to_dbus(const NMSettInfoSetting *
void _nm_team_settings_property_from_dbus_link_watchers(GVariant *dbus_value, GValue *prop_value);
GVariant *_nm_utils_ip6_dns_to_variant(const char *const *dns, gssize len);
#endif