From af2c0ef7714c8a10ae9d211497f032dd5c76fcdb Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 28 Apr 2015 12:54:23 +0200 Subject: platform: ignore routes with non-zero TOS The identifying properties of a route are (in libnl) .o_id_attrs = (ROUTE_ATTR_FAMILY | ROUTE_ATTR_TOS | ROUTE_ATTR_TABLE | ROUTE_ATTR_DST | ROUTE_ATTR_PRIO), NM ignores routes other then in table RT_TABLE_MAIN and considers only the tuple 'family,network/plen,metric' as identifying for a route. We must also ignore routes with TOS non-zero as we cannot handle those, i.e. we cannot distinguish between them. --- src/platform/nm-linux-platform.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index 65dd60f569..d831bd317f 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -3863,6 +3863,7 @@ _route_match (struct rtnl_route *rtnlroute, int family, int ifindex, gboolean in if (rtnl_route_get_type (rtnlroute) != RTN_UNICAST || rtnl_route_get_table (rtnlroute) != RT_TABLE_MAIN || + rtnl_route_get_tos (rtnlroute) != 0 || (!include_proto_kernel && rtnl_route_get_protocol (rtnlroute) == RTPROT_KERNEL) || rtnl_route_get_family (rtnlroute) != family || rtnl_route_get_nnexthops (rtnlroute) != 1 || @@ -4130,8 +4131,8 @@ ip4_route_delete (NMPlatform *platform, int ifindex, in_addr_t network, int plen } rtnl_route_set_scope ((struct rtnl_route *) route, scope); - if (cached_object) - rtnl_route_set_tos ((struct rtnl_route *) route, rtnl_route_get_tos (cached_object)); + /* we only support routes with TOS zero. As such, delete_route() is also only able to delete + * routes with tos==0. build_rtnl_route() already initializes tos properly. */ /* The following fields are also relevant when comparing the route, but the default values * are already as we want them: -- cgit v1.2.1