diff options
author | David Goulet <dgoulet@torproject.org> | 2024-10-10 13:22:23 +0000 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2024-10-10 13:22:23 +0000 |
commit | 7383d462fb51473371f8a1f53aff52af8ed09766 (patch) | |
tree | 8fc9b855d3d924794904469c3447bf681b469cee /src/feature/client/dnsserv.c | |
parent | 364b8c292567fc2fada7639e50874fc719d7ce09 (diff) | |
parent | 3d2f7c3467e7aff545d8e22ffd4153d7598c6d7c (diff) | |
download | tor-7383d462fb51473371f8a1f53aff52af8ed09766.tar.gz tor-7383d462fb51473371f8a1f53aff52af8ed09766.zip |
Merge branch 'empty-dns' into 'main'
Handle empty DNS reply without error as NOERROR
Closes #40248
See merge request tpo/core/tor!830
Diffstat (limited to 'src/feature/client/dnsserv.c')
-rw-r--r-- | src/feature/client/dnsserv.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/feature/client/dnsserv.c b/src/feature/client/dnsserv.c index f0bb0af100..237a6ee3d3 100644 --- a/src/feature/client/dnsserv.c +++ b/src/feature/client/dnsserv.c @@ -319,6 +319,7 @@ 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: @@ -379,6 +380,8 @@ 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; } |