]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolve: enable per-link mDNS setting by default
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 4 Nov 2022 03:06:21 +0000 (12:06 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 4 Nov 2022 11:31:00 +0000 (12:31 +0100)
Otherwise, if the link is not managed by systemd-networkd, mDNS cannot
be enabled without calling `resolvectl` explicitly.

Fixes #25252.

src/resolve/resolved-link-bus.c
src/resolve/resolved-link.c

index a817b1b453aee52e781fd47a97832323bb6f32ad..5b1096daf6dad5381a0d1eb175ce244dbc5bb90e 100644 (file)
@@ -560,7 +560,7 @@ int bus_link_method_set_mdns(sd_bus_message *message, void *userdata, sd_bus_err
                 return r;
 
         if (isempty(mdns))
-                mode = RESOLVE_SUPPORT_NO;
+                mode = RESOLVE_SUPPORT_YES;
         else {
                 mode = resolve_support_from_string(mdns);
                 if (mode < 0)
index 9ab55eb82e39fcc9bc1d28d3393ed9d57a00f99e..5b34677cbefea230565c789f24e15c01d8444921 100644 (file)
@@ -37,7 +37,7 @@ int link_new(Manager *m, Link **ret, int ifindex) {
                 .ifindex = ifindex,
                 .default_route = -1,
                 .llmnr_support = RESOLVE_SUPPORT_YES,
-                .mdns_support = RESOLVE_SUPPORT_NO,
+                .mdns_support = RESOLVE_SUPPORT_YES,
                 .dnssec_mode = _DNSSEC_MODE_INVALID,
                 .dns_over_tls_mode = _DNS_OVER_TLS_MODE_INVALID,
                 .operstate = IF_OPER_UNKNOWN,
@@ -64,7 +64,7 @@ void link_flush_settings(Link *l) {
 
         l->default_route = -1;
         l->llmnr_support = RESOLVE_SUPPORT_YES;
-        l->mdns_support = RESOLVE_SUPPORT_NO;
+        l->mdns_support = RESOLVE_SUPPORT_YES;
         l->dnssec_mode = _DNSSEC_MODE_INVALID;
         l->dns_over_tls_mode = _DNS_OVER_TLS_MODE_INVALID;
 
@@ -360,7 +360,7 @@ static int link_update_mdns_support(Link *l) {
 
         assert(l);
 
-        l->mdns_support = RESOLVE_SUPPORT_NO;
+        l->mdns_support = RESOLVE_SUPPORT_YES;
 
         r = sd_network_link_get_mdns(l->ifindex, &b);
         if (r == -ENODATA)
@@ -1148,7 +1148,7 @@ static bool link_needs_save(Link *l) {
                 return false;
 
         if (l->llmnr_support != RESOLVE_SUPPORT_YES ||
-            l->mdns_support != RESOLVE_SUPPORT_NO ||
+            l->mdns_support != RESOLVE_SUPPORT_YES ||
             l->dnssec_mode != _DNSSEC_MODE_INVALID ||
             l->dns_over_tls_mode != _DNS_OVER_TLS_MODE_INVALID)
                 return true;