summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-02-01 15:13:17 +0100
committerTom Gundersen <teg@jklm.no>2015-02-02 11:57:52 +0100
commit5d8689d749ffc50ade3d5c8598c1d3d11f5240f2 (patch)
treeed0a7b56c1b17ab1c0b6c5aeb241461ad91f91d2
parent3cc711193df8f11daf30c918ec2dc4c0bfe04715 (diff)
networkd-wait-online: support globbing for ignored devices
-rw-r--r--TODO2
-rw-r--r--src/network/networkd-wait-online-manager.c8
2 files changed, 6 insertions, 4 deletions
diff --git a/TODO b/TODO
index e9615cc071..1d9ca394c9 100644
--- a/TODO
+++ b/TODO
@@ -34,8 +34,6 @@ External:
Features:
-* network-wait-online should support globbing for interfaces.
-
* network-wait-online should have a configurable timeout, maybe as --timeout-usec=
* The udev blkid built-in should expose a property that reflects
diff --git a/src/network/networkd-wait-online-manager.c b/src/network/networkd-wait-online-manager.c
index c66470c3e2..d1273725f0 100644
--- a/src/network/networkd-wait-online-manager.c
+++ b/src/network/networkd-wait-online-manager.c
@@ -21,6 +21,7 @@
#include <netinet/ether.h>
#include <linux/if.h>
+#include <fnmatch.h>
#include "rtnl-util.h"
@@ -32,14 +33,17 @@
#include "util.h"
bool manager_ignore_link(Manager *m, Link *link) {
+ char **ignore;
+
assert(m);
assert(link);
if (link->flags & IFF_LOOPBACK)
return true;
- if (strv_contains(m->ignore, link->ifname))
- return true;
+ STRV_FOREACH(ignore, m->ignore)
+ if (fnmatch(*ignore, link->ifname, 0) == 0)
+ return true;
return false;
}