mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-29 12:40:11 +01:00
platform: filter out invisible links for cache lookup by name
Fixes: ad1d74d142
This commit is contained in:
parent
3799874664
commit
f0e295d3d7
1 changed files with 5 additions and 1 deletions
|
|
@ -1528,13 +1528,17 @@ nmp_cache_lookup_link_full (const NMPCache *cache,
|
|||
&& strlen (ifname) <= sizeof (cache_id.link_by_ifname.ifname_short)) {
|
||||
p_cache_id = nmp_cache_id_init_link_by_ifname (&cache_id, ifname);
|
||||
ifname = NULL;
|
||||
} else
|
||||
} else {
|
||||
p_cache_id = nmp_cache_id_init_object_type (&cache_id, NMP_OBJECT_TYPE_LINK, visible_only);
|
||||
visible_only = FALSE;
|
||||
}
|
||||
|
||||
list = nmp_cache_lookup_multi (cache, p_cache_id, &len);
|
||||
for (i = 0; i < len; i++) {
|
||||
obj = NMP_OBJECT_UP_CAST (list[i]);
|
||||
|
||||
if (visible_only && !nmp_object_is_visible (obj))
|
||||
continue;
|
||||
if (link_type != NM_LINK_TYPE_NONE && obj->link.type != link_type)
|
||||
continue;
|
||||
if (ifname && strcmp (ifname, obj->link.name))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue