From: Tom Gundersen Date: Tue, 28 Jul 2015 23:41:24 +0000 (+0200) Subject: networkd-wait-online: only consider interfaces given on the commandline X-Git-Tag: v224~21^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=be0c13707dbbc08fb842dbf1cfe162d8cc8cb479;p=thirdparty%2Fsystemd.git networkd-wait-online: only consider interfaces given on the commandline If some interfaces are given on the commandline, ignore all others. --- diff --git a/man/systemd-networkd-wait-online.service.xml b/man/systemd-networkd-wait-online.service.xml index f53b337daab..bcc5776a8d5 100644 --- a/man/systemd-networkd-wait-online.service.xml +++ b/man/systemd-networkd-wait-online.service.xml @@ -80,7 +80,8 @@ several interfaces which will be configured, but a particular one is necessary to access some network resources. This option may be used more than once to wait for multiple network - interfaces. + interfaces. When used, all other interfaces are ignored. + diff --git a/src/network/networkd-wait-online-manager.c b/src/network/networkd-wait-online-manager.c index 7a557a728e4..112d92a568a 100644 --- a/src/network/networkd-wait-online-manager.c +++ b/src/network/networkd-wait-online-manager.c @@ -38,9 +38,15 @@ bool manager_ignore_link(Manager *m, Link *link) { assert(m); assert(link); + /* always ignore the loopback interface */ if (link->flags & IFF_LOOPBACK) return true; + /* if interfaces are given on the command line, ignore all others */ + if (m->interfaces && !strv_contains(m->interfaces, link->ifname)) + return true; + + /* ignore interfaces we explicitly are asked to ignore */ STRV_FOREACH(ignore, m->ignore) if (fnmatch(*ignore, link->ifname, 0) == 0) return true;