platform: refactor marking cloned routes in platform

We handle cloned routes (that have rtm_flags RTM_F_CLONED) differently.
We used to mark such routes by hacking NMIPConfigSource to have a special
value. No longer do this, because it mixes different concepts.

Note that the rt_cloned filed fits into a hole in the aligment
of NMPlatformIPRoute. Thus there is almost no overhead to this
change.
This commit is contained in:
Thomas Haller
2016-04-11 15:32:45 +02:00
parent 9e83383223
commit e26fcce0f8
6 changed files with 20 additions and 10 deletions

View File

@@ -915,12 +915,12 @@ _vt_cmd_obj_is_alive_ipx_route (const NMPObject *obj)
*
* If nmp_object_from_nl() would just return NULL, we couldn't look
* into the cache to see if it contains a route that now disappears
* (because it is cloned).
* (because it changed to be cloned).
*
* Instead we create a dead object, and nmp_cache_update_netlink()
* will remove the old version of the update.
**/
return obj->object.ifindex > 0 && (obj->ip_route.rt_source != _NM_IP_CONFIG_SOURCE_RTM_F_CLONED);
return obj->object.ifindex > 0 && !obj->ip_route.rt_cloned;
}
gboolean