}
static Link *link_free(Link *link) {
+ Link *carrier, *master;
Address *address;
- Link *carrier;
Route *route;
Iterator i;
hashmap_free(link->bond_slaves);
+ if (link->network) {
+ if (link->network->bond &&
+ link_get(link->manager, link->network->bond->ifindex, &master) >= 0)
+ (void) hashmap_remove(master->bond_slaves, INT_TO_PTR(link->ifindex));
+ }
+
return mfree(link);
}
sd_netlink_unref(m->genl);
sd_resolve_unref(m->resolve);
- while ((network = m->networks))
- network_free(network);
-
while ((link = hashmap_first(m->dhcp6_prefixes)))
manager_dhcp6_prefix_remove_all(m, link);
hashmap_free(m->dhcp6_prefixes);
m->links_requesting_uuid = set_free(m->links_requesting_uuid);
set_free(m->duids_requesting_uuid);
+ while ((network = m->networks))
+ network_free(network);
+
hashmap_free(m->networks_by_name);
m->netdevs = hashmap_free_with_destructor(m->netdevs, netdev_unref);