aboutsummaryrefslogtreecommitdiffstats
path: root/src/network/networkd-network.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/networkd-network.c')
-rw-r--r--src/network/networkd-network.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
index 3ea76a034a6..d949cc0f938 100644
--- a/src/network/networkd-network.c
+++ b/src/network/networkd-network.c
@@ -151,6 +151,7 @@ int network_verify(Network *network) {
AddressLabel *label, *label_next;
Prefix *prefix, *prefix_next;
RoutingPolicyRule *rule, *rule_next;
+ NextHop *nexthop, *nextnop_next;
assert(network);
assert(network->filename);
@@ -282,6 +283,10 @@ int network_verify(Network *network) {
if (route_section_verify(route, network) < 0)
route_free(route);
+ LIST_FOREACH_SAFE(nexthops, nexthop, nextnop_next, network->static_nexthops)
+ if (nexthop_section_verify(nexthop) < 0)
+ nexthop_free(nexthop);
+
LIST_FOREACH_SAFE(static_fdb_entries, fdb, fdb_next, network->static_fdb_entries)
if (section_is_invalid(fdb->section))
fdb_entry_free(fdb);
@@ -453,6 +458,7 @@ int network_load_one(Manager *manager, const char *filename) {
"IPv6AddressLabel\0"
"RoutingPolicyRule\0"
"Route\0"
+ "NextHop\0"
"DHCP\0"
"DHCPv4\0" /* compat */
"DHCPv6\0"
@@ -525,8 +531,9 @@ static Network *network_free(Network *network) {
FdbEntry *fdb_entry;
Neighbor *neighbor;
AddressLabel *label;
- Prefix *prefix;
Address *address;
+ NextHop *nexthop;
+ Prefix *prefix;
Route *route;
if (!network)
@@ -573,6 +580,9 @@ static Network *network_free(Network *network) {
while ((route = network->static_routes))
route_free(route);
+ while ((nexthop = network->static_nexthops))
+ nexthop_free(nexthop);
+
while ((address = network->static_addresses))
address_free(address);
@@ -596,6 +606,7 @@ static Network *network_free(Network *network) {
hashmap_free(network->addresses_by_section);
hashmap_free(network->routes_by_section);
+ hashmap_free(network->nexthops_by_section);
hashmap_free(network->fdb_entries_by_section);
hashmap_free(network->neighbors_by_section);
hashmap_free(network->address_labels_by_section);