No functional change, at least now. Preparation for later commits.
But we are planning to extend KeepConfiguration= and also keep
addresses and so on assigned by other dynamic configuration protocol
like DHCPv6 or NDisc.
However, when link_free_engines() is called here, acquired addresses so
on by NDisc will be removed, even if link_stop_engines() handles
restarting networkd or KeepConfiguration= gracefully.
So, let's not free engines here, but free them later in link_free().
It is not necessary to be called here anyway.
link->dnssec_negative_trust_anchors = set_free_free(link->dnssec_negative_trust_anchors);
}
-void link_free_engines(Link *link) {
+static void link_free_engines(Link *link) {
if (!link)
return;
bool link_has_ipv6_connectivity(Link *link);
int link_stop_engines(Link *link, bool may_keep_dhcp);
-void link_free_engines(Link *link);
const char* link_state_to_string(LinkState s) _const_;
LinkState link_state_from_string(const char *s) _pure_;
manager->state = state;
Link *link;
- HASHMAP_FOREACH(link, manager->links_by_index) {
+ HASHMAP_FOREACH(link, manager->links_by_index)
(void) link_stop_engines(link, /* may_keep_dhcp = */ true);
- link_free_engines(link);
- }
return 0;
}