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.
This commit is contained in:
Thomas Haller 2023-02-21 13:08:52 +01:00
parent 617494614c
commit a1e6c1ff49
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -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;
}
/*****************************************************************************/