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:
@@ -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
|
||||
|
Reference in New Issue
Block a user