ppp-manager: don't modify the applied connection

The applied connection must not be modified during the activation. If
the PPP setting needs to be changed when activating a PPPoE
connection, make a copy to prevent the following error:

 could not get secrets:
 GDBus.Error:org.freedesktop.NetworkManager.Settings.Failed:
 The connection was modified since activation

https://bugzilla.redhat.com/show_bug.cgi?id=1324895
(cherry picked from commit 76309ebe79)
This commit is contained in:
Beniamino Galvani 2016-04-07 23:24:14 +02:00
parent d9e9a89170
commit ae879bdeba

View file

@ -1064,8 +1064,14 @@ nm_ppp_manager_start (NMPPPManager *manager,
}
pppoe_setting = nm_connection_get_setting_pppoe (connection);
if (pppoe_setting)
if (pppoe_setting) {
/* We can't modify the applied connection's setting, make a copy */
if (!s_ppp_created) {
s_ppp = NM_SETTING_PPP (nm_setting_duplicate ((NMSetting *) s_ppp));
s_ppp_created = TRUE;
}
pppoe_fill_defaults (s_ppp);
}
adsl_setting = (NMSettingAdsl *) nm_connection_get_setting (connection, NM_TYPE_SETTING_ADSL);