diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-06-30 15:56:23 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-30 15:56:23 -0700 |
commit | 2cb623954f9df6bef85bca32933c75737ddc9a88 (patch) | |
tree | 72c8d507796c30d083741ffa8cdd87aa290c93bc /src/libsystemd-network | |
parent | f15461b2b234c178ecbbc18defaef0032a9b3431 (diff) |
Fix #3236 (#3633)
* networkd: condition_test() can return a negative error, handle that
If a condition check fails with an error we should not consider the check
successful. Fix that.
We should probably also improve logging in this case, but for now, let's just
unbreak this breakage.
Fixes: #3236
* condition: handle unrecognized architectures nicer
When we encounter a check for an architecture we don't know we should not
let the condition check fail with an error code, but instead simply return
false. After all the architecture might just be newer than the ones we know, in
which case it's certainly not our local one.
Fixes: #3236
Diffstat (limited to 'src/libsystemd-network')
-rw-r--r-- | src/libsystemd-network/network-internal.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libsystemd-network/network-internal.c b/src/libsystemd-network/network-internal.c index ce30b7fc25..9d78b953fc 100644 --- a/src/libsystemd-network/network-internal.c +++ b/src/libsystemd-network/network-internal.c @@ -102,16 +102,16 @@ bool net_match_config(const struct ether_addr *match_mac, const char *dev_type, const char *dev_name) { - if (match_host && !condition_test(match_host)) + if (match_host && condition_test(match_host) <= 0) return false; - if (match_virt && !condition_test(match_virt)) + if (match_virt && condition_test(match_virt) <= 0) return false; - if (match_kernel && !condition_test(match_kernel)) + if (match_kernel && condition_test(match_kernel) <= 0) return false; - if (match_arch && !condition_test(match_arch)) + if (match_arch && condition_test(match_arch) <= 0) return false; if (match_mac && (!dev_mac || memcmp(match_mac, dev_mac, ETH_ALEN))) |