]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolved: drop unused family argument from manager_routable()
authorLennart Poettering <lennart@poettering.net>
Wed, 28 Oct 2020 14:12:32 +0000 (15:12 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 3 Nov 2020 19:35:09 +0000 (20:35 +0100)
src/resolve/resolved-dns-scope.c
src/resolve/resolved-manager.c
src/resolve/resolved-manager.h

index 2ad4544002d5dc1eb47cc6cdea83c1803b115bd1..9bf52d62e5b1bccdc6d0bd5ee6d6caa8de4b5d2f 100644 (file)
@@ -1156,12 +1156,16 @@ bool dns_scope_name_wants_search_domain(DnsScope *s, const char *name) {
 bool dns_scope_network_good(DnsScope *s) {
         /* Checks whether the network is in good state for lookups on this scope. For mDNS/LLMNR/Classic DNS scopes
          * bound to links this is easy, as they don't even exist if the link isn't in a suitable state. For the global
-         * DNS scope we check whether there are any links that are up and have an address. */
+         * DNS scope we check whether there are any links that are up and have an address.
+         *
+         * Note that Linux routing is complex and even systems that superficially have no IPv4 address might
+         * be able to route IPv4 (and similar for IPv6), hence let's make a check here independent of address
+         * family. */
 
         if (s->link)
                 return true;
 
-        return manager_routable(s->manager, AF_UNSPEC);
+        return manager_routable(s->manager);
 }
 
 int dns_scope_ifindex(DnsScope *s) {
index c19710881091dec3284e29eb7fc56e5b7137ef20..bb333e22ebb36bfaeb1c381288cad7741233deb6 100644 (file)
@@ -1418,15 +1418,15 @@ void manager_dnssec_verdict(Manager *m, DnssecVerdict verdict, const DnsResource
         m->n_dnssec_verdict[verdict]++;
 }
 
-bool manager_routable(Manager *m, int family) {
+bool manager_routable(Manager *m) {
         Link *l;
 
         assert(m);
 
-        /* Returns true if the host has at least one interface with a routable address of the specified type */
+        /* Returns true if the host has at least one interface with a routable address (regardless if IPv4 or IPv6) */
 
         HASHMAP_FOREACH(l, m->links)
-                if (link_relevant(l, family, false))
+                if (link_relevant(l, AF_UNSPEC, false))
                         return true;
 
         return false;
index c30052195a6b0ad56f21b7f98033d10b865acd79..a2dd9ae1ff4c8aa4b97d5d0e54858fd4b53f24d2 100644 (file)
@@ -185,7 +185,7 @@ DnsOverTlsMode manager_get_dns_over_tls_mode(Manager *m);
 
 void manager_dnssec_verdict(Manager *m, DnssecVerdict verdict, const DnsResourceKey *key);
 
-bool manager_routable(Manager *m, int family);
+bool manager_routable(Manager *m);
 
 void manager_flush_caches(Manager *m);
 void manager_reset_server_features(Manager *m);