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

@@ -1882,9 +1882,10 @@ _new_from_nl_route (struct nlmsghdr *nlh, gboolean id_only)
*
* This happens, because this route is not nmp_object_is_alive().
* */
obj->ip_route.rt_source = _NM_IP_CONFIG_SOURCE_RTM_F_CLONED;
} else
obj->ip_route.rt_source = nmp_utils_ip_config_source_from_rtprot (rtm->rtm_protocol);
obj->ip_route.rt_cloned = TRUE;
}
obj->ip_route.rt_source = nmp_utils_ip_config_source_from_rtprot (rtm->rtm_protocol);
obj_result = obj;
obj = NULL;