diff options
author | Thomas Haller <thaller@redhat.com> | 2020-07-21 18:30:23 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-07-21 18:32:35 +0200 |
commit | 038b5780e60ab230844b6aea171e4d73ca6cfc52 (patch) | |
tree | ef1da94e33df82017c49dcdf58074bf575d8fb64 | |
parent | 441b07522d91b018befdb9c547885eea3bba07e8 (diff) | |
download | NetworkManager-038b5780e60ab230844b6aea171e4d73ca6cfc52.tar.gz |
core: use nmp_object_ip_route_is_best_defaut_route() in NMIP4Config
-rw-r--r-- | src/nm-ip4-config.c | 4 | ||||
-rw-r--r-- | src/nm-ip4-config.h | 18 |
2 files changed, 2 insertions, 20 deletions
diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c index 35e7fb8f4b..45b91300d8 100644 --- a/src/nm-ip4-config.c +++ b/src/nm-ip4-config.c @@ -400,12 +400,12 @@ _nm_ip_config_best_default_route_find_better (const NMPObject *obj_cur, const NM && NM_IN_SET (NMP_OBJECT_GET_TYPE (obj_cmp), NMP_OBJECT_TYPE_IP4_ROUTE, NMP_OBJECT_TYPE_IP6_ROUTE)) || NMP_OBJECT_GET_TYPE (obj_cur) == NMP_OBJECT_GET_TYPE (obj_cmp)); nm_assert ( !obj_cur - || nm_ip_config_best_default_route_is (obj_cur)); + || nmp_object_ip_route_is_best_defaut_route (obj_cur)); /* assumes that @obj_cur is already the best default route (or NULL). It checks whether * @obj_cmp is also a default route and returns the best of both. */ if ( obj_cmp - && nm_ip_config_best_default_route_is (obj_cmp)) { + && nmp_object_ip_route_is_best_defaut_route (obj_cmp)) { guint32 metric_cur, metric_cmp; if (!obj_cur) diff --git a/src/nm-ip4-config.h b/src/nm-ip4-config.h index f09d99134c..e57b456eb1 100644 --- a/src/nm-ip4-config.h +++ b/src/nm-ip4-config.h @@ -69,24 +69,6 @@ nm_ip_config_iter_ip4_route_next (NMDedupMultiIter *ipconf_iter, const NMPlatfor /*****************************************************************************/ -static inline gboolean -nm_ip_config_best_default_route_is (const NMPObject *obj) -{ - const NMPlatformIPRoute *r = NMP_OBJECT_CAST_IP_ROUTE (obj); - - /* return whether @obj is considered a default-route. - * - * NMIP4Config/NMIP6Config tracks the (best) default-route explicitly, because - * at various places we act differently depending on whether there is a default-route - * configured. - * - * Note that this only considers the main routing table. */ - return r - && NM_PLATFORM_IP_ROUTE_IS_DEFAULT (r) - && nm_platform_route_table_is_main (r->table_coerced) - && r->type_coerced == nm_platform_route_type_coerce (1 /*RTN_UNICAST*/); -} - const NMPObject *_nm_ip_config_best_default_route_find_better (const NMPObject *obj_cur, const NMPObject *obj_cmp); gboolean _nm_ip_config_best_default_route_merge (const NMPObject **best_default_route, const NMPObject *new_candidate); |