network: use the overall online state in network_is_online()
authorAlvin Šipraga <alsi@bang-olufsen.dk>
Tue, 30 Mar 2021 21:18:08 +0000 (23:18 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 19 May 2021 01:34:06 +0000 (10:34 +0900)
commit84a257ab65b0ce866e818cea202e13118056c370
tree547b0b44f2a5d87e66566acc3b8117bb1a2cd511
parentbcdcc59648dabefaed4267a2432a9e7928f93cb5
network: use the overall online state in network_is_online()

Since networkd advertises a reliable online state, use it in
network_is_online(). If for some reason networkd does not know the
online state (e.g. it does not manage any of the network interfaces),
fall back to the original best-guess logic.
src/libsystemd/sd-network/network-util.c