mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-04 14:10:36 +01:00
libnm: adjust nm_device_get_type_description for Veth
Veth interfaces should be shown as Ethernet from nm_device_get_type_description in order to provide backward compatibility. Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
This commit is contained in:
parent
3dc202579e
commit
b19b800c95
2 changed files with 8 additions and 2 deletions
|
|
@ -1223,8 +1223,11 @@ nm_device_get_type_description(NMDevice *device)
|
|||
}
|
||||
|
||||
typename = G_OBJECT_TYPE_NAME(device);
|
||||
if (g_str_has_prefix(typename, "NMDevice"))
|
||||
if (g_str_has_prefix(typename, "NMDevice")) {
|
||||
typename += 8;
|
||||
if (nm_streq(typename, "Veth"))
|
||||
typename = "Ethernet";
|
||||
}
|
||||
priv->type_description = g_ascii_strdown(typename, -1);
|
||||
|
||||
return _nml_coerce_property_str_not_empty(priv->type_description);
|
||||
|
|
|
|||
|
|
@ -3778,8 +3778,11 @@ get_type_description(NMDevice *self)
|
|||
gs_free char *s = NULL;
|
||||
|
||||
typename = G_OBJECT_TYPE_NAME(self);
|
||||
if (g_str_has_prefix(typename, "NMDevice"))
|
||||
if (g_str_has_prefix(typename, "NMDevice")) {
|
||||
typename += 8;
|
||||
if (nm_streq(typename, "Veth"))
|
||||
typename = "Ethernet";
|
||||
}
|
||||
s = g_ascii_strdown(typename, -1);
|
||||
klass->default_type_description = g_intern_string(s);
|
||||
klass->default_type_description_klass = klass;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue