diff options
Diffstat (limited to 'src/resolve')
-rw-r--r-- | src/resolve/resolved-dns-dnssec.c | 4 | ||||
-rw-r--r-- | src/resolve/resolved-dns-scope.c | 2 | ||||
-rw-r--r-- | src/resolve/resolved-dns-synthesize.c | 3 | ||||
-rw-r--r-- | src/resolve/resolved-dns-transaction.c | 4 | ||||
-rw-r--r-- | src/resolve/resolved-manager.c | 2 | ||||
-rw-r--r-- | src/resolve/resolved-resolv-conf.c | 2 |
6 files changed, 8 insertions, 9 deletions
diff --git a/src/resolve/resolved-dns-dnssec.c b/src/resolve/resolved-dns-dnssec.c index eddab58a81..651c660e96 100644 --- a/src/resolve/resolved-dns-dnssec.c +++ b/src/resolve/resolved-dns-dnssec.c @@ -1247,10 +1247,10 @@ static int nsec3_is_good(DnsResourceRecord *rr, DnsResourceRecord *nsec3) { /* Ignore NSEC3 RRs generated from wildcards. If these NSEC3 RRs weren't correctly signed we can't make this * check (since rr->n_skip_labels_source is -1), but that's OK, as we won't trust them anyway in that case. */ - if (rr->n_skip_labels_source != 0 && rr->n_skip_labels_source != (unsigned) -1) + if (!IN_SET(rr->n_skip_labels_source, 0, (unsigned) -1)) return 0; /* Ignore NSEC3 RRs that are located anywhere else than one label below the zone */ - if (rr->n_skip_labels_signer != 1 && rr->n_skip_labels_signer != (unsigned) -1) + if (!IN_SET(rr->n_skip_labels_signer, 1, (unsigned) -1)) return 0; if (!nsec3) diff --git a/src/resolve/resolved-dns-scope.c b/src/resolve/resolved-dns-scope.c index ffaefbe3f2..b01ee6c9cc 100644 --- a/src/resolve/resolved-dns-scope.c +++ b/src/resolve/resolved-dns-scope.c @@ -904,7 +904,7 @@ int dns_scope_notify_conflict(DnsScope *scope, DnsResourceRecord *rr) { * messages, not all of them. That should be enough to * indicate where there might be a conflict */ r = ordered_hashmap_put(scope->conflict_queue, rr->key, rr); - if (r == -EEXIST || r == 0) + if (IN_SET(r, 0, -EEXIST)) return 0; if (r < 0) return log_debug_errno(r, "Failed to queue conflicting RR: %m"); diff --git a/src/resolve/resolved-dns-synthesize.c b/src/resolve/resolved-dns-synthesize.c index ad38c6a561..e8592a60d8 100644 --- a/src/resolve/resolved-dns-synthesize.c +++ b/src/resolve/resolved-dns-synthesize.c @@ -383,8 +383,7 @@ int dns_synthesize_answer( const char *name; int af; - if (key->class != DNS_CLASS_IN && - key->class != DNS_CLASS_ANY) + if (!IN_SET(key->class, DNS_CLASS_IN, DNS_CLASS_ANY)) continue; name = dns_resource_key_name(key); diff --git a/src/resolve/resolved-dns-transaction.c b/src/resolve/resolved-dns-transaction.c index 8b23132339..3cda429c3c 100644 --- a/src/resolve/resolved-dns-transaction.c +++ b/src/resolve/resolved-dns-transaction.c @@ -190,7 +190,7 @@ int dns_transaction_new(DnsTransaction **ret, DnsScope *s, DnsResourceKey *key) return -EOPNOTSUPP; /* We only support the IN class */ - if (key->class != DNS_CLASS_IN && key->class != DNS_CLASS_ANY) + if (!IN_SET(key->class, DNS_CLASS_IN, DNS_CLASS_ANY)) return -EOPNOTSUPP; if (hashmap_size(s->manager->dns_transactions) >= TRANSACTIONS_MAX) @@ -1593,7 +1593,7 @@ int dns_transaction_go(DnsTransaction *t) { log_debug("Sending query via TCP since it is too large."); else if (r == -EAGAIN) log_debug("Sending query via TCP since server doesn't support UDP."); - if (r == -EMSGSIZE || r == -EAGAIN) + if (IN_SET(r, -EMSGSIZE, -EAGAIN)) r = dns_transaction_open_tcp(t); } diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c index b6620875ea..efdf7e5aaa 100644 --- a/src/resolve/resolved-manager.c +++ b/src/resolve/resolved-manager.c @@ -741,7 +741,7 @@ int manager_recv(Manager *m, int fd, DnsProtocol protocol, DnsPacket **ret) { if (l == 0) return 0; if (l < 0) { - if (errno == EAGAIN || errno == EINTR) + if (IN_SET(errno, EAGAIN, EINTR)) return 0; return -errno; diff --git a/src/resolve/resolved-resolv-conf.c b/src/resolve/resolved-resolv-conf.c index f4e071ebaa..2af77b3407 100644 --- a/src/resolve/resolved-resolv-conf.c +++ b/src/resolve/resolved-resolv-conf.c @@ -87,7 +87,7 @@ int manager_read_resolv_conf(Manager *m) { char *l; l = strstrip(line); - if (*l == '#' || *l == ';') + if (IN_SET(*l, '#', ';')) continue; a = first_word(l, "nameserver"); |