commit | 0d08fbea8dce204e45edcf5e5fa1edd1484d1e3e | [log] [tgz] |
---|---|---|
author | Ken Chen <cken@google.com> | Tue Oct 22 21:38:20 2019 +0800 |
committer | Ken Chen <cken@google.com> | Tue Oct 29 07:31:58 2019 +0800 |
tree | 8196640f2ad9ac4a4ac90fc1ebb98c4140c226c0 | |
parent | effead990e4cbc5d2f257214aaf19650494566da [diff] |
Support variety of IPv6 addresses on RDNS-on-cache IPv6 address has multiple representation formats. The following addresses are the same: "2001:db8::102:304" "2001:0db8:0000:0000:0000:0000:0102:0304" "2001:db8::1.2.3.4" In original design, the RDNS-on-cache can only match IPv6 address with format "2001:db8::102:304", but not with the others. It is because all different representations are converted to a single binary form while they are stored in cache. And of course, it will be a single format if the cached IP address is converted back to text form while doing text comparison. In this commit, the RDNS-on-cache converts query address to binary form and binary compares with cached entry, rather than text comparison. Also, add two test cases. Bug: 131051938 Test: atest resolv_cache_unit_test.cpp#GetHostByAddrFromCache_InvalidArgs atest resolv_cache_unit_test.cpp#GetHostByAddrFromCache Change-Id: I064f4bafca91ad7dbbd9b37ce3c2d05f8d6b954d
This code uses LOG(X) for logging. Log levels are VERBOSE,DEBUG,INFO,WARNING and ERROR. The default setting is WARNING and logs relate to WARNING and ERROR will be shown. If you want to enable the DEBUG level logs, using following command. adb shell service call dnsresolver 10 i32 1 VERBOSE 0 DEBUG 1 INFO 2 WARNING 3 ERROR 4 Verbose resolver logs could contain PII -- do NOT enable in production builds.