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:22:54 +0100 |
commit | 5843538252c589cdbde46a96f7780cdd9c0485b8 (patch) | |
tree | 1c06c898bdfa7fd6701cfd58387d50bff9d513aa | |
parent | f72c54a2cca791d166a7bc37f2c317b6dd6bc204 (diff) | |
download | NetworkManager-5843538252c589cdbde46a96f7780cdd9c0485b8.tar.gz |
platform: filter out invisible links for cache lookup by name
Fixes: ad1d74d142606e6ba434051a85cebad6bded69e8
(cherry picked from commit f0e295d3d746eb1350e0af263263e683a7bb7746)
(cherry picked from commit 5cd90717ad00caa75fdeaf1adb5d7c7b96dd40df)
-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 993c23d676..d990fe37ba 100644 --- a/src/platform/nmp-object.c +++ b/src/platform/nmp-object.c @@ -1540,13 +1540,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)) |