diff options
author | Lennart Poettering <lennart@poettering.net> | 2020-11-11 21:02:06 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-02-16 16:46:01 +0100 |
commit | 1d123e772d63fd5f4f4315a31ae2f23f10d538f9 (patch) | |
tree | 9ca54ad0d0f1fb3984b1f7501ff8c47d05c1dde9 /src/resolve/resolved-dns-server.c | |
parent | resolved: let's preferably route reverse lookups for local subnets to matchin... (diff) | |
download | systemd-1d123e772d63fd5f4f4315a31ae2f23f10d538f9.tar.xz systemd-1d123e772d63fd5f4f4315a31ae2f23f10d538f9.zip |
resolved: reduce indentation level a bit
Diffstat (limited to 'src/resolve/resolved-dns-server.c')
-rw-r--r-- | src/resolve/resolved-dns-server.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/resolve/resolved-dns-server.c b/src/resolve/resolved-dns-server.c index 585bfee2d1..40da80b39a 100644 --- a/src/resolve/resolved-dns-server.c +++ b/src/resolve/resolved-dns-server.c @@ -281,16 +281,15 @@ void dns_server_packet_received(DnsServer *s, int protocol, DnsServerFeatureLeve if (s->packet_bad_opt && level >= DNS_SERVER_FEATURE_LEVEL_EDNS0) level = DNS_SERVER_FEATURE_LEVEL_EDNS0 - 1; - /* Even if we successfully receive a reply to a request announcing support for large packets, - that does not mean we can necessarily receive large packets. */ + /* Even if we successfully receive a reply to a request announcing support for large packets, that + * does not mean we can necessarily receive large packets. */ if (level == DNS_SERVER_FEATURE_LEVEL_LARGE) level = DNS_SERVER_FEATURE_LEVEL_LARGE - 1; dns_server_verified(s, level); - /* Remember the size of the largest UDP packet we received from a server, - we know that we can always announce support for packets with at least - this size. */ + /* Remember the size of the largest UDP packet we received from a server, we know that we can always + * announce support for packets with at least this size. */ if (protocol == IPPROTO_UDP && s->received_udp_packet_max < size) s->received_udp_packet_max = size; } @@ -299,15 +298,16 @@ void dns_server_packet_lost(DnsServer *s, int protocol, DnsServerFeatureLevel le assert(s); assert(s->manager); - if (s->possible_feature_level == level) { - if (protocol == IPPROTO_UDP) - s->n_failed_udp++; - else if (protocol == IPPROTO_TCP) { - if (DNS_SERVER_FEATURE_LEVEL_IS_TLS(level)) - s->n_failed_tls++; - else - s->n_failed_tcp++; - } + if (s->possible_feature_level != level) + return; + + if (protocol == IPPROTO_UDP) + s->n_failed_udp++; + else if (protocol == IPPROTO_TCP) { + if (DNS_SERVER_FEATURE_LEVEL_IS_TLS(level)) + s->n_failed_tls++; + else + s->n_failed_tcp++; } } |