mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-21 18:50:30 +01:00
settings: add NM_SETTINGS_UPDATE2_FLAG_BLOCK_AUTOCONNECT flag
(cherry picked from commit 8bb95a8365)
This commit is contained in:
parent
2aaecebdcc
commit
448157ccd0
3 changed files with 15 additions and 2 deletions
|
|
@ -107,7 +107,8 @@
|
|||
Provide an empty array, to use the current settings.
|
||||
@flags: optional flags argument. Currently supported flags are:
|
||||
"0x1" (to-disk),
|
||||
"0x2" (in-memory).
|
||||
"0x2" (in-memory),
|
||||
"0x20" (block-autoconnect).
|
||||
Unknown flags cause the call to fail.
|
||||
@args: optional arguments dictionary, for extensibility. Currently no
|
||||
arguments are accepted. Specifying unknown keys causes the call
|
||||
|
|
|
|||
|
|
@ -898,6 +898,10 @@ typedef enum { /*< flags >*/
|
|||
* @NM_SETTINGS_UPDATE2_FLAG_NONE: an alias for numeric zero, no flags set.
|
||||
* @NM_SETTINGS_UPDATE2_FLAG_TO_DISK: to persist the connection to disk.
|
||||
* @NM_SETTINGS_UPDATE2_FLAG_IN_MEMORY: to make the connection in-memory only.
|
||||
* @NM_SETTINGS_UPDATE2_FLAG_BLOCK_AUTOCONNECT: usually, when the connection
|
||||
* has autoconnect enabled and is modified, it becomes elegible to autoconnect
|
||||
* right away. Setting this flag, disables autoconnect until the connection
|
||||
* is manually activated.
|
||||
*
|
||||
* Since: 1.10.2
|
||||
*/
|
||||
|
|
@ -905,6 +909,7 @@ typedef enum { /*< flags >*/
|
|||
NM_SETTINGS_UPDATE2_FLAG_NONE = 0,
|
||||
NM_SETTINGS_UPDATE2_FLAG_TO_DISK = (1LL << 0),
|
||||
NM_SETTINGS_UPDATE2_FLAG_IN_MEMORY = (1LL << 1),
|
||||
NM_SETTINGS_UPDATE2_FLAG_BLOCK_AUTOCONNECT = (1LL << 5),
|
||||
} NMSettingsUpdate2Flags;
|
||||
|
||||
#endif /* __NM_DBUS_INTERFACE_H__ */
|
||||
|
|
|
|||
|
|
@ -1742,6 +1742,12 @@ update_auth_cb (NMSettingsConnection *self,
|
|||
else
|
||||
log_diff_name = info->new_settings ? "update-settings" : "write-out-to-disk";
|
||||
|
||||
if (NM_FLAGS_HAS (info->flags, NM_SETTINGS_UPDATE2_FLAG_BLOCK_AUTOCONNECT)) {
|
||||
nm_settings_connection_autoconnect_blocked_reason_set (self,
|
||||
NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_USER_REQUEST,
|
||||
TRUE);
|
||||
}
|
||||
|
||||
_update (self,
|
||||
info->new_settings,
|
||||
persist_mode,
|
||||
|
|
@ -1915,7 +1921,8 @@ impl_settings_connection_update2 (NMSettingsConnection *self,
|
|||
const NMSettingsUpdate2Flags flags = (NMSettingsUpdate2Flags) flags_u;
|
||||
|
||||
if (NM_FLAGS_ANY (flags_u, ~((guint32) (NM_SETTINGS_UPDATE2_FLAG_TO_DISK |
|
||||
NM_SETTINGS_UPDATE2_FLAG_IN_MEMORY)))) {
|
||||
NM_SETTINGS_UPDATE2_FLAG_IN_MEMORY |
|
||||
NM_SETTINGS_UPDATE2_FLAG_BLOCK_AUTOCONNECT)))) {
|
||||
error = g_error_new_literal (NM_SETTINGS_ERROR,
|
||||
NM_SETTINGS_ERROR_INVALID_ARGUMENTS,
|
||||
"Unknown flags");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue