diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index 7f309cea4f..36cbbc637a 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -120,6 +120,8 @@ return t; \ } G_STMT_END +static gboolean tun_get_properties_ifname (NMPlatform *platform, const char *ifname, NMPlatformTunProperties *props); + /****************************************************************** * libnl unility functions and wrappers ******************************************************************/ @@ -968,7 +970,7 @@ link_extract_type (NMPlatform *platform, struct rtnl_link *rtnllink, const char NMPlatformTunProperties props; guint flags; - if (nm_platform_tun_get_properties (platform, rtnl_link_get_ifindex (rtnllink), &props)) { + if (tun_get_properties_ifname (platform, rtnl_link_get_name (rtnllink), &props)) { if (!g_strcmp0 (props.mode, "tap")) return_type (NM_LINK_TYPE_TAP, "tap"); if (!g_strcmp0 (props.mode, "tun")) @@ -3064,9 +3066,8 @@ veth_get_properties (NMPlatform *platform, int ifindex, NMPlatformVethProperties } static gboolean -tun_get_properties (NMPlatform *platform, int ifindex, NMPlatformTunProperties *props) +tun_get_properties_ifname (NMPlatform *platform, const char *ifname, NMPlatformTunProperties *props) { - const char *ifname; char *path, *val; gboolean success = TRUE; @@ -3076,7 +3077,6 @@ tun_get_properties (NMPlatform *platform, int ifindex, NMPlatformTunProperties * props->owner = -1; props->group = -1; - ifname = nm_platform_link_get_name (platform, ifindex); if (!ifname || !nm_utils_iface_valid_name (ifname)) return FALSE; ifname = ASSERT_VALID_PATH_COMPONENT (ifname); @@ -3127,6 +3127,12 @@ tun_get_properties (NMPlatform *platform, int ifindex, NMPlatformTunProperties * return success; } +static gboolean +tun_get_properties (NMPlatform *platform, int ifindex, NMPlatformTunProperties *props) +{ + return tun_get_properties_ifname (platform, nm_platform_link_get_name (platform, ifindex), props); +} + static const struct nla_policy macvlan_info_policy[IFLA_MACVLAN_MAX + 1] = { [IFLA_MACVLAN_MODE] = { .type = NLA_U32 }, #ifdef MACVLAN_FLAG_NOPROMISC