summaryrefslogtreecommitdiff
path: root/src/NetworkManagerUtils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/NetworkManagerUtils.c')
-rw-r--r--src/NetworkManagerUtils.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c
index b2f7aa1ae2..b69864f112 100644
--- a/src/NetworkManagerUtils.c
+++ b/src/NetworkManagerUtils.c
@@ -777,6 +777,7 @@ nm_utils_match_connection (NMConnection *const*connections,
GHashTableIter s_iter, p_iter;
gpointer setting_name, setting;
gpointer property_name, value;
+ gboolean has_ip4_routes = FALSE;
diff_string = g_string_new (NULL);
g_hash_table_iter_init (&s_iter, diffs);
@@ -788,6 +789,8 @@ nm_utils_match_connection (NMConnection *const*connections,
g_string_append_printf (diff_string, "%s.%s",
(char *) setting_name,
(char *) property_name);
+ has_ip4_routes |= nm_streq (setting_name, NM_SETTING_IP4_CONFIG_SETTING_NAME)
+ && nm_streq (property_name, "routes");
}
}
@@ -795,6 +798,34 @@ nm_utils_match_connection (NMConnection *const*connections,
nm_connection_get_id (original),
nm_connection_get_id (candidate),
diff_string->str);
+
+ if (has_ip4_routes) {
+ NMSettingIPConfig *s_ip;
+ NMIPRoute *r;
+ guint i;
+
+ nm_log_dbg (LOGD_CORE, ">>>>>>> DIFF");
+
+ s_ip = nm_connection_get_setting_ip4_config (original);
+ if (s_ip) {
+ for (i = 0; i < nm_setting_ip_config_get_num_routes (s_ip); i++) {
+ r = nm_setting_ip_config_get_route (s_ip, i);
+ nm_log_dbg (LOGD_CORE, ">>>ORIG[%u]: %s/%u via %s", i,
+ nm_ip_route_get_dest (r), nm_ip_route_get_prefix (r), nm_ip_route_get_next_hop (r) ?: "(none)");
+ }
+ } else
+ nm_log_dbg (LOGD_CORE, ">>>ORIG: no setting");
+
+ s_ip = nm_connection_get_setting_ip4_config (candidate);
+ if (s_ip) {
+ for (i = 0; i < nm_setting_ip_config_get_num_routes (s_ip); i++) {
+ r = nm_setting_ip_config_get_route (s_ip, i);
+ nm_log_dbg (LOGD_CORE, ">>>CAND[%u]: %s/%u via %s", i,
+ nm_ip_route_get_dest (r), nm_ip_route_get_prefix (r), nm_ip_route_get_next_hop (r) ?: "(none)");
+ }
+ } else
+ nm_log_dbg (LOGD_CORE, ">>>CAND: no setting");
+ }
g_string_free (diff_string, TRUE);
}