mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-03 17:30:16 +01:00
ifcfg-rh: avoid duplicate cache lookup in is_wifi_device()
This commit is contained in:
parent
da10058118
commit
6580f2931d
1 changed files with 4 additions and 6 deletions
|
|
@ -5231,16 +5231,14 @@ is_vlan_device (const char *name, shvarFile *parsed)
|
|||
static gboolean
|
||||
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 (parsed != NULL, FALSE);
|
||||
|
||||
ifindex = nm_platform_link_get_ifindex (NM_PLATFORM_GET, name);
|
||||
if (ifindex == 0)
|
||||
return FALSE;
|
||||
|
||||
return nm_platform_link_get_type (NM_PLATFORM_GET, ifindex) == NM_LINK_TYPE_WIFI;
|
||||
pllink = nm_platform_link_get_by_ifname (NM_PLATFORM_GET, name);
|
||||
return pllink
|
||||
&& pllink->type == NM_LINK_TYPE_WIFI;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue