diff options
author | Thomas Haller <thaller@redhat.com> | 2017-03-09 14:48:46 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-03-09 15:12:43 +0100 |
commit | f0e295d3d746eb1350e0af263263e683a7bb7746 (patch) | |
tree | f9bcdd73243a5cb736861ec89e5d8bd5560a167d | |
parent | 379987466409e99abd01eef8f281c3e1e39dc67d (diff) | |
download | NetworkManager-f0e295d3d746eb1350e0af263263e683a7bb7746.tar.gz |
platform: filter out invisible links for cache lookup by name
Fixes: ad1d74d142606e6ba434051a85cebad6bded69e8
-rw-r--r-- | src/platform/nmp-object.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/platform/nmp-object.c b/src/platform/nmp-object.c index 0965ee9dfc..97df90f532 100644 --- a/src/platform/nmp-object.c +++ b/src/platform/nmp-object.c @@ -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)) |