diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-10-27 02:54:06 +0200 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2022-10-27 11:08:38 +0200 |
commit | 6fadf01cf3cdd98f78b7829f4c6c892306958394 (patch) | |
tree | a4eb5f73abe1b47b9a8914e9d8d7a77d69968bc4 | |
parent | Merge pull request #25146 from keszybz/relicese-to-mit-0 (diff) | |
download | systemd-6fadf01cf3cdd98f78b7829f4c6c892306958394.tar.xz systemd-6fadf01cf3cdd98f78b7829f4c6c892306958394.zip |
wait-online: ignore -ENODATA from sd_network_link_get_required_for_online()
Follow-up for 778e3da95ef16302956087e6f10ccf7d42499aec.
These settings are saved only when a .network file is assigned to the
interface. Let's silence noisy logs for unmanaged interfaces.
-rw-r--r-- | src/network/wait-online/link.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/network/wait-online/link.c b/src/network/wait-online/link.c index 836d713f79..e197e62e26 100644 --- a/src/network/wait-online/link.c +++ b/src/network/wait-online/link.c @@ -105,16 +105,16 @@ int link_update_monitor(Link *l) { assert(l->ifname); r = sd_network_link_get_required_for_online(l->ifindex); - if (r < 0) + if (r < 0 && r != -ENODATA) ret = log_link_debug_errno(l, r, "Failed to determine whether the link is required for online or not, " "assuming required: %m"); l->required_for_online = r != 0; r = sd_network_link_get_required_operstate_for_online(l->ifindex, &required_operstate); - if (r < 0) { + if (r < 0 && r != -ENODATA) ret = log_link_debug_errno(l, r, "Failed to get required operational state, ignoring: %m"); - l->required_operstate = LINK_OPERSTATE_RANGE_DEFAULT; - } else if (isempty(required_operstate)) + + if (isempty(required_operstate)) l->required_operstate = LINK_OPERSTATE_RANGE_DEFAULT; else { r = parse_operational_state_range(required_operstate, &l->required_operstate); @@ -128,9 +128,10 @@ int link_update_monitor(Link *l) { ret = log_link_debug_errno(l, r, "Failed to get operational state, ignoring: %m"); r = sd_network_link_get_required_family_for_online(l->ifindex, &required_family); - if (r < 0) + if (r < 0 && r != -ENODATA) ret = log_link_debug_errno(l, r, "Failed to get required address family, ignoring: %m"); - else if (isempty(required_family)) + + if (isempty(required_family)) l->required_family = ADDRESS_FAMILY_NO; else { AddressFamily f; |