diff options
author | Erik Kline <ek@google.com> | 2014-09-22 13:32:27 +0900 |
---|---|---|
committer | Erik Kline <ek@google.com> | 2014-09-24 16:02:31 +0900 |
commit | 0ec5dfa1da6a97532dc8cca825bae4edfb7d3dce (patch) | |
tree | 34185fdc8520137e7aaa4e711f4f6bf4511da514 /config.c | |
parent | dce3ddf54083ccd0e3752c4c08013688f79baa7a (diff) | |
download | platform_external_android-clat-0ec5dfa1da6a97532dc8cca825bae4edfb7d3dce.tar.gz platform_external_android-clat-0ec5dfa1da6a97532dc8cca825bae4edfb7d3dce.tar.bz2 platform_external_android-clat-0ec5dfa1da6a97532dc8cca825bae4edfb7d3dce.zip |
Simplify and always retry DNS64 prefix discovery.android-cts-5.0_r9android-cts-5.0_r8android-cts-5.0_r7android-cts-5.0_r6android-cts-5.0_r5android-cts-5.0_r4android-cts-5.0_r3android-5.0.2_r3android-5.0.2_r1android-5.0.1_r1android-5.0.0_r7android-5.0.0_r6android-5.0.0_r5.1android-5.0.0_r5android-5.0.0_r4android-5.0.0_r3android-5.0.0_r2android-5.0.0_r1lollipop-releaselollipop-devlollipop-cts-release
- Only request AAAAs for the IPv4-only hostname, since that's
all the information being used. Perhaps at some point in the
future when _validation_ of the IPv4 address(es)'s presence
within the IPv6 address(es) is being done this should be
revisited.
- Only use the first AAAA returned to find the DNS64 prefix.
It's not clear how to properly resolve any potential DNS64
prefix conflicts anyway.
- Re-try DNS64 prefix discovery on any type of error.
If clatd was started (presumably an IPv6-only network), retry
DNS64 prefix discovery with exponential backoff. Some
"permanent" errors can be indistinguishable from transient
errors (e.g. receiving an erroneous SERVFAIL from a DNS
resolver, ...).
- Fix-up back-off logic to not sleep 128 then 120, 120, ...
:-)
Bug: 17569702
Change-Id: I226ea7772cd7c88d2b60153ef76e5435400e11aa
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -165,16 +165,11 @@ void dns64_detection(unsigned net_id) { memcpy(&Global_Clatd_Config.plat_subnet, &tmp_ptr, sizeof(struct in6_addr)); return; } - if(status < 0) { - logmsg(ANDROID_LOG_FATAL, "dns64_detection/no dns64, giving up\n"); - exit(1); - } - logmsg(ANDROID_LOG_WARN, "dns64_detection failed, sleeping for %d seconds", backoff_sleep); + logmsg(ANDROID_LOG_WARN, "dns64_detection -- error, sleeping for %d seconds", backoff_sleep); sleep(backoff_sleep); + backoff_sleep *= 2; if(backoff_sleep >= 120) { backoff_sleep = 120; - } else { - backoff_sleep *= 2; } } } |