Skip to content

Commit

Permalink
wait-online: ignore -ENODATA from sd_network_link_get_required_for_on…
Browse files Browse the repository at this point in the history
…line()

Follow-up for 778e3da.

These settings are saved only when a .network file is assigned to the
interface. Let's silence noisy logs for unmanaged interfaces.
  • Loading branch information
yuwata authored and bluca committed Oct 27, 2022
1 parent 7155a51 commit 6fadf01
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/network/wait-online/link.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down

0 comments on commit 6fadf01

Please sign in to comment.