From: Yu Watanabe Date: Tue, 4 Feb 2020 11:26:37 +0000 (+0900) Subject: Merge pull request #14761 from keszybz/link-network-no-match X-Git-Tag: v245-rc1~19 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=91e50467f5ce8119efc47e5c5637710b9d7f012c;p=thirdparty%2Fsystemd.git Merge pull request #14761 from keszybz/link-network-no-match Refuse .network and .link files with no matches --- 91e50467f5ce8119efc47e5c5637710b9d7f012c diff --cc src/udev/net/link-config.c index e1a25a54a68,dfe9b9f3130..bcf9be1a0d9 --- a/src/udev/net/link-config.c +++ b/src/udev/net/link-config.c @@@ -160,13 -160,17 +160,14 @@@ int link_load_one(link_config_ctx *ctx if (r < 0) return r; - if (link->speed > UINT_MAX) - return -ERANGE; - if (set_isempty(link->match_mac) && set_isempty(link->match_permanent_mac) && strv_isempty(link->match_path) && strv_isempty(link->match_driver) && strv_isempty(link->match_type) && - strv_isempty(link->match_name) && strv_isempty(link->match_property) && !link->conditions) - log_warning("%s: No valid settings found in the [Match] section. " - "The file will match all interfaces. " - "If that is intended, please add OriginalName=* in the [Match] section.", + strv_isempty(link->match_name) && strv_isempty(link->match_property) && !link->conditions) { + log_warning("%s: No valid settings found in the [Match] section, ignoring file. " + "To match all interfaces, add OriginalName=* in the [Match] section.", filename); + return 0; + } if (!condition_test_list(link->conditions, NULL, NULL, NULL)) { log_debug("%s: Conditions do not match the system environment, skipping.", filename);