summaryrefslogtreecommitdiffstats
path: root/src/resolve
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@gmail.com>2024-11-01 14:51:57 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2024-11-01 16:44:01 +0100
commitffd81a1202bad03b323a3880e00c800ac38b6840 (patch)
tree099635422f5590caf94a67376222488b4ee6356d /src/resolve
parenthwdb: update for v257 (#34976) (diff)
downloadsystemd-ffd81a1202bad03b323a3880e00c800ac38b6840.tar.xz
systemd-ffd81a1202bad03b323a3880e00c800ac38b6840.zip
resolve: remove always-true superflous check and rename label
Fixes https://github.com/systemd/systemd/security/code-scanning/2900
Diffstat (limited to 'src/resolve')
-rw-r--r--src/resolve/resolved-varlink.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/resolve/resolved-varlink.c b/src/resolve/resolved-varlink.c
index 13b0686244..168923e6b5 100644
--- a/src/resolve/resolved-varlink.c
+++ b/src/resolve/resolved-varlink.c
@@ -912,7 +912,7 @@ static void vl_method_resolve_service_complete(DnsQuery *query) {
if (r == -ELOOP)
return (void) sd_varlink_error(q->varlink_request, "io.systemd.Resolve.CNAMELoop", NULL);
if (r < 0)
- goto finish;
+ goto fail;
if (r == DNS_QUERY_CNAME) {
/* This was a cname, and the query was restarted. */
TAKE_PTR(q);
@@ -924,7 +924,7 @@ static void vl_method_resolve_service_complete(DnsQuery *query) {
DNS_ANSWER_FOREACH_IFINDEX(rr, ifindex, q->answer) {
r = dns_question_matches_rr(question, rr, NULL);
if (r < 0)
- goto finish;
+ goto fail;
if (r == 0)
continue;
@@ -942,7 +942,7 @@ static void vl_method_resolve_service_complete(DnsQuery *query) {
q->block_all_complete--;
if (r < 0)
- goto finish;
+ goto fail;
}
found++;
@@ -961,11 +961,9 @@ static void vl_method_resolve_service_complete(DnsQuery *query) {
resolve_service_all_complete(TAKE_PTR(q));
return;
-finish:
- if (r < 0) {
- log_error_errno(r, "Failed to send address reply: %m");
- (void) sd_varlink_error_errno(q->varlink_request, r);
- }
+fail:
+ log_error_errno(r, "Failed to send address reply: %m");
+ (void) sd_varlink_error_errno(q->varlink_request, r);
}
static int vl_method_resolve_service(sd_varlink* link, sd_json_variant* parameters, sd_varlink_method_flags_t flags, void* userdata) {