summaryrefslogtreecommitdiffstats
path: root/src/resolve
diff options
context:
space:
mode:
authormsizanoen1 <msizanoen@qtmlabs.xyz>2022-09-27 16:48:48 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-09-28 01:09:06 +0200
commitb49e029a9953dd0f327efe9035a7c429c3cfeb92 (patch)
tree6d5f1c101fc4e5e70428c93e9e8e19bda2620ebe /src/resolve
parenthwdb: fix Positivo-vaio FE14 V2 key toggle touchpad #24822 (#24825) (diff)
downloadsystemd-b49e029a9953dd0f327efe9035a7c429c3cfeb92.tar.xz
systemd-b49e029a9953dd0f327efe9035a7c429c3cfeb92.zip
resolve: persist DNSOverTLS configuration in state file
Currently, NetworkManager will set DNSOverTLS according to its `connection.dnsovertls` configuration only once during connection, instead of every single restart of systemd-resolved, causing resolved to lose the configuration on restart. Fix this by persisting DNSOverTLS in the runtime state file, which will also make it more consistent with other interface-specific settings.
Diffstat (limited to 'src/resolve')
-rw-r--r--src/resolve/resolved-link.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/resolve/resolved-link.c b/src/resolve/resolved-link.c
index 35b31a5317..9ab55eb82e 100644
--- a/src/resolve/resolved-link.c
+++ b/src/resolve/resolved-link.c
@@ -1204,6 +1204,10 @@ int link_save_user(Link *l) {
if (v)
fprintf(f, "DNSSEC=%s\n", v);
+ v = dns_over_tls_mode_to_string(l->dns_over_tls_mode);
+ if (v)
+ fprintf(f, "DNSOVERTLS=%s\n", v);
+
if (l->default_route >= 0)
fprintf(f, "DEFAULT_ROUTE=%s\n", yes_no(l->default_route));
@@ -1281,6 +1285,7 @@ int link_load_user(Link *l) {
*llmnr = NULL,
*mdns = NULL,
*dnssec = NULL,
+ *dns_over_tls = NULL,
*servers = NULL,
*domains = NULL,
*ntas = NULL,
@@ -1305,6 +1310,7 @@ int link_load_user(Link *l) {
"LLMNR", &llmnr,
"MDNS", &mdns,
"DNSSEC", &dnssec,
+ "DNSOVERTLS", &dns_over_tls,
"SERVERS", &servers,
"DOMAINS", &domains,
"NTAS", &ntas,
@@ -1332,6 +1338,9 @@ int link_load_user(Link *l) {
/* If we can't recognize the DNSSEC setting, then set it to invalid, so that the daemon default is used. */
l->dnssec_mode = dnssec_mode_from_string(dnssec);
+ /* Same for DNSOverTLS */
+ l->dns_over_tls_mode = dns_over_tls_mode_from_string(dns_over_tls);
+
for (p = servers;;) {
_cleanup_free_ char *word = NULL;