]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/network/networkd-wait-online-manager.c
Merge pull request #1700 from ssahani/word
[thirdparty/systemd.git] / src / network / networkd-wait-online-manager.c
index 7a557a728e47eafd419e1f2fb3a99f7a7d52370f..0c40ab2bb8ae3fda778da480fd45a293e29b0141 100644 (file)
 #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;
@@ -38,9 +37,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;