Compare commits

..

No commits in common. "91e50467f5ce8119efc47e5c5637710b9d7f012c" and "90198bcbea9288b452843f19c445a8c49a7ee9ba" have entirely different histories.

3 changed files with 12 additions and 20 deletions

View File

@ -164,9 +164,9 @@ int network_verify(Network *network) {
strv_isempty(network->match_path) && strv_isempty(network->match_driver) && strv_isempty(network->match_path) && strv_isempty(network->match_driver) &&
strv_isempty(network->match_type) && strv_isempty(network->match_name) && strv_isempty(network->match_type) && strv_isempty(network->match_name) &&
strv_isempty(network->match_property) && strv_isempty(network->match_ssid) && !network->conditions) strv_isempty(network->match_property) && strv_isempty(network->match_ssid) && !network->conditions)
return log_warning_errno(SYNTHETIC_ERRNO(EINVAL), log_warning("%s: No valid settings found in the [Match] section. "
"%s: No valid settings found in the [Match] section, ignoring file. " "The file will match all interfaces. "
"To match all interfaces, add Name=* in the [Match] section.", "If that is intended, please add Name=* in the [Match] section.",
network->filename); network->filename);
/* skip out early if configuration does not match the environment */ /* skip out early if configuration does not match the environment */

View File

@ -122,18 +122,11 @@ static int test_load_config(Manager *manager) {
static void test_network_get(Manager *manager, sd_device *loopback) { static void test_network_get(Manager *manager, sd_device *loopback) {
Network *network; Network *network;
const struct ether_addr mac = ETHER_ADDR_NULL; const struct ether_addr mac = ETHER_ADDR_NULL;
int r;
/* Let's hope that the test machine does not have a .network file that applies to loopback device… /* let's assume that the test machine does not have a .network file
* But it is still possible, so let's allow that case too. */ that applies to the loopback device... */
r = network_get(manager, loopback, "lo", NULL, &mac, &mac, 0, NULL, NULL, &network); assert_se(network_get(manager, loopback, "lo", NULL, &mac, &mac, 0, NULL, NULL, &network) == -ENOENT);
if (r == -ENOENT)
/* The expected case */
assert_se(!network); assert_se(!network);
else if (r >= 0)
assert_se(network);
else
assert_not_reached("bad error!");
} }
static void test_address_equality(void) { static void test_address_equality(void) {

View File

@ -162,12 +162,11 @@ int link_load_one(link_config_ctx *ctx, const char *filename) {
if (set_isempty(link->match_mac) && set_isempty(link->match_permanent_mac) && 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_path) && strv_isempty(link->match_driver) && strv_isempty(link->match_type) &&
strv_isempty(link->match_name) && strv_isempty(link->match_property) && !link->conditions) { 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. " log_warning("%s: No valid settings found in the [Match] section. "
"To match all interfaces, add OriginalName=* in the [Match] section.", "The file will match all interfaces. "
"If that is intended, please add OriginalName=* in the [Match] section.",
filename); filename);
return 0;
}
if (!condition_test_list(link->conditions, NULL, NULL, NULL)) { if (!condition_test_list(link->conditions, NULL, NULL, NULL)) {
log_debug("%s: Conditions do not match the system environment, skipping.", filename); log_debug("%s: Conditions do not match the system environment, skipping.", filename);