diff options
author | Thomas Haller <thaller@redhat.com> | 2017-07-11 16:38:49 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-07-25 06:57:26 +0200 |
commit | 39b947fc7f72631df4e6bd0d671484a606c6637c (patch) | |
tree | 6f2d3d17d3285c1d73302e93a34d73797a18ca38 | |
parent | b72b8ef34c1f4ed3b8a897ae80089ed573b6fb1e (diff) | |
download | NetworkManager-39b947fc7f72631df4e6bd0d671484a606c6637c.tar.gz |
platform: fix return value for do_delete_object()
The return value for the delete methods checks whether the object
is actually deleted. That is questionable behavior, because if the netlink
request succeeds, there is little point in checking with the platform cache.
As it is, it is racy.
Anyway, the previous value was totally wrong.
But it also uncovers another platform bug, which currently breaks
route tests. Will be fixed next.
(cherry picked from commit 5b09f7151b65304166aa8ffcf0de3fdc0865fa17)
-rw-r--r-- | src/platform/nm-linux-platform.c | 2 | ||||
-rw-r--r-- | src/platform/tests/test-route.c | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index 487725e416..6b84c185f8 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -4230,7 +4230,7 @@ out: /* such an object still exists in the cache. To be sure, refetch it (and * hope it's gone) */ do_request_one_type (platform, NMP_OBJECT_GET_TYPE (obj_id)); - return !!nmp_cache_lookup_obj (priv->cache, obj_id); + return !nmp_cache_lookup_obj (priv->cache, obj_id); } static WaitForNlResponseResult diff --git a/src/platform/tests/test-route.c b/src/platform/tests/test-route.c index 6862f13e02..9960d867a6 100644 --- a/src/platform/tests/test-route.c +++ b/src/platform/tests/test-route.c @@ -421,7 +421,8 @@ test_ip4_route_options (void) nmtst_platform_ip4_routes_equal ((NMPlatformIP4Route *) routes->data, rts, routes->len, TRUE); /* Remove route */ - g_assert (nm_platform_ip4_route_delete (NM_PLATFORM_GET, ifindex, network, 24, 20)); + /* FIXME. Due to a bug, we cannot delete routes with non-zero TOS. See bgo#785004. */ + //g_assert (nm_platform_ip4_route_delete (NM_PLATFORM_GET, ifindex, network, 24, 20)); g_array_unref (routes); } |