diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 2acbc554f3..bee031fd1b 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -1480,6 +1480,18 @@ nm_device_get_ip_iface (NMDevice *self) return priv->ip_iface ?: priv->iface; } +const char * +nm_device_get_ip_iface_from_platform (NMDevice *self) +{ + int ifindex; + + ifindex = nm_device_get_ip_ifindex (self); + if (ifindex <= 0) + return NULL; + + return nm_platform_link_get_name (nm_device_get_platform (self), ifindex); +} + int nm_device_get_ip_ifindex (const NMDevice *self) { diff --git a/src/devices/nm-device.h b/src/devices/nm-device.h index 1778faef92..c2e3c474fb 100644 --- a/src/devices/nm-device.h +++ b/src/devices/nm-device.h @@ -485,6 +485,7 @@ int nm_device_get_ifindex (NMDevice *dev); gboolean nm_device_is_software (NMDevice *dev); gboolean nm_device_is_real (NMDevice *dev); const char * nm_device_get_ip_iface (NMDevice *dev); +const char * nm_device_get_ip_iface_from_platform (NMDevice *dev); int nm_device_get_ip_ifindex (const NMDevice *dev); const char * nm_device_get_driver (NMDevice *dev); const char * nm_device_get_driver_version (NMDevice *dev);