diff options
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/net-util.c | 11 | ||||
-rw-r--r-- | src/shared/net-util.h | 1 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/shared/net-util.c b/src/shared/net-util.c index a8a2c44bae..50cfa2c3f3 100644 --- a/src/shared/net-util.c +++ b/src/shared/net-util.c @@ -42,6 +42,7 @@ bool net_match_config(const struct ether_addr *match_mac, Condition *match_arch, const char *dev_mac, const char *dev_path, + const char *dev_parent_driver, const char *dev_driver, const char *dev_type, const char *dev_name) { @@ -64,13 +65,17 @@ bool net_match_config(const struct ether_addr *match_mac, if (match_path && (!dev_path || fnmatch(match_path, dev_path, 0))) return 0; - if (match_driver && !streq_ptr(match_driver, dev_driver)) - return 0; + if (match_driver) { + if (dev_parent_driver && !streq(match_driver, dev_parent_driver)) + return 0; + else if (!streq_ptr(match_driver, dev_driver)) + return 0; + } if (match_type && !streq_ptr(match_type, dev_type)) return 0; - if (match_name && (!dev_path || fnmatch(match_name, dev_name, 0))) + if (match_name && (!dev_name || fnmatch(match_name, dev_name, 0))) return 0; return 1; diff --git a/src/shared/net-util.h b/src/shared/net-util.h index 908fb22ffa..99479e1f5c 100644 --- a/src/shared/net-util.h +++ b/src/shared/net-util.h @@ -38,6 +38,7 @@ bool net_match_config(const struct ether_addr *match_mac, Condition *match_arch, const char *dev_mac, const char *dev_path, + const char *dev_parent_driver, const char *dev_driver, const char *dev_type, const char *dev_name); |