Makes split-stack systems default to IPv4-only connections.
Adds "ipv6=on|off" option to icap_service config to make Squid do
IPv6-only connections for particular service.
There is currently no middle ground with connection failover possible.
<tag>https_port intercept sslbump connection-auth[=on|off]</tag>
<p>New port options. see http_port.
- <tag>icap_service bypass=on|off|1|0 routing=on|off|1|0</tag>
- <p>New options 'bypass=' and 'routing='.
+ <tag>icap_service bypass=on|off|1|0 routing=on|off|1|0 ipv6=on|off</tag>
+ <p>New options 'bypass=', 'routing=' and 'ipv6='.
<verb>
bypass=on|off|1|0
If set to 'on' or '1', the ICAP service is treated as
Routing is not allowed by default: the ICAP X-Next-Services
response header is ignored.
+
+ ipv6=on|off
+ Only has effect on split-stack systems. The default on those systems
+ is to use IPv4-only connections. When set to 'on' this option will
+ make Squid use IPv6-only connections to contact this ICAP service.
</verb>
<tag>logfile_rotate</tag>
Adaptation::ServiceConfig::ServiceConfig():
port(-1), method(methodNone), point(pointNone),
- bypass(false), routing(false)
+ bypass(false), routing(false), ipv6(false)
{}
const char *
grokked = grokBool(bypass, name, value);
else if (strcmp(name, "routing") == 0)
grokked = grokBool(routing, name, value);
- else {
+ if (strcmp(name, "ipv6") == 0) {
+ grokked = grokBool(ipv6, name, value);
+ } else {
debugs(3, 0, cfg_filename << ':' << config_lineno << ": " <<
"unknown adaptation service option: " << name << '=' << value);
}
VectPoint point; // where the adaptation happens (pre- or post-cache)
bool bypass;
bool routing; ///< whether this service may determine the next service(s)
+ bool ipv6; ///< whether this service uses IPv6 transport (default IPv4)
protected:
Method parseMethod(const char *buf) const;
#include "pconn.h"
#include "HttpRequest.h"
#include "HttpReply.h"
+#include "ip/tools.h"
#include "acl/FilledChecklist.h"
#include "icap_log.h"
#include "fde.h"
disableRetries(); // we only retry pconn failures
Ip::Address outgoing;
+ if (!Ip::EnableIpv6 && !outgoing.SetIPv4()) {
+ debugs(31, DBG_CRITICAL, "ERROR: IPv6 is disabled. " << outgoing << " is not an IPv4 address.");
+ dieOnConnectionFailure(); // throws
+ }
+ /* split-stack for now requires default IPv4-only socket */
+ if (Ip::EnableIpv6&IPV6_SPECIAL_SPLITSTACK && outgoing.IsAnyAddr() && !s.cfg().ipv6) {
+ outgoing.SetIPv4();
+ }
+
connection = comm_open(SOCK_STREAM, 0, outgoing,
COMM_NONBLOCKING, s.cfg().uri.termedBuf());
Routing is not allowed by default: the ICAP X-Next-Services
response header is ignored.
+ ipv6=on|off
+ Only has effect on split-stack systems. The default on those systems
+ is to use IPv4-only connections. When set to 'on' this option will
+ make Squid use IPv6-only connections to contact this ICAP service.
+
Older icap_service format without optional named parameters is
deprecated but supported for backward compatibility.