diff options
author | David Goulet <dgoulet@torproject.org> | 2024-10-21 12:03:54 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2024-10-21 12:03:54 -0400 |
commit | 26c069089b3ec5a0f278e5922b643de455f36af0 (patch) | |
tree | b808f48bded8151fc53e89a6c5d46705a61bf87f | |
parent | 8f43b97895c2fb3179a83b4535c5fc2a97d75998 (diff) | |
download | tor-26c069089b3ec5a0f278e5922b643de455f36af0.tar.gz tor-26c069089b3ec5a0f278e5922b643de455f36af0.zip |
Revert "Handle empty DNS reply without error as NOERROR"
Closes #40984
This reverts commit 3d2f7c3467e7aff545d8e22ffd4153d7598c6d7c.
-rw-r--r-- | src/core/or/or.h | 1 | ||||
-rw-r--r-- | src/core/or/relay.c | 2 | ||||
-rw-r--r-- | src/feature/client/dnsserv.c | 3 | ||||
-rw-r--r-- | src/test/test_relaycell.c | 2 |
4 files changed, 2 insertions, 6 deletions
diff --git a/src/core/or/or.h b/src/core/or/or.h index c736d37fb9..088c45342b 100644 --- a/src/core/or/or.h +++ b/src/core/or/or.h @@ -301,7 +301,6 @@ struct curve25519_public_key_t; #define RESOLVED_TYPE_IPV6 6 #define RESOLVED_TYPE_ERROR_TRANSIENT 0xF0 #define RESOLVED_TYPE_ERROR 0xF1 -#define RESOLVED_TYPE_NOERROR 0xF2 /* Negative reasons are internal: we never send them in a DESTROY or TRUNCATE * call; they only go to the controller for tracking */ diff --git a/src/core/or/relay.c b/src/core/or/relay.c index 9e62538421..f7d200c18d 100644 --- a/src/core/or/relay.c +++ b/src/core/or/relay.c @@ -1343,7 +1343,7 @@ connection_ap_handshake_socks_got_resolved_cell(entry_connection_t *conn, /* Now convert it to the ugly old interface */ if (! addr_best) { connection_ap_handshake_socks_resolved(conn, - RESOLVED_TYPE_NOERROR,0,NULL,-1,-1); + RESOLVED_TYPE_ERROR,0,NULL,-1,-1); return; } diff --git a/src/feature/client/dnsserv.c b/src/feature/client/dnsserv.c index 237a6ee3d3..f0bb0af100 100644 --- a/src/feature/client/dnsserv.c +++ b/src/feature/client/dnsserv.c @@ -319,7 +319,6 @@ evdns_get_orig_address(const struct evdns_server_request *req, break; case RESOLVED_TYPE_ERROR: case RESOLVED_TYPE_ERROR_TRANSIENT: - case RESOLVED_TYPE_NOERROR: /* Addr doesn't matter, since we're not sending it back in the reply.*/ return addr; default: @@ -380,8 +379,6 @@ dnsserv_resolved(entry_connection_t *conn, tor_free(ans); } else if (answer_type == RESOLVED_TYPE_ERROR) { err = DNS_ERR_NOTEXIST; - } else if (answer_type == RESOLVED_TYPE_NOERROR) { - err = DNS_ERR_NONE; } else { /* answer_type == RESOLVED_TYPE_ERROR_TRANSIENT */ err = DNS_ERR_SERVERFAILED; } diff --git a/src/test/test_relaycell.c b/src/test/test_relaycell.c index 6edc1030f9..05e2b2e347 100644 --- a/src/test/test_relaycell.c +++ b/src/test/test_relaycell.c @@ -988,7 +988,7 @@ test_relaycell_resolved(void *arg) tt_int_op(r, OP_EQ, 0); ASSERT_MARK_CALLED(END_STREAM_REASON_DONE| END_STREAM_REASON_FLAG_ALREADY_SOCKS_REPLIED); - ASSERT_RESOLVED_CALLED(RESOLVED_TYPE_NOERROR, NULL, -1, -1); + ASSERT_RESOLVED_CALLED(RESOLVED_TYPE_ERROR, NULL, -1, -1); /* If we wanted hostnames, we report nothing, since we only had IPs. */ MOCK_RESET(); |