aboutsummaryrefslogtreecommitdiff
path: root/Dns64Configuration.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Replace android::sp by std::shared_ptr and drop the libutils dependencyKen Chen2023-12-141-3/+1
| | | | | | Bug: 298596613 Test: m; flash; atest Change-Id: I65635a7d985869fb02953ca00357fedac99c0133
* Fix use-after-free in DNS64 discovery threadKen Chen2023-08-091-7/+10
| | | | | | | | | | | | | | | | | DNS64 discovery thread is detached from binder requesting thread. But the discovery thread references resources not belongs to itself, which can be destroyed in dnsresolver destruction. Holds a strong pointer of Dns64Configuration in DNS64 discovery thread so that the instance of Dns64Configuration will keep until the DNS64 thread is force terminated. Ignore-AOSP-First: Fix security vulnerability Bug: 278303745 Test: atest Merged-In: Id74ea4e6f54a00805d3cc8a9d7e15e58a473b7d3 Change-Id: Id74ea4e6f54a00805d3cc8a9d7e15e58a473b7d3 (cherry picked from commit 254115584ff558fb87ee6ec5f5bb043f76219910)
* Remove redundant "using" statementsYi Kong2022-02-181-1/+0
| | | | | | | | They are already under the same namespace. Test: presubmit Bug: 219872355 Change-Id: Ibbd5dc4bed7779eee99f553f8dc3e7a8f0bec4bd
* Replace StringPrintf() with fmt::format()chenbruce2021-08-201-2/+1
| | | | | | Bug: 196298216 Test: cd packages/modules/DnsResolver && atest Change-Id: I581c282bba1527afd2be9daf925e9ec5bd2e5cd6
* Stop depend on libnetd_client_headerLuke Huang2020-05-301-1/+0
| | | | | | | | | | | Use the new one libnetdbinder_utils which only included required header from netd. Create dnsproxyd_protocol_headers for NETID_USE_LOCAL_NAMESERVERS. Bug: 151895202 Test: build, atest Change-Id: I13d56bbce94614865fb0d892b1ce0c6f2fffe4af Merged-In: I13d56bbce94614865fb0d892b1ce0c6f2fffe4af
* Merge "Style fixes in the external pref64 support."Lorenzo Colitti2020-05-261-4/+5
|\
| * Style fixes in the external pref64 support.Lorenzo Colitti2020-05-211-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | - Address a code review comment to pass a variable by reference instead of by pointer. - Add two missed EXCLUDES() thread-safety annotations. - Make "dumpsys dnsresolver" report externally-set prefixes differently from discovered prefixes. Bug: 156914456 Test: existing unit tests pass Change-Id: Ifcdb16cc66c9234a2bd5f8aac70be809fe0dd223
* | Merge "Support DNS64 synthesis using externally-discovered prefixes."Lorenzo Colitti2020-05-211-6/+45
|\|
| * Support DNS64 synthesis using externally-discovered prefixes.Lorenzo Colitti2020-05-211-6/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the DNS resolver supports DNS64 synthesis only for prefixes that it discovered itself, and not for NAT64 prefixes discovered via other means (e.g., RA). Add a way to set a NAT64 prefix that was discovered by other means. This new IPC is mutually exclusive with the existing prefix discovery mechansisms: - Setting the prefix has no effect if prefix discovery is started. - Starting (or stopping) prefix discovery clears the prefix. - Setting the prefix does not result in any NAT64 prefix update callback. It is the responsibility of the caller (ConnectivityService, Nat464Xlat) to ensure that prefix discovery is stopped before setting the prefix. This does not add any significant complexity to the connectivity code, and it ensures that the behaviour of the existing IPCs (startPrefix64Discovery and stopPrefix64Discovery) are unchanged. This is necessary to ensure that DNS64 synthesis continues to work on Q devices. Disallowing concurrent use of prefix discovery and externally-set prefixes also simplifies the implementation because it allows reuse of most of the data structures and teardown code in Dns64Configuration. The externally-set prefix is represented by a Dns64Configuration with a special discovery ID of kNoDiscoveryId (== 0), which cannot be used by any discovery attempt. That way, if discovery is started, then stopped, and then the prefix is set, if a stale discovery thread then completes, it will be ignored because the thread's ID cannot be kNoDiscoveryId. Bug: 153694684 Bug: 156914456 Test: new tests in resolv_integration_test Change-Id: I7c63fb62b70635a1b5cc7a21d60f091ba2705d72
* | Don't use Fwmark to rename threadsMike Yu2020-05-211-1/+3
|/ | | | | | | | | | | | Use the least 16 significant bits, which are supposed to represent netId, of the network mark for resolver threads name. This is in preparation for dropping Fwmark used in DnsResolver. No naming rule change. Bug: 151895202 Test: adb shell ps -AT $(adb shell pidof netd) Change-Id: Ie1724dc5775cdeff6ee00a51b5f74e8f8a32d5d3
* Set the name for resolver threadsMike Yu2019-08-131-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The threads in the resolver are renamed, including: - Threads for lookup (name: Dns_<netId>_<appId>) - Threads for private dns validation (name: TlsVerify_<netId>) - Threads for NAT64 prefix discovery (name: Nat64Pfx_<netId>) - Threads for communicating with private dns (name: TlsListen_<netId>) - Threads for reconnecting private dns (name: TlsReconn_<netId>) Example from ps -AT: root 756 3418 1 2501400 7352 futex_wait_queue_me 0 S Dns_105_1073 root 756 3419 1 2501400 7352 do_sys_poll 0 S TlsVerify_105 root 756 3420 1 2501400 7352 do_sys_poll 0 S TlsVerify_105 root 756 3422 1 2501400 7352 do_sys_poll 0 S TlsVerify_105 root 756 3428 1 2501400 7352 do_sys_poll 0 S TlsListen_105 Also, reveal some logs for private dns validation status to facilitate debugging analysis. Example: 790 4364 W resolv : Validating DnsTlsServer on netId 100 790 4364 W resolv : Validation failed 790 4366 W resolv : Validating DnsTlsServer on netId 100 790 4366 W resolv : Validation success Bug: 128404051 Test: atest --include-subdirs packages/modules/DnsResolver Change-Id: Ide93b1099535552a8615c71353226c1aa70462e3
* Fill in each dns stats value in message NetworkDnsEventReportedlifr2019-06-271-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Result dump metric_id: 1111 event_metrics { data { elapsed_timestamp_nanos: 166844290056 atom { network_dns_event_reported { event_type: EVENT_GETADDRINFO return_code: RC_EAI_NO_ERROR latency_micros: 78961 hints_ai_flags: 1024 res_nsend_flags: -1 network_type: NT_UNKNOWN private_dns_modes: PDM_STRICT dns_query_events { dns_query_event { rcode: NS_R_NO_ERROR type: NS_T_A ip_version: IV_IPV4 protocol: PROTO_DOT dns_server_index: 0 latency_micros: 77843 } } } } } Bug: 119862317 Test: ./out/host/linux-x86/bin/statsd_testdrive 116 Change-Id: Ia9d2ca076cdd95df206f573531a17badb34fda62
* Separate resolv_getaddrinfo from android_getaddrinfofornetcontextLuke Huang2019-06-211-2/+1
| | | | | | | | | | 1. Separate resolv_getaddrinfo from android_getaddrinfofornetcontext which only do explore_fqdn() 2. cleanup for android_getaddrinfofornetcontext/explore_fqdn Bug: 135506574 Test: cd system/netd && atest Change-Id: Ie5c9721f69a9c3dcf5941bd4321d076bb99c313a
* Use header_libs instead of include_dirs for resolvLuke Huang2019-06-141-1/+1
| | | | | | | | | | include libnetd_client_headers explicitly Bug: 135235267 Test: m cd system/netd && atest Change-Id: Iaeff2072ad0dcab8e42429cc4ae21f2dc3618004
* Move ScopedAddrinfo to libnetdutilsLuke Huang2019-06-141-3/+4
| | | | | | | | | This is a preparation step for stopping include system/netd/include. Bug: 135235267 Test: m cd system/netd && atest Change-Id: Idfe5e25e8016881987c322b333ea37c502e5d7ca
* Finish removing ALOG() from system/netd/resolv/chenbruce2019-06-121-12/+11
| | | | | | | | | | | Change all the debug function to LOG(X) from ALOGx() for resolver module. Bug: 134119725 Test: built, flashed, booted Test: Checking logs for different level. Test: Example: Test: adb shell service call dnsresolver 10 i32 1 for DNS_RESOLVER_LOG_DEBUG Change-Id: I20f8e284ffaf1cbeef8118b052686d3fa6fb8302
* Move internal functions out of libnetd_resolv's public headersBernie Innocenti2019-05-291-0/+1
| | | | | | | | | | | | This is yet another preparatory change before enableing the ABI checker. Internal functions are now declared in non-public headers paired with the source files where they are declared. A followup change could further split resolv_private.h. Bug: 133117690 Test: No functionality changes, just run atest. Change-Id: I66ab2f9856e7faa82c74a8ef3fbdeef579577c64
* Unify log tag of DNS resolverKen Chen2019-04-151-1/+1
| | | | | | | | | Set LOG_TAG to "resolv" on DNS resolver. Then, the log can be filtered by "adb logcat [filterspecs]", such as "adb logcat *:S resolv:*", or 'grep'. Test: resolv_integration_test pass Change-Id: Ic4f97685d487257560ec3dfe62bab0d187bf9d93
* Migrate resolver related binder commands to libnetd_resolv binderLuke Huang2019-03-291-0/+232
In order to decrease API between libnetd_resolv and netd, migrate resolver related commands to libnetd_resolv. After migration done, netd's resolver related commands will be removed in following commits. Bug: 126141549 Test: N/A. Note that this commit will cause build break, it must be grouped with following clean-up commits. Change-Id: Id0c2e20ce6a87b5c01ae5bcb998381099889306e