diff options
author | Thomas Haller <thaller@redhat.com> | 2017-06-27 10:40:28 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-07-05 14:22:10 +0200 |
commit | 3edf2bff3dd84b3235b6393b406cfb44f5c14cf1 (patch) | |
tree | c070ae5141c99ef217a35f670735aaeab99bf53c | |
parent | 0b060d9bc5f8922924c625c69ac617dd3ac6d9bf (diff) | |
download | NetworkManager-3edf2bff3dd84b3235b6393b406cfb44f5c14cf1.tar.gz |
platform: fix lookup of all routes unrestricted to an ifindex
Need to use the right NMPCacheIdType when looking up routes
across all ifindexes.
Fixes: 8f9dac01ac01a6a401a101f264b4f280c9ad4b9d
-rw-r--r-- | src/platform/nmp-object.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/platform/nmp-object.c b/src/platform/nmp-object.c index 65610b5cdc..0f0ca36e95 100644 --- a/src/platform/nmp-object.c +++ b/src/platform/nmp-object.c @@ -1110,10 +1110,20 @@ nmp_cache_id_init_routes_visible (NMPCacheId *id, return nmp_cache_id_init_object_type (id, obj_type, TRUE); return nmp_cache_id_init_addrroute_visible_by_ifindex (id, obj_type, ifindex); } + if (ifindex <= 0) { + _nmp_cache_id_init (id, NMP_CACHE_ID_TYPE_ROUTES_VISIBLE_ONLY_DEFAULT); + id->object_type.obj_type = obj_type; + return id; + } _nmp_cache_id_init (id, NMP_CACHE_ID_TYPE_ROUTES_VISIBLE_BY_IFINDEX_ONLY_DEFAULT); - } else if (with_non_default) + } else if (with_non_default) { + if (ifindex <= 0) { + _nmp_cache_id_init (id, NMP_CACHE_ID_TYPE_ROUTES_VISIBLE_NO_DEFAULT); + id->object_type.obj_type = obj_type; + return id; + } _nmp_cache_id_init (id, NMP_CACHE_ID_TYPE_ROUTES_VISIBLE_BY_IFINDEX_NO_DEFAULT); - else + } else g_return_val_if_reached (NULL); id->object_type_by_ifindex.obj_type = obj_type; |