Merge pull request #24930 from yuwata/network-drop-ndisc-vacuum

network: further follow-ups for recent NDisc PRs
This commit is contained in:
Yu Watanabe
2022-10-07 18:38:34 +09:00
committed by GitHub
4 changed files with 6 additions and 27 deletions
+6 -2
View File
@@ -151,6 +151,7 @@ static void link_free_engines(Link *link) {
return;
link->dhcp_server = sd_dhcp_server_unref(link->dhcp_server);
link->dhcp_client = sd_dhcp_client_unref(link->dhcp_client);
link->dhcp_lease = sd_dhcp_lease_unref(link->dhcp_lease);
link->dhcp4_6rd_tunnel_name = mfree(link->dhcp4_6rd_tunnel_name);
@@ -158,12 +159,15 @@ static void link_free_engines(Link *link) {
link->lldp_rx = sd_lldp_rx_unref(link->lldp_rx);
link->lldp_tx = sd_lldp_tx_unref(link->lldp_tx);
ndisc_flush(link);
link->ipv4ll = sd_ipv4ll_unref(link->ipv4ll);
link->dhcp6_client = sd_dhcp6_client_unref(link->dhcp6_client);
link->dhcp6_lease = sd_dhcp6_lease_unref(link->dhcp6_lease);
link->ndisc = sd_ndisc_unref(link->ndisc);
link->ndisc_expire = sd_event_source_disable_unref(link->ndisc_expire);
ndisc_flush(link);
link->radv = sd_radv_unref(link->radv);
}
-21
View File
@@ -1175,27 +1175,6 @@ int ndisc_stop(Link *link) {
}
void ndisc_vacuum(Link *link) {
NDiscRDNSS *r;
NDiscDNSSL *d;
usec_t now_usec;
assert(link);
assert(link->manager);
/* Removes all RDNSS and DNSSL entries whose validity time has passed */
assert_se(sd_event_now(link->manager->event, CLOCK_BOOTTIME, &now_usec) >= 0);
SET_FOREACH(r, link->ndisc_rdnss)
if (r->lifetime_usec < now_usec)
free(set_remove(link->ndisc_rdnss, r));
SET_FOREACH(d, link->ndisc_dnssl)
if (d->lifetime_usec < now_usec)
free(set_remove(link->ndisc_dnssl, d));
}
void ndisc_flush(Link *link) {
assert(link);
-1
View File
@@ -41,7 +41,6 @@ void network_adjust_ipv6_accept_ra(Network *network);
int ndisc_start(Link *link);
int ndisc_stop(Link *link);
void ndisc_vacuum(Link *link);
void ndisc_flush(Link *link);
int link_request_ndisc(Link *link);
-3
View File
@@ -540,9 +540,6 @@ int link_save(Link *link) {
/************************************************************/
/* Make sure to flush out old entries before we use the NDisc data */
ndisc_vacuum(link);
fputs("DNS=", f);
if (link->n_dns != UINT_MAX)
link_save_dns(link, f, link->dns, link->n_dns, NULL);