Fix PDM_UNKNOWN in private_dns_modes
When a lookup can be found in the cache, the code doesn't go in
res_tls_send() and then misses to set private_dns_modes. To fix it,
set the value in the beginning of the lookup threads to ensure
it is set at least once.
Bug: 144881031
Test: m com.android.resolv
Change-Id: Id3a3383403a381c5f73f7214ce1d768a98bb2eb5
diff --git a/res_send.cpp b/res_send.cpp
index 60c63c3..cef339a 100644
--- a/res_send.cpp
+++ b/res_send.cpp
@@ -1085,8 +1085,9 @@
return PrivateDnsModes::PDM_OPPORTUNISTIC;
case PrivateDnsMode::STRICT:
return PrivateDnsModes::PDM_STRICT;
+ default:
+ return PrivateDnsModes::PDM_UNKNOWN;
}
- return PrivateDnsModes::PDM_UNKNOWN;
}
static int res_tls_send(res_state statp, const Slice query, const Slice answer, int* rcode,