summaryrefslogtreecommitdiff
path: root/src/network/networkd-netdev.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-02-20 19:56:50 +0100
committerTom Gundersen <teg@jklm.no>2014-02-20 22:12:25 +0100
commitc0dda18697e0994272c0c9616d36f6777b60e2c7 (patch)
tree736fc238bdc6278dc82ecce6dd05cd087130bf58 /src/network/networkd-netdev.c
parent2cc412b59353576cece2d5b30c6a39c70552f0a0 (diff)
networkd: netdev - allow filtering on kernel cmdline, host and virt
Diffstat (limited to 'src/network/networkd-netdev.c')
-rw-r--r--src/network/networkd-netdev.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/network/networkd-netdev.c b/src/network/networkd-netdev.c
index ea6da69beb..773163d76c 100644
--- a/src/network/networkd-netdev.c
+++ b/src/network/networkd-netdev.c
@@ -337,8 +337,8 @@ static int netdev_load_one(Manager *manager, const char *filename) {
netdev->kind = _NETDEV_KIND_INVALID;
netdev->vlanid = VLANID_MAX + 1;
- r = config_parse(NULL, filename, file, "NetDev\0VLAN\0", config_item_perf_lookup,
- (void*) network_gperf_lookup, false, false, netdev);
+ r = config_parse(NULL, filename, file, "Match\0NetDev\0VLAN\0", config_item_perf_lookup,
+ (void*) network_netdev_gperf_lookup, false, false, netdev);
if (r < 0) {
log_warning("Could not parse config file %s: %s", filename, strerror(-r));
return r;
@@ -363,6 +363,12 @@ static int netdev_load_one(Manager *manager, const char *filename) {
if (!netdev->filename)
return log_oom();
+ if (net_match_config(NULL, NULL, NULL, NULL, NULL,
+ netdev->condition_host, netdev->condition_virt,
+ netdev->condition_kernel, NULL, NULL, NULL,
+ NULL, NULL) <= 0)
+ return 0;
+
r = hashmap_put(netdev->manager->netdevs, netdev->name, netdev);
if (r < 0)
return r;