diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2020-11-27 09:04:19 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-27 09:04:19 +0900 |
commit | 0d5eb02134c6420a7b929915df5a1b18ba841911 (patch) | |
tree | 06456aa21b6c98a5d22185e0c9c1cd6c87f0a0a0 /src/network/networkd-network.c | |
parent | 6d8325f66a40d802b280492416660246db3476a6 (diff) | |
parent | 5722fb89bcb4d0fb228c0b99b82b70e00bb6095a (diff) | |
download | systemd-0d5eb02134c6420a7b929915df5a1b18ba841911.tar.gz |
Merge pull request #17478 from yuwata/split-network-internal
libsystemd-network: split network-internal.c
Diffstat (limited to 'src/network/networkd-network.c')
-rw-r--r-- | src/network/networkd-network.c | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index 3254641461..195bf3aaae 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -12,11 +12,11 @@ #include "fd-util.h" #include "hostname-util.h" #include "in-addr-util.h" -#include "networkd-dhcp-server.h" -#include "network-internal.h" +#include "net-condition.h" #include "networkd-address-label.h" #include "networkd-address.h" #include "networkd-dhcp-common.h" +#include "networkd-dhcp-server.h" #include "networkd-fdb.h" #include "networkd-manager.h" #include "networkd-mdb.h" @@ -161,11 +161,7 @@ int network_verify(Network *network) { assert(network); assert(network->filename); - if (set_isempty(network->match_mac) && set_isempty(network->match_permanent_mac) && - strv_isempty(network->match_path) && strv_isempty(network->match_driver) && - strv_isempty(network->match_type) && strv_isempty(network->match_name) && - strv_isempty(network->match_property) && strv_isempty(network->match_wlan_iftype) && - strv_isempty(network->match_ssid) && !network->conditions) + if (net_match_is_empty(&network->match) && !network->conditions) return log_warning_errno(SYNTHETIC_ERRNO(EINVAL), "%s: No valid settings found in the [Match] section, ignoring file. " "To match all interfaces, add Name=* in the [Match] section.", @@ -589,16 +585,7 @@ static Network *network_free(Network *network) { free(network->filename); - set_free_free(network->match_mac); - set_free_free(network->match_permanent_mac); - strv_free(network->match_path); - strv_free(network->match_driver); - strv_free(network->match_type); - strv_free(network->match_name); - strv_free(network->match_property); - strv_free(network->match_wlan_iftype); - strv_free(network->match_ssid); - set_free_free(network->match_bssid); + net_match_clear(&network->match); condition_free_list(network->conditions); free(network->description); @@ -705,13 +692,9 @@ int network_get(Manager *manager, unsigned short iftype, sd_device *device, assert(ret); ORDERED_HASHMAP_FOREACH(network, manager->networks) - if (net_match_config(network->match_mac, network->match_permanent_mac, - network->match_path, network->match_driver, - network->match_type, network->match_name, network->match_property, - network->match_wlan_iftype, network->match_ssid, network->match_bssid, - device, mac, permanent_mac, driver, iftype, + if (net_match_config(&network->match, device, mac, permanent_mac, driver, iftype, ifname, alternative_names, wlan_iftype, ssid, bssid)) { - if (network->match_name && device) { + if (network->match.ifname && device) { const char *attr; uint8_t name_assign_type = NET_NAME_UNKNOWN; |