resolve: drop never matched condition
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 22 Feb 2022 22:49:40 +0000 (07:49 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 10 Mar 2022 12:54:30 +0000 (12:54 +0000)
As dns_scope_good_domain() does not return negative errno.

(cherry picked from commit 830f50ab1e03fa7ee262876ed42023d10e89688d)
(cherry picked from commit 499115dbc3408f9a85160099e114bbaf0bacfe84)

src/resolve/resolved-dns-query.c

index 192bfd3bf5682bf90719a6a144a98efd83079c0a..4d15240e25b0eca3184a92b61ec2387f499c723a 100644 (file)
@@ -743,11 +743,7 @@ int dns_query_go(DnsQuery *q) {
                         continue;
 
                 match = dns_scope_good_domain(s, q->ifindex, q->flags, name);
-                if (match < 0) {
-                        log_debug("Couldn't check if '%s' matches against scope, ignoring.", name);
-                        continue;
-                }
-
+                assert(match >= 0);
                 if (match > found) { /* Does this match better? If so, remember how well it matched, and the first one
                                       * that matches this well */
                         found = match;
@@ -779,11 +775,7 @@ int dns_query_go(DnsQuery *q) {
                         continue;
 
                 match = dns_scope_good_domain(s, q->ifindex, q->flags, name);
-                if (match < 0) {
-                        log_debug("Couldn't check if '%s' matches against scope, ignoring.", name);
-                        continue;
-                }
-
+                assert(match >= 0);
                 if (match < found)
                         continue;