resolved: also flush /etc/hosts on reload
When we are told to reload our configuration also flush out /etc/hosts explicitly. This is particularly relevant since we suppress too frequent reloads, and hence a synchronous way to force a reload is very useful.
This commit is contained in:
@@ -72,6 +72,7 @@ void etc_hosts_clear(EtcHosts *hosts) {
|
||||
void manager_etc_hosts_flush(Manager *m) {
|
||||
etc_hosts_clear(&m->etc_hosts);
|
||||
m->etc_hosts_stat = (struct stat) {};
|
||||
m->etc_hosts_last = USEC_INFINITY;
|
||||
}
|
||||
|
||||
static int parse_line(EtcHosts *hosts, unsigned nr, const char *line) {
|
||||
|
||||
@@ -659,6 +659,7 @@ static int manager_dispatch_reload_signal(sd_event_source *s, const struct signa
|
||||
m->unicast_scope = dns_scope_free(m->unicast_scope);
|
||||
m->delegates = hashmap_free(m->delegates);
|
||||
dns_trust_anchor_flush(&m->trust_anchor);
|
||||
manager_etc_hosts_flush(m);
|
||||
|
||||
manager_set_defaults(m);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user