]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev/net: drop .link files earlier when their conditions do not match system environment
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 25 Feb 2019 02:54:50 +0000 (11:54 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 25 Feb 2019 02:54:50 +0000 (11:54 +0900)
src/udev/net/link-config.c

index 7065ec7432ec98702ab8fc88cfa70771df4fd9b2..b25fa1acde427b6b741656c2b4ed9a897b0d07c9 100644 (file)
@@ -165,6 +165,14 @@ static int load_link(link_config_ctx *ctx, const char *filename) {
         if (link->speed > UINT_MAX)
                 return -ERANGE;
 
+        if (!net_match_config(NULL, NULL, NULL, NULL, NULL,
+                              link->match_host, link->match_virt, link->match_kernel_cmdline,
+                              link->match_kernel_version, link->match_arch,
+                              NULL, NULL, NULL, NULL, NULL)) {
+                log_debug("%s: Conditions do not match the system environment, skipping.", filename);
+                return 0;
+        }
+
         log_debug("Parsed configuration file %s", filename);
 
         LIST_PREPEND(links, ctx->links, link);