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) {
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;
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);