net: conn_mgr: Fix disconnect with CONN_MGR_IF_NO_AUTO_DOWN unset #90015
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



Connection manager enforces non-blocking disconnect() behavior, yet in case CONN_MGR_IF_NO_AUTO_DOWN flag is not set, it'd put the interface down right after, disrupting the disconnect process.
As putting the interface down can be handled in the corresponding event handler as well, when the interface is actually disconnected, remove the conn_mgr_conn_if_auto_admin_down() call from conn_mgr_if_disconnect(). To make this work with persistence flag, introduce a new internal flag indicating that the interface is in active disconnect.
Finally, since it isn't really necessary that disconnect() API call is non-blocking, remove that requirement.
Fixes #89802