From 52ad194e0b816b8273dd8d0fea3e6d467f6ca34e Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Thu, 14 Dec 2017 23:22:02 +0100 Subject: New upstream version 236 --- src/network/wait-online/link.c | 3 +++ src/network/wait-online/link.h | 3 ++- src/network/wait-online/manager.c | 4 ++++ src/network/wait-online/manager.h | 1 + src/network/wait-online/wait-online.c | 1 + 5 files changed, 11 insertions(+), 1 deletion(-) (limited to 'src/network/wait-online') diff --git a/src/network/wait-online/link.c b/src/network/wait-online/link.c index bd8578cf93..f0cb70ab4c 100644 --- a/src/network/wait-online/link.c +++ b/src/network/wait-online/link.c @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ /*** This file is part of systemd. @@ -120,6 +121,8 @@ int link_update_rtnl(Link *l, sd_netlink_message *m) { int link_update_monitor(Link *l) { assert(l); + l->required_for_online = sd_network_link_get_required_for_online(l->ifindex) != 0; + l->operational_state = mfree(l->operational_state); sd_network_link_get_operational_state(l->ifindex, &l->operational_state); diff --git a/src/network/wait-online/link.h b/src/network/wait-online/link.h index c846e60c45..ab623ff4de 100644 --- a/src/network/wait-online/link.h +++ b/src/network/wait-online/link.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ #pragma once /*** @@ -32,6 +33,7 @@ struct Link { char *ifname; unsigned flags; + bool required_for_online; char *operational_state; char *state; }; @@ -40,6 +42,5 @@ int link_new(Manager *m, Link **ret, int ifindex, const char *ifname); Link *link_free(Link *l); int link_update_rtnl(Link *l, sd_netlink_message *m); int link_update_monitor(Link *l); -bool link_relevant(Link *l); DEFINE_TRIVIAL_CLEANUP_FUNC(Link*, link_free); diff --git a/src/network/wait-online/manager.c b/src/network/wait-online/manager.c index d51b0a59d6..05f030dbe7 100644 --- a/src/network/wait-online/manager.c +++ b/src/network/wait-online/manager.c @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ /*** This file is part of systemd. @@ -41,6 +42,9 @@ bool manager_ignore_link(Manager *m, Link *link) { if (m->interfaces && !strv_contains(m->interfaces, link->ifname)) return true; + if (!link->required_for_online) + return true; + /* ignore interfaces we explicitly are asked to ignore */ return strv_fnmatch(m->ignore, link->ifname, 0); } diff --git a/src/network/wait-online/manager.h b/src/network/wait-online/manager.h index 052f6b9780..7a8c4ea473 100644 --- a/src/network/wait-online/manager.h +++ b/src/network/wait-online/manager.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ #pragma once /*** diff --git a/src/network/wait-online/wait-online.c b/src/network/wait-online/wait-online.c index 268cbdb629..7b13a5d879 100644 --- a/src/network/wait-online/wait-online.c +++ b/src/network/wait-online/wait-online.c @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ /*** This file is part of systemd. -- cgit v1.2.1