Increase the maximum exponential backoff for DNS64 queries.
Currently, we only scale down DNS64 detection queries to one
every two minutes. This wastes power on true IPv6-only networks
such as the IMS networks of many operators. The only possible
benefit is that if a NAT64 were to appear on a previously
IPv6-only network, we detect it within two minutes.
Set the maximum backoff to one query per 30 minutes, while
maintaining the exponential backoff starting at 1 second.
Bug: 62650901
Test: bullhead successfully detects NAT64 network
Change-Id: Ia411018b92722615c3ac52bc7f360094bc96532f
diff --git a/config.c b/config.c
index b147868..2d7085b 100644
--- a/config.c
+++ b/config.c
@@ -180,8 +180,11 @@
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;
+ if(backoff_sleep >= 1800) {
+ // Scale down to one DNS query per half hour. Unnecessary DNS queries waste power, and the
+ // benefit is minimal (basically, only limited to the case where a network goes from IPv6-only
+ // to IPv6 with NAT64).
+ backoff_sleep = 1800;
}
}
}