]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Revert "Handle empty DNS reply without error as NOERROR"
authorDavid Goulet <dgoulet@torproject.org>
Mon, 21 Oct 2024 16:03:54 +0000 (12:03 -0400)
committerDavid Goulet <dgoulet@torproject.org>
Mon, 21 Oct 2024 16:03:54 +0000 (12:03 -0400)
Closes #40984

This reverts commit 3d2f7c3467e7aff545d8e22ffd4153d7598c6d7c.

src/core/or/or.h
src/core/or/relay.c
src/feature/client/dnsserv.c
src/test/test_relaycell.c

index c736d37fb9555341344d7616cf8f7e3c8eb48dbd..088c45342b673936afcf2be13c81eb06d3262d89 100644 (file)
@@ -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  */
index 9e62538421b5c18f3c8bc8566339928f13462f9a..f7d200c18d5620585d103ad144b65e8abd10fd02 100644 (file)
@@ -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;
   }
 
index 237a6ee3d3dd4a05ba0dcbd95cc8da334bdaad1b..f0bb0af100ae807fbdf73b5b3ff98a5e1c54ec4d 100644 (file)
@@ -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;
   }
index 6edc1030f900c2b6583e979ad13d0fa065c02baf..05e2b2e347a31266ef6d72573e2cce7f13ed6c12 100644 (file)
@@ -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();