/* SPDX-License-Identifier: LGPL-2.1+ */
+#include <fcntl.h>
#include <netinet/in.h>
#include <poll.h>
-#include <stdio_ext.h>
#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
#if HAVE_LIBIDN2
#include <idn2.h>
goto fail;
if (is_new)
- log_debug("Found new link %i/%s", ifindex, l->name);
+ log_debug("Found new link %i/%s", ifindex, l->ifname);
break;
}
case RTM_DELLINK:
if (l) {
- log_debug("Removing link %i/%s", l->ifindex, l->name);
+ log_debug("Removing link %i/%s", l->ifindex, l->ifname);
link_remove_user(l);
link_free(l);
}
assert(si);
assert(m);
- f = open_memstream(&buffer, &size);
+ f = open_memstream_unlocked(&buffer, &size);
if (!f)
return log_oom();
- (void) __fsetlocking(f, FSETLOCKING_BYCALLER);
-
LIST_FOREACH(scopes, scope, m->dns_scopes)
dns_scope_dump(scope, f);
.dnssec_mode = DEFAULT_DNSSEC_MODE,
.dns_over_tls_mode = DEFAULT_DNS_OVER_TLS_MODE,
.enable_cache = true,
- .dns_stub_listener_mode = DNS_STUB_LISTENER_UDP,
+ .dns_stub_listener_mode = DNS_STUB_LISTENER_YES,
.read_resolv_conf = true,
.need_builtin_fallbacks = true,
.etc_hosts_last = USEC_INFINITY,
if (r < 0)
log_warning_errno(r, "Failed to parse configuration file: %m");
+#if ENABLE_DNS_OVER_TLS
+ r = dnstls_manager_init(m);
+ if (r < 0)
+ return r;
+#endif
+
r = sd_event_default(&m->event);
if (r < 0)
return r;
while (m->dns_streams)
dns_stream_unref(m->dns_streams);
+#if ENABLE_DNS_OVER_TLS
+ dnstls_manager_free(m);
+#endif
+
hashmap_free(m->links);
hashmap_free(m->dns_transactions);
manager_mdns_stop(m);
manager_dns_stub_stop(m);
- sd_bus_unref(m->bus);
+ sd_bus_flush_close_unref(m->bus);
sd_event_source_unref(m->sigusr1_event_source);
sd_event_source_unref(m->sigusr2_event_source);