Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 331965
Collapse All | Expand All

(-)./src/dns_internal.cc (-1 / +12 lines)
Lines 201-210 Link Here
201
201
202
    if (A.IsAnyAddr()) {
202
    if (A.IsAnyAddr()) {
203
        debugs(78, 0, "WARNING: Squid does not accept " << A << " in DNS server specifications.");
203
        debugs(78, 0, "WARNING: Squid does not accept " << A << " in DNS server specifications.");
204
        A = "127.0.0.1";
204
        A.SetLocalhost();
205
        debugs(78, 0, "Will be using " << A << " instead, assuming you meant that DNS is running on the same machine");
205
        debugs(78, 0, "Will be using " << A << " instead, assuming you meant that DNS is running on the same machine");
206
    }
206
    }
207
207
208
    if (!Ip::EnableIpv6 && !A.SetIPv4()) {
209
        debugs(78, DBG_IMPORTANT, "WARNING: IPv6 is disabled. Discarding " << A << " in DNS server specifications.");
210
        return;
211
    }
212
208
    if (nns == nns_alloc) {
213
    if (nns == nns_alloc) {
209
        int oldalloc = nns_alloc;
214
        int oldalloc = nns_alloc;
210
        ns *oldptr = nameservers;
215
        ns *oldptr = nameservers;
Lines 742-747 Link Here
742
    else
747
    else
743
        addr = Config.Addrs.udp_incoming;
748
        addr = Config.Addrs.udp_incoming;
744
749
750
    if (nameservers[ns].S.IsIPv4() && !addr.SetIPv4()) {
751
        debugs(31, DBG_CRITICAL, "ERROR: Cannot contact DNS nameserver " << nameservers[ns].S << " from " << addr);
752
        addr.SetAnyAddr();
753
        addr.SetIPv4();
754
    }
755
745
    vc->queue = new MemBuf;
756
    vc->queue = new MemBuf;
746
757
747
    vc->msg = new MemBuf;
758
    vc->msg = new MemBuf;
(-)./src/forward.cc (-2 / +2 lines)
Lines 870-878 Link Here
870
870
871
    // if IPv6 is disabled try to force IPv4-only outgoing.
871
    // if IPv6 is disabled try to force IPv4-only outgoing.
872
    if (!Ip::EnableIpv6 && !outgoing.SetIPv4()) {
872
    if (!Ip::EnableIpv6 && !outgoing.SetIPv4()) {
873
        debugs(50, 4, "fwdConnectStart: " << xstrerror());
873
        debugs(50, 4, "fwdConnectStart: IPv6 is Disabled. Cannot connect from " << outgoing);
874
        ErrorState *anErr = errorCon(ERR_CONNECT_FAIL, HTTP_SERVICE_UNAVAILABLE, request);
874
        ErrorState *anErr = errorCon(ERR_CONNECT_FAIL, HTTP_SERVICE_UNAVAILABLE, request);
875
        anErr->xerrno = errno;
875
        anErr->xerrno = EAFNOSUPPORT;
876
        fail(anErr);
876
        fail(anErr);
877
        self = NULL;	// refcounted
877
        self = NULL;	// refcounted
878
        return;
878
        return;
(-)./src/neighbors.cc (+15 lines)
Lines 46-51 Link Here
46
#include "Store.h"
46
#include "Store.h"
47
#include "icmp/net_db.h"
47
#include "icmp/net_db.h"
48
#include "ip/IpAddress.h"
48
#include "ip/IpAddress.h"
49
#include "ip/tools.h"
49
50
50
/* count mcast group peers every 15 minutes */
51
/* count mcast group peers every 15 minutes */
51
#define MCAST_COUNT_RATE 900
52
#define MCAST_COUNT_RATE 900
Lines 1387-1392 Link Here
1387
1388
1388
    IpAddress temp(getOutgoingAddr(NULL,p));
1389
    IpAddress temp(getOutgoingAddr(NULL,p));
1389
1390
1391
    // if IPv6 is disabled try to force IPv4-only outgoing.
1392
    if (!Ip::EnableIpv6 && !temp.SetIPv4()) {
1393
        debugs(50, DBG_IMPORTANT, "WARNING: IPv6 is disabled. Failed to use " << temp << " to probe " << p->host);
1394
        return ret;
1395
    }
1396
1397
    // if IPv6 is split-stack, prefer IPv4
1398
    if (Ip::EnableIpv6&IPV6_SPECIAL_SPLITSTACK) {
1399
        // NP: This is not a great choice of default,
1400
        // but with the current Internet being IPv4-majority has a higher success rate.
1401
        // if setting to IPv4 fails we dont care, that just means to use IPv6 outgoing.
1402
        temp.SetIPv4();
1403
    }
1404
1390
    fd = comm_open(SOCK_STREAM, IPPROTO_TCP, temp, COMM_NONBLOCKING, p->host);
1405
    fd = comm_open(SOCK_STREAM, IPPROTO_TCP, temp, COMM_NONBLOCKING, p->host);
1391
1406
1392
    if (fd < 0)
1407
    if (fd < 0)
(-)./src/tunnel.cc (+19 lines)
Lines 46-51 Link Here
46
#include "client_side.h"
46
#include "client_side.h"
47
#include "MemBuf.h"
47
#include "MemBuf.h"
48
#include "http.h"
48
#include "http.h"
49
#include "ip/tools.h"
49
50
50
class TunnelStateData
51
class TunnelStateData
51
{
52
{
Lines 641-646 Link Here
641
    statCounter.server.other.requests++;
642
    statCounter.server.other.requests++;
642
    /* Create socket. */
643
    /* Create socket. */
643
    IpAddress temp = getOutgoingAddr(request,NULL);
644
    IpAddress temp = getOutgoingAddr(request,NULL);
645
646
    // if IPv6 is disabled try to force IPv4-only outgoing.
647
    if (!Ip::EnableIpv6 && !temp.SetIPv4()) {
648
        debugs(50, 4, "tunnelStart: IPv6 is Disabled. Tunnel failed from " << temp);
649
        err = errorCon(ERR_CONNECT_FAIL, HTTP_SERVICE_UNAVAILABLE, request);
650
        err->xerrno = EAFNOSUPPORT;
651
        errorSend(fd, err);
652
        return;
653
    }
654
655
    // if IPv6 is split-stack, prefer IPv4
656
    if (Ip::EnableIpv6&IPV6_SPECIAL_SPLITSTACK) {
657
        // NP: This is not a great choice of default,
658
        // but with the current Internet being IPv4-majority has a higher success rate.
659
        // if setting to IPv4 fails we dont care, that just means to use IPv6 outgoing.
660
        temp.SetIPv4();
661
    }
662
644
    int flags = COMM_NONBLOCKING;
663
    int flags = COMM_NONBLOCKING;
645
    if (request->flags.spoof_client_ip) {
664
    if (request->flags.spoof_client_ip) {
646
        flags |= COMM_TRANSPARENT;
665
        flags |= COMM_TRANSPARENT;

Return to bug 331965