diff options
Diffstat (limited to 'src/network/networkd-wait-online-manager.c')
-rw-r--r-- | src/network/networkd-wait-online-manager.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/network/networkd-wait-online-manager.c b/src/network/networkd-wait-online-manager.c index 1fc724f5a4..725b3310dd 100644 --- a/src/network/networkd-wait-online-manager.c +++ b/src/network/networkd-wait-online-manager.c @@ -1,5 +1,3 @@ -/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ - /*** This file is part of systemd. @@ -23,29 +21,28 @@ #include <linux/if.h> #include <fnmatch.h> +#include "alloc-util.h" #include "netlink-util.h" - #include "network-internal.h" #include "networkd-wait-online-link.h" #include "networkd-wait-online.h" - -#include "util.h" #include "time-util.h" +#include "util.h" bool manager_ignore_link(Manager *m, Link *link) { - char **ignore; - assert(m); assert(link); + /* always ignore the loopback interface */ if (link->flags & IFF_LOOPBACK) return true; - STRV_FOREACH(ignore, m->ignore) - if (fnmatch(*ignore, link->ifname, 0) == 0) - return true; + /* if interfaces are given on the command line, ignore all others */ + if (m->interfaces && !strv_contains(m->interfaces, link->ifname)) + return true; - return false; + /* ignore interfaces we explicitly are asked to ignore */ + return strv_fnmatch(m->ignore, link->ifname, 0); } bool manager_all_configured(Manager *m) { @@ -77,7 +74,7 @@ bool manager_all_configured(Manager *m) { return false; } - if (streq(l->state, "configuring")) { + if (STR_IN_SET(l->state, "configuring", "pending")) { log_debug("link %s is being processed by networkd", l->ifname); return false; @@ -170,7 +167,7 @@ static int on_rtnl_event(sd_netlink *rtnl, sd_netlink_message *mm, void *userdat } static int manager_rtnl_listen(Manager *m) { - _cleanup_netlink_message_unref_ sd_netlink_message *req = NULL, *reply = NULL; + _cleanup_(sd_netlink_message_unrefp) sd_netlink_message *req = NULL, *reply = NULL; sd_netlink_message *i; int r; |