NetworkManager/src/platform/tests
Thomas Haller 2861c59116 platform: pass full route object to platform delete function
Contrary to addresses, routes have no ID. When deleting a route,
you cannot just specify certain properties like network/plen,metric.

Well, actually you can specify only certain properties, but then kernel
will treat unspecified properties as wildcard and delete the first matching
route. That is not something we want, because we need to be in control which
exact route shall be deleted.

Also, rtm_tos *must* match. Even if we like the wildcard behavior,
we would need to pass TOS to nm_platform_ip4_route_delete() to be
able to delete routes with non-zero TOS. So, while certain properties
may be omitted, some must not. See how test_ip4_route_options() was
broken.

For NetworkManager it only makes ever sense to call delete on a route,
if the route is already fully known. Which means, we only delete routes
that we have already in the platform cache (otherwise, how would we know
that there is something to delete). Because of that, no longer have separate
IPv4 and IPv6 functions. Instead, have nm_platform_ip_route_delete() which
accepts a full NMPObject from the platform cache.

The code in core doesn't jet make use of this new functionality. It will
in the future.

At least, it fixes deleting routes with differing TOS.
2017-07-25 06:44:12 +02:00
..
.gitignore platform: add nmp-object.h file 2015-06-17 11:23:51 +02:00
monitor.c build: don't add subdirectories to include search path but require qualified include 2016-11-21 14:26:37 +01:00
test-address.c platform: refactor nm_platform_ip4_address_sync() 2017-07-25 06:44:12 +02:00
test-cleanup.c platform: refactor nm_platform_ip4_address_sync() 2017-07-25 06:44:12 +02:00
test-common.c platform: pass full route object to platform delete function 2017-07-25 06:44:12 +02:00
test-common.h platform: pass full route object to platform delete function 2017-07-25 06:44:12 +02:00
test-general.c platform: refactor nm_platform_link_get_all() to return GPtrArray 2017-07-05 19:03:46 +02:00
test-link.c platform: move link accessors to NMPlatform base class 2017-07-05 18:37:39 +02:00
test-nmp-object.c platform: drop separate index for visible objects 2017-07-05 18:37:39 +02:00
test-route.c platform: pass full route object to platform delete function 2017-07-25 06:44:12 +02:00