summaryrefslogtreecommitdiffstats
path: root/src/network/test-networkd-conf.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2020-10-02 05:34:19 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2020-10-06 19:50:50 +0200
commit9cd9fc8f447329281d6d1614e1a86011c8cbec5c (patch)
tree9f26f0539dca653397d1b4dd7d92f4d6413c802f /src/network/test-networkd-conf.c
parentnetwork: make address_free() return NULL (diff)
downloadsystemd-9cd9fc8f447329281d6d1614e1a86011c8cbec5c.tar.xz
systemd-9cd9fc8f447329281d6d1614e1a86011c8cbec5c.zip
network: drop list of static addresses
[Address] sections are managed by both LIST and Hashmap. Let's drop the list and manage them by OrderedHashmap.
Diffstat (limited to 'src/network/test-networkd-conf.c')
-rw-r--r--src/network/test-networkd-conf.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/network/test-networkd-conf.c b/src/network/test-networkd-conf.c
index 5d338e6f1a..030e50688a 100644
--- a/src/network/test-networkd-conf.c
+++ b/src/network/test-networkd-conf.c
@@ -176,14 +176,16 @@ static void test_config_parse_address_one(const char *rvalue, int family, unsign
assert_se(network->filename = strdup("hogehoge.network"));
assert_se(config_parse_match_ifnames("network", "filename", 1, "section", 1, "Name", 0, "*", &network->match_name, network) == 0);
assert_se(config_parse_address("network", "filename", 1, "section", 1, "Address", 0, rvalue, network, network) == 0);
- assert_se(network->n_static_addresses == 1);
+ assert_se(ordered_hashmap_size(network->addresses_by_section) == 1);
assert_se(network_verify(network) >= 0);
- assert_se(network->n_static_addresses == n_addresses);
+ assert_se(ordered_hashmap_size(network->addresses_by_section) == n_addresses);
if (n_addresses > 0) {
- assert_se(network->static_addresses);
- assert_se(network->static_addresses->prefixlen == prefixlen);
- assert_se(network->static_addresses->family == family);
- assert_se(in_addr_equal(family, &network->static_addresses->in_addr, u));
+ Address *a;
+
+ assert_se(a = ordered_hashmap_first(network->addresses_by_section));
+ assert_se(a->prefixlen == prefixlen);
+ assert_se(a->family == family);
+ assert_se(in_addr_equal(family, &a->in_addr, u));
/* TODO: check Address.in_addr and Address.broadcast */
}
}