*) May negatively impact connection delay times.
DOC_END
+NAME: dns_v4_first
+TYPE: onoff
+DEFAULT: off
+LOC: Config.dns.v4_first
+IFDEF: !USE_DNSSERVERS
+DOC_START
+ With the IPv6 Internet being as fast or faster than IPv4 Internet
+ for most networks Squid prefers to contact websites over IPv6.
+
+ This option reverses the order of preference to make Squid contact
+ dual-stack websites over IPv4 first. Squid will still perform both
+ IPv6 and IPv4 DNS lookups before connecting.
+
+ WARNING:
+ This option will restrict the situations under which IPv6
+ connectivity is used (and tested). Hiding network problems
+ which would otherwise be detected and warned about.
+DOC_END
+
NAME: ipcache_size
COMMENT: (number of entries)
TYPE: int
debugs(78, 6, HERE << "Merging DNS results " << q->name << " AAAA has " << q->initial_AAAA.count << " RR, A has " << n << " RR");
+ if (Config.dns.v4_first) {
+ memcpy( tmp, message->answer, (sizeof(rfc1035_rr)*n) );
+ tmp += n;
+ /* free the RR object without freeing its child strings (they are now taken by the copy above) */
+ safe_free(message->answer);
+ }
+
memcpy(tmp, q->initial_AAAA.answers, (sizeof(rfc1035_rr)*(q->initial_AAAA.count)) );
tmp += q->initial_AAAA.count;
/* free the RR object without freeing its child strings (they are now taken by the copy above) */
safe_free(q->initial_AAAA.answers);
- memcpy( tmp, message->answer, (sizeof(rfc1035_rr)*n) );
- /* free the RR object without freeing its child strings (they are now taken by the copy above) */
- safe_free(message->answer);
+ if (!Config.dns.v4_first) {
+ memcpy( tmp, message->answer, (sizeof(rfc1035_rr)*n) );
+ /* free the RR object without freeing its child strings (they are now taken by the copy above) */
+ safe_free(message->answer);
+ }
n += q->initial_AAAA.count;
q->initial_AAAA.count = 0;