]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkd-wait-online: only consider interfaces given on the commandline
authorTom Gundersen <teg@jklm.no>
Tue, 28 Jul 2015 23:41:24 +0000 (01:41 +0200)
committerDaniel Mack <daniel@zonque.org>
Wed, 29 Jul 2015 18:30:50 +0000 (20:30 +0200)
If some interfaces are given on the commandline, ignore all others.

man/systemd-networkd-wait-online.service.xml
src/network/networkd-wait-online-manager.c

index f53b337daab7d57d70c215c690c68de772adeef6..bcc5776a8d51aa74fe09366f19ea677805b9118d 100644 (file)
@@ -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.</para></listitem>
+        interfaces. When used, all other interfaces are ignored.
+        </para></listitem>
       </varlistentry>
       <varlistentry>
         <term><option>--ignore=</option></term>
index 7a557a728e47eafd419e1f2fb3a99f7a7d52370f..112d92a568a74f4b2449dceec4bb61ac35068870 100644 (file)
@@ -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;