libnm: add flag to map zero to NULL in _nm_utils_ipaddr_canonical_or_invalid()

This seems a questionable thing to do, and should be made clearer by
having a parameter (that makes you think about what is happening here).

Also, the normalization for vxlan.remote does not perform this mapping,
so the parameter is there so that the approach can handle both flavors.
This commit is contained in:
Thomas Haller
2022-01-05 13:37:12 +01:00
parent 1f58244268
commit 5e7400c832
6 changed files with 21 additions and 8 deletions

View File

@@ -44,7 +44,8 @@ void _nm_utils_bytes_from_dbus(GVariant *dbus_value, GValue *prop_value);
char *_nm_utils_hwaddr_canonical_or_invalid(const char *mac, gssize length);
char *_nm_utils_ipaddr_canonical_or_invalid(int addr_family, const char *ip);
char *
_nm_utils_ipaddr_canonical_or_invalid(int addr_family, const char *ip, gboolean map_zero_to_null);
gboolean _nm_utils_hwaddr_link_local_valid(const char *mac);