diff options
| author | Michael Biebl <biebl@debian.org> | 2019-07-31 10:51:42 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2019-07-31 10:51:42 +0200 |
| commit | 2e5fa45ddfbb5cffa1e78221f1cea706e2f298af (patch) | |
| tree | 86f69d36c56de3074280456eddc854a780b8e04b /src/nm-policy.c | |
| parent | 85563b7fc7ec2cd21e38debb9b28db342e2e8e7c (diff) | |
New upstream version 1.19.90 upstream/1.19.90
Diffstat (limited to 'src/nm-policy.c')
| -rw-r--r-- | src/nm-policy.c | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/src/nm-policy.c b/src/nm-policy.c index 1faba5c7..559babed 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -1,4 +1,3 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* NetworkManager -- Network link manager * * This program is free software; you can redistribute it and/or modify @@ -1847,8 +1846,7 @@ device_state_changed (NMDevice *device, } } - /* FIXME(copy-on-write-connection): avoid modifying NMConnection instances and share them via copy-on-write. */ - nm_connection_clear_secrets (nm_settings_connection_get_connection (sett_conn)); + nm_settings_connection_clear_secrets (sett_conn, FALSE, FALSE); } break; case NM_DEVICE_STATE_ACTIVATED: @@ -1859,9 +1857,7 @@ device_state_changed (NMDevice *device, /* And clear secrets so they will always be requested from the * settings service when the next connection is made. */ - - /* FIXME(copy-on-write-connection): avoid modifying NMConnection instances and share them via copy-on-write. */ - nm_connection_clear_secrets (nm_settings_connection_get_connection (sett_conn)); + nm_settings_connection_clear_secrets (sett_conn, FALSE, FALSE); } /* Add device's new IPv4 and IPv6 configs to DNS */ @@ -2400,29 +2396,22 @@ dns_config_changed (NMDnsManager *dns_manager, gpointer user_data) static void connection_updated (NMSettings *settings, NMSettingsConnection *connection, - gboolean by_user, + guint update_reason_u, gpointer user_data) { NMPolicyPrivate *priv = user_data; NMPolicy *self = _PRIV_TO_SELF (priv); - const CList *tmp_lst; - NMDevice *device = NULL; - NMDevice *dev; + NMSettingsConnectionUpdateReason update_reason = update_reason_u; + + if (NM_FLAGS_HAS (update_reason, NM_SETTINGS_CONNECTION_UPDATE_REASON_REAPPLY_PARTIAL)) { + const CList *tmp_lst; + NMDevice *device; - if (by_user) { /* find device with given connection */ - nm_manager_for_each_device (priv->manager, dev, tmp_lst) { - if (nm_device_get_settings_connection (dev) == connection) { - device = dev; - break; - } + nm_manager_for_each_device (priv->manager, device, tmp_lst) { + if (nm_device_get_settings_connection (device) == connection) + nm_device_reapply_settings_immediately (device); } - - if (device) - nm_device_reapply_settings_immediately (device); - - /* Reset auto retries back to default since connection was updated */ - nm_settings_connection_autoconnect_retries_reset (connection); } schedule_activate_all (self); |