summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/resolve/resolved-manager.c')
-rw-r--r--src/resolve/resolved-manager.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c
index 6cf75f9183..a46f13b92f 100644
--- a/src/resolve/resolved-manager.c
+++ b/src/resolve/resolved-manager.c
@@ -468,16 +468,14 @@ static int manager_sigusr1(sd_event_source *s, const struct signalfd_siginfo *si
static int manager_sigusr2(sd_event_source *s, const struct signalfd_siginfo *si, void *userdata) {
Manager *m = userdata;
- DnsScope *scope;
assert(s);
assert(si);
assert(m);
- LIST_FOREACH(scopes, scope, m->dns_scopes)
- dns_cache_flush(&scope->cache);
-
+ manager_flush_caches(m);
log_info("Flushed all caches.");
+
return 0;
}
@@ -1251,3 +1249,12 @@ bool manager_routable(Manager *m, int family) {
return false;
}
+
+void manager_flush_caches(Manager *m) {
+ DnsScope *scope;
+
+ assert(m);
+
+ LIST_FOREACH(scopes, scope, m->dns_scopes)
+ dns_cache_flush(&scope->cache);
+}