mirror of
https://github.com/systemd/systemd.git
synced 2025-01-07 21:18:41 +03:00
network: drop unnecessary call of ndisc_vacuum()
After the commit 773024685b
, DNS servers
or domains are dropped when their lifefime become zero. Hence, it is not
necessary to try to them when writing state file.
Of course, because of the accuracy of the timer event source or priority
of event sources, a possibility is introduced that a DNS server or domain
with zero lifetime is stored in the state file. However, such entry will
be dropped soon when the timer event source is triggered. Hence, that
should not cause any real issues.
This commit is contained in:
parent
c76691d708
commit
44085d63f0
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user