core: don't block a connection that was removed

Don't try to block a device/connection pair when the connection was
removed. Doing so would create a new devcon entry associated with the
connection that is being deleted.

Fixes: b73b34c3ee ('policy: track autoconnect retries per Device x Connection')
This commit is contained in:
Beniamino Galvani 2023-03-28 23:13:08 +02:00
parent 6d6bd92510
commit b3e5504972

View file

@ -1326,7 +1326,8 @@ pending_ac_state_changed(NMActiveConnection *ac, guint state, guint reason, NMPo
* device, but block the current connection to avoid an activation
* loop.
*/
if (reason != NM_ACTIVE_CONNECTION_STATE_REASON_DEVICE_DISCONNECTED) {
if (reason != NM_ACTIVE_CONNECTION_STATE_REASON_DEVICE_DISCONNECTED
&& reason != NM_ACTIVE_CONNECTION_STATE_REASON_CONNECTION_REMOVED) {
con = nm_active_connection_get_settings_connection(ac);
nm_manager_devcon_autoconnect_blocked_reason_set(
priv->manager,