summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-04-28 12:54:23 +0200
committerThomas Haller <thaller@redhat.com>2015-04-28 17:11:28 +0200
commitaf2c0ef7714c8a10ae9d211497f032dd5c76fcdb (patch)
treee8632953ceaf39b5aa2c41469baf43eb8fc4c8ff
parent0ea1fb4e5e8de9641c98c6ff592bca00b9887976 (diff)
downloadNetworkManager-af2c0ef7714c8a10ae9d211497f032dd5c76fcdb.tar.gz
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.
-rw-r--r--src/platform/nm-linux-platform.c5
1 files 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: