debugs(3, DBG_CRITICAL, "FATAL: IPv6 is not enabled.");
self_destruct();
}
- } else
- if ((t = strchr(token, ':'))) {
- /* host:port */
- host = token;
- *t = '\0';
- port = xatos(t + 1);
-
- if (0 == port)
- self_destruct();
- } else if ((port = strtol(token, &tmp, 10)), !*tmp) {
- /* port */
- } else {
- host = token;
- port = 0;
- }
+ } else if ((t = strchr(token, ':'))) {
+ /* host:port */
+ host = token;
+ *t = '\0';
+ port = xatos(t + 1);
+
+ if (0 == port)
+ self_destruct();
+ } else if ((port = strtol(token, &tmp, 10)), !*tmp) {
+ /* port */
+ } else {
+ host = token;
+ port = 0;
+ }
if (NULL == host)
ipa.SetAnyAddr();
/* TPROXYv2 is not IPv6 capable. Force wildcard sockets to IPv4. Die on IPv6 IPs */
debugs(3, DBG_IMPORTANT, "Disabling IPv6 on port " << test << " (TPROXYv2 interception enabled)");
if ( test.IsIPv6() && !test.SetIPv4() ) {
- debugs(3, DBG_CRITICAL, "IPv6 requires TPROXYv4 support. You only have TPROXYv2 for " << test );
+ debugs(3, DBG_CRITICAL, "IPv6 requires TPROXYv4 support. You only have TPROXYv2 for " << test );
return false;
}
}
ip4ptrs[num_ip4] = &aaddrs[t];
num_ip4++;
}
- }
- else if (aaddrs[t].IsIPv6()) {
+ } else if (aaddrs[t].IsIPv6()) {
debugs(14,8, HERE << "A[" << t << "]=IPv6 " << aaddrs[t]);
// check against IPv6 pruned list
for (c = 0; c <= num_ip6; c++) {
ip4ptrs[num_ip4] = &baddrs[t];
num_ip4++;
}
- }
- else if (baddrs[t].IsIPv6()) {
+ } else if (baddrs[t].IsIPv6()) {
// check against IPv6 pruned list
for (c = 0; c <= num_ip6; c++) {
if (ip6ptrs[c] && baddrs[t] == *ip6ptrs[c]) break; // duplicate.