wait-online: make manager_link_is_online() return 0 when in unmanaged state
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 26 Jan 2022 07:48:08 +0000 (16:48 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 11 Mar 2022 12:48:49 +0000 (12:48 +0000)
commit4a141b6ab256a7e34f142a75f9257a3b7df9922a
treecb8b11ab0e7dae8717ac2d213eb912b4ba6e88d3
parent5d4fc5cb2a0d18f8a67468209227a59ec3f30b5f
wait-online: make manager_link_is_online() return 0 when in unmanaged state

Previously, even if a link is in unmanaged state, the function may
returns positive value. So, even if all managed links are in the configured
sate but do not satisfy the online criteria, e.g., IPv4 address state,
then wait-online finishes with positive value.

This makes the function always return 0 for unmanaged state. So, at
least one managed link must satisfies the online criteria.

This also adds more comments and debugging logs.

Fixes #22246.

(cherry picked from commit cd7fcda54333dc95116a434cffc591f21edddbb2)
(cherry picked from commit 056fcd4e318aa664bd36950bf6c2dae4647c96c7)
src/network/wait-online/manager.c