core: remove @indicated argument of nm_utils_match_connection()

It is not needed anymore.

(cherry picked from commit 346064189a)
This commit is contained in:
Beniamino Galvani 2018-03-29 11:29:31 +02:00
parent 8d3eca7955
commit 88dfa2e42e
4 changed files with 2 additions and 26 deletions

View file

@ -773,10 +773,6 @@ check_possible_match (NMConnection *orig,
* @connections: a (optionally pre-sorted) list of connections from which to
* find a matching connection to @original based on "inferrable" properties
* @original: the #NMConnection to find a match for from @connections
* @indicated: whether the match is already hinted/indicated. That is the
* case when we found the connection in the state file from a previous run.
* In this case, we perform a relexed check, as we have a good hint
* that the connection actually matches.
* @device_has_carrier: pass %TRUE if the device that generated @original has
* a carrier, %FALSE if not
* @match_filter_func: a function to check whether each connection from @connections
@ -796,7 +792,6 @@ check_possible_match (NMConnection *orig,
NMConnection *
nm_utils_match_connection (NMConnection *const*connections,
NMConnection *original,
gboolean indicated,
gboolean device_has_carrier,
gint64 default_v4_metric,
gint64 default_v6_metric,
@ -817,24 +812,7 @@ nm_utils_match_connection (NMConnection *const*connections,
continue;
}
if (indicated) {
NMSettingConnection *s_orig, *s_cand;
s_orig = nm_connection_get_setting_connection (original);
s_cand = nm_connection_get_setting_connection (candidate);
/* It is indicated that this connection matches. Assume we have
* a match, but check for particular differences that let us
* reject the candidate. */
if (!nm_streq0 (nm_setting_connection_get_connection_type (s_orig),
nm_setting_connection_get_connection_type (s_cand)))
continue;
if (!nm_streq0 (nm_setting_connection_get_slave_type (s_orig),
nm_setting_connection_get_slave_type (s_cand)))
continue;
/* this is good enough for a match */
} else if (!nm_connection_diff (original, candidate, NM_SETTING_COMPARE_FLAG_INFERRABLE, &diffs)) {
if (!nm_connection_diff (original, candidate, NM_SETTING_COMPARE_FLAG_INFERRABLE, &diffs)) {
if (!best_match) {
best_match = check_possible_match (original, candidate, diffs, device_has_carrier,
default_v4_metric, default_v6_metric);

View file

@ -41,7 +41,6 @@ typedef gboolean (NMUtilsMatchFilterFunc) (NMConnection *connection, gpointer us
NMConnection *nm_utils_match_connection (NMConnection *const*connections,
NMConnection *original,
gboolean indicated,
gboolean device_has_carrier,
gint64 default_v4_metric,
gint64 default_v6_metric,

View file

@ -2197,7 +2197,6 @@ get_existing_connection (NMManager *self,
matched = NM_SETTINGS_CONNECTION (nm_utils_match_connection ((NMConnection *const*) connections,
connection,
FALSE,
nm_device_has_carrier (device),
nm_device_get_route_metric (device, AF_INET),
nm_device_get_route_metric (device, AF_INET6),

View file

@ -359,7 +359,7 @@ _match_connection (GSList *connections,
}
list[i] = NULL;
return nm_utils_match_connection (list, original, FALSE, device_has_carrier, default_v4_metric, default_v6_metric, NULL, NULL);
return nm_utils_match_connection (list, original, device_has_carrier, default_v4_metric, default_v6_metric, NULL, NULL);
}
static void