From d3028eed0ae686463074e58369ed9322f296ef94 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Mon, 7 Sep 2015 14:17:39 +0200 Subject: policy: react to firewall/metered changes on UPDATED_BY_USER signal Subscribe to the UPDATED_BY_USER signal (instead of UPDATED) to listen for changes to the firewall zone and metered properties of a connection since these modifications are supposed to come from user intervention. --- src/nm-policy.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/nm-policy.c b/src/nm-policy.c index 78dd865ebe..a35361f17e 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -1647,6 +1647,14 @@ static void connection_updated (NMSettings *settings, NMConnection *connection, gpointer user_data) +{ + schedule_activate_all ((NMPolicy *) user_data); +} + +static void +connection_updated_by_user (NMSettings *settings, + NMSettingsConnection *connection, + gpointer user_data) { NMPolicy *policy = (NMPolicy *) user_data; NMPolicyPrivate *priv = NM_POLICY_GET_PRIVATE (policy); @@ -1657,25 +1665,16 @@ connection_updated (NMSettings *settings, for (iter = nm_manager_get_devices (priv->manager); iter; iter = g_slist_next (iter)) { NMDevice *dev = NM_DEVICE (iter->data); - if (nm_device_get_connection (dev) == connection) { + if (nm_device_get_connection (dev) == NM_CONNECTION (connection)) { device = dev; break; } } if (device) { - firewall_update_zone (policy, connection, device); + firewall_update_zone (policy, NM_CONNECTION (connection), device); nm_device_update_metered (device); } - - schedule_activate_all (policy); -} - -static void -connection_updated_by_user (NMSettings *settings, - NMSettingsConnection *connection, - gpointer user_data) -{ /* Reset auto retries back to default since connection was updated */ nm_settings_connection_reset_autoconnect_retries (connection); } -- cgit v1.2.1