]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolve: drop never matched condition
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 22 Feb 2022 22:49:40 +0000 (07:49 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 22 Feb 2022 22:53:53 +0000 (07:53 +0900)
As dns_scope_good_domain() does not return negative errno.

src/resolve/resolved-dns-query.c

index 9b296e7aa67a95e01bce50273187d0fc3687679c..7dc346794e6843c28591fea814cffeffa8a48e97 100644 (file)
@@ -744,11 +744,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;
@@ -780,11 +776,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;