cli: don't use nm_utils_hwaddr_type() to stringify HWADDR

Use nm_utils_hwaddr_ntoa_len() instead of nm_utils_hwaddr_ntoa().
This makes it no longer necessary to determine the type of the MAC
address based on the address length.

This makes the GETTER more accepting towards other lengths.

Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Thomas Haller 2014-05-27 15:42:08 +02:00
parent 3cda194b44
commit c4d90c5660

View file

@ -880,8 +880,8 @@ vpn_data_item (const char *key, const char *value, gpointer user_data)
g_value_init (&val, DBUS_TYPE_G_UCHAR_ARRAY); \
g_object_get_property (G_OBJECT (setting), property_name, &val); \
array = g_value_get_boxed (&val); \
if (array) \
hwaddr = nm_utils_hwaddr_ntoa (array->data, nm_utils_hwaddr_type (array->len)); \
if (array && array->len) \
hwaddr = nm_utils_hwaddr_ntoa_len (array->data, array->len); \
g_value_unset (&val); \
return hwaddr; \
}