]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network/link: Fix logic error in matching devices by MAC
authorDave Reisner <dreisner@archlinux.org>
Sat, 7 Jul 2018 09:39:01 +0000 (05:39 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 7 Jul 2018 11:48:59 +0000 (13:48 +0200)
Prior to this commit, a .link file with a [Match] section containing
MACAddress= would match any device without a MAC. This restores the
matching logic prior to e90d037.

src/libsystemd-network/network-internal.c

index 0849b44ee295b2985067eb2ef53e7776698d216a..9d16d6c747ac46949f5a2bbad07b28e809dadbd9 100644 (file)
@@ -124,7 +124,7 @@ bool net_match_config(Set *match_mac,
         if (match_arch && condition_test(match_arch) <= 0)
                 return false;
 
-        if (match_mac && dev_mac && !set_contains(match_mac, dev_mac))
+        if (match_mac && (!dev_mac || !set_contains(match_mac, dev_mac)))
                 return false;
 
         if (!net_condition_test_strv(match_paths, dev_path))