Commit 9294b42b authored by Thomas Haller's avatar Thomas Haller

ifcfg-rh: avoid duplicate cache lookup in is_wifi_device()

(cherry picked from commit 6580f293)
parent 10502f17
...@@ -5231,16 +5231,14 @@ is_vlan_device (const char *name, shvarFile *parsed) ...@@ -5231,16 +5231,14 @@ is_vlan_device (const char *name, shvarFile *parsed)
static gboolean static gboolean
is_wifi_device (const char *name, shvarFile *parsed) is_wifi_device (const char *name, shvarFile *parsed)
{ {
int ifindex; const NMPlatformLink *pllink;
g_return_val_if_fail (name != NULL, FALSE); g_return_val_if_fail (name != NULL, FALSE);
g_return_val_if_fail (parsed != NULL, FALSE); g_return_val_if_fail (parsed != NULL, FALSE);
ifindex = nm_platform_link_get_ifindex (NM_PLATFORM_GET, name); pllink = nm_platform_link_get_by_ifname (NM_PLATFORM_GET, name);
if (ifindex == 0) return pllink
return FALSE; && pllink->type == NM_LINK_TYPE_WIFI;
return nm_platform_link_get_type (NM_PLATFORM_GET, ifindex) == NM_LINK_TYPE_WIFI;
} }
static void static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment