From a1e6c1ff49ec3e400694631efa18114d676b3cc3 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 21 Feb 2023 13:08:52 +0100 Subject: [PATCH] fixup! policy: track autoconnect retries per Device x Connection The function is-blocked performs a series of checks, and when any of them is true, it returns is-blocked TRUE. It's a list of "if(check)return TRUE". Follow that pattern consistently throughout the function, and end with a return FALSE. Also, drop the blank line between checking "flags" for condition1 and condition2. Beside, make the code as it was previously. --- src/core/settings/nm-settings-connection.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/core/settings/nm-settings-connection.c b/src/core/settings/nm-settings-connection.c index 82828daf51..ad8c134a99 100644 --- a/src/core/settings/nm-settings-connection.c +++ b/src/core/settings/nm-settings-connection.c @@ -2539,17 +2539,20 @@ nm_settings_connection_autoconnect_is_blocked(NMSettingsConnection *self) g_return_val_if_fail(NM_IS_SETTINGS_CONNECTION(self), TRUE); - priv = NM_SETTINGS_CONNECTION_GET_PRIVATE(self); - flags = nm_settings_connection_get_flags(self); + priv = NM_SETTINGS_CONNECTION_GET_PRIVATE(self); + + if (priv->autoconnect_blocked_reason != NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_NONE) + return TRUE; + + flags = priv->flags; if (NM_FLAGS_ANY(flags, NM_SETTINGS_CONNECTION_INT_FLAGS_VOLATILE | NM_SETTINGS_CONNECTION_INT_FLAGS_EXTERNAL)) return TRUE; - if (!NM_FLAGS_HAS(flags, NM_SETTINGS_CONNECTION_INT_FLAGS_VISIBLE)) return TRUE; - return priv->autoconnect_blocked_reason != NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_NONE; + return FALSE; } /*****************************************************************************/