Home | History | Annotate | Download | only in mDNSCore

Lines Matching full:tcp

519 	const char *prot = n->Protocol == NATOp_MapUDP ? "UDP" : n->Protocol == NATOp_MapTCP ? "TCP" : "?";
652 // Even if we DIDN'T make a successful UPnP mapping yet, we might still have a partially-open TCP connection we need to clean up
731 // with LLQs over TLS/TCP we're doing a weird thing where instead of requesting packets be sent to ExternalAddress:ExternalPort
732 // we're requesting that packets be sent to ExternalPort, but at the source address of our outgoing TCP connection.
733 // Normally, after going through the NAT gateway, the source address of our outgoing TCP connection is the same as ExternalAddress,
734 // so this is fine, except when the TCP connection ends up going over a VPN tunnel instead.
735 // To work around this, if we find that the source address for our TCP connection is not a private address, we tell the Dot Mac
753 if (q->tcp) { LogMsg("sendChallengeResponse: ERROR!!: question %##s (%s) tcp non-NULL", q->qname.c, DNSTypeName(q->qtype)); return; }
775 q->ThisQInterval = q->tcp ? 0 : (kLLQ_INIT_RESEND * q->ntries * mDNSPlatformOneSecond); // If using TCP, don't need to retransmit
786 if (err) { LogMsg("sendChallengeResponse: mDNSSendDNSMessage%s failed: %d", q->tcp ? " (TCP)" : "", err); }
838 // problem of the current implementation of TCP LLQ setup: we're not handling state transitions correctly
962 // tcpCallback is called to handle events (e.g. connection opening and data reception) on TCP connections for
971 q ? &q ->tcp :
972 tcpInfo->rr ? &tcpInfo->rr ->tcp : mDNSNULL;
996 // Lease renewal over TCP, resulting from opening a TCP connection in sendLLQRefresh
1008 llqData.err = GetLLQEventPort(m, &tcpInfo->Addr); // We're using TCP; tell server what UDP port to send notifications to
1016 q->ntries = 0; // Reset ntries so that tcp/tls connection failures don't affect sendChallengeResponse failures
1020 // LLQ Polling mode or non-LLQ uDNS over TCP
1034 if (q->ThisQInterval < (256 * mDNSPlatformOneSecond)) // Now we have a TCP connection open, make sure we wait at least 256 seconds before retrying
1056 // be sending gratuitous replies using UDP and doesn't have a need to leave the TCP socket open.
1068 // over this tcp connection. That is, we only track whether we've received at least one response
1069 // which may have been to a previous request sent over this tcp connection.
1106 // over this tcp connection. That is, we only track whether we've received at least one response
1107 // which may have been to a previous request sent over this tcp connection.
1130 // Note: Sleep code depends on us clearing *backpointer here -- it uses the clearing of rr->tcp
1132 // If we clear the tcp pointer in the question, mDNSCoreReceiveResponse cannot find a matching question. Hence
1139 if (q && q->tcp) {srcPort = q->tcp->SrcPort; q->tcpSrcPort = srcPort;}
1167 // We get here when we fail to establish a new TCP/TLS connection that would have been used for a new LLQ request or an LLQ renewal.
1168 // Note that ThisQInterval is also zero when sendChallengeResponse resends the LLQ request on an extant TCP/TLS connection.
1172 // We didn't get the chance to send our request packet before the TCP/TLS connection failed.
1175 // of TCP/TLS connection failures using ntries.
1207 // We're about to dispose of the TCP connection, so we must reset the state to retry over TCP/TLS
1208 // because sendChallengeResponse will send the query via UDP if we don't have a tcp pointer.
1210 // will attempt to establish a new tcp connection.
1214 // ConnFailed may happen if the server sends a TCP reset or TLS fails, in which case we want to retry establishing the LLQ
1263 if (!info->sock) { LogMsg("MakeTCPConn: unable to create TCP socket"); mDNSPlatformMemFree(info); return(mDNSNULL); }
1278 mDNSexport void DisposeTCPConn(struct tcpInfo_t *tcp)
1280 mDNSPlatformTCPCloseConnection(tcp->sock);
1281 if (tcp->reply) mDNSPlatformMemFree(tcp->reply);
1282 mDNSPlatformMemFree(tcp);
1322 if (q->tcp) LogInfo("startLLQHandshake: Disposing existing TCP connection for %##s (%s)", q->qname.c, DNSTypeName(q->qtype));
1323 if (q->tcp) { DisposeTCPConn(q->tcp); q->tcp = mDNSNULL; }
1342 q->tcp = MakeTCPConn(m, mDNSNULL, mDNSNULL, kTCPSocketFlags_UseTLS, &q->servAddr, q->servPort, &q->nta->Host, q, mDNSNULL);
1343 if (!q->tcp)
1344 q->ThisQInterval = mDNSPlatformOneSecond * 5; // If TCP failed (transient networking glitch) try again in five seconds
1551 // In order to simulate firewalls blocking our outgoing TCP connections, returning immediate ICMP errors or TCP resets,
2667 LogInfo("SendRecordRegistration TCP %p %s", rr->tcp, ARDisplayString(m, rr));
2668 if (rr->tcp) LogInfo("SendRecordRegistration: Disposing existing TCP connection for %s", ARDisplayString(m, rr));
2669 if (rr->tcp) { DisposeTCPConn(rr->tcp); rr->tcp = mDNSNULL; }
2671 rr->tcp = MakeTCPConn(m, &m->omsg, ptr, kTCPSocketFlags_UseTLS, &rr->nta->Addr, rr->nta->Port, &rr->nta->Host, mDNSNULL, rr);
2785 if (anchorRR->tcp) debugf("SendGroupRRMessage: Disposing existing TCP connection for %s", ARDisplayString(m, anchorRR));
2786 if (anchorRR->tcp) { DisposeTCPConn(anchorRR->tcp); anchorRR->tcp = mDNSNULL; }
2788 anchorRR->tcp = MakeTCPConn(m, &m->omsg, ptr, kTCPSocketFlags_UseTLS, &anchorRR->nta->Addr, anchorRR->nta->Port, &anchorRR->nta->Host, mDNSNULL, anchorRR);
2789 if (!anchorRR->tcp) LogInfo("SendGroupRRMessage: Cannot establish TCP connection for %s", ARDisplayString(m, anchorRR));
3032 if (rr->tcp) { DisposeTCPConn(rr->tcp); rr->tcp = mDNSNULL;}
3341 mDNS_snprintf(msgbuf, sizeof(msgbuf), "%s - %d", AddrReply->opcode == NATOp_MapUDPResponse ? "UDP" : "TCP", PortMapReply->err);
3417 if (q->AuthInfo) return(mDNStrue); // Don't need a test query for private queries sent directly to authoritative server over TLS/TCP
3522 if (!srcaddr) LogMsg("uDNS_ReceiveMsg: TCP DNS response had TC bit set: ignoring");
3525 // Don't reuse TCP connections. We might have failed over to a different DNS server
3526 // while the first TCP connection is in progress. We need a new TCP connection to the
3528 if (qptr->tcp) { DisposeTCPConn(qptr->tcp); qptr->tcp = mDNSNULL; }
3529 qptr->tcp = MakeTCPConn(m, mDNSNULL, mDNSNULL, kTCPSocketFlags_Zero, srcaddr, srcport, mDNSNULL, qptr, mDNSNULL);
3590 llq.err = q->tcp ? GetLLQEventPort(m, &q->servAddr) : LLQErr_NoError; // If using TCP tell server what UDP port to send notifications to
3609 if (PrivateQuery(q) && !q->tcp)
3613 q->tcp = MakeTCPConn(m, &m->omsg, end, kTCPSocketFlags_UseTLS, &q->servAddr, q->servPort, &q->nta->Host, q, mDNSNULL);
3619 // if AuthInfo and AuthInfo->AutoTunnel is set, we use the TCP socket but don't need to pass the AuthInfo as
3624 err = mDNSSendDNSMessage(m, &m->omsg, end, mDNSInterface_Any, q->LocalSocket, &q->servAddr, q->servPort, q->tcp ? q->tcp->sock : mDNSNULL, mDNSNULL);
3627 LogMsg("sendLLQRefresh: mDNSSendDNSMessage%s failed: %d", q->tcp ? " (TCP)" : "", err);
3628 if (q->tcp) { DisposeTCPConn(q->tcp); q->tcp = mDNSNULL; }
3735 if (q->tcp) { DisposeTCPConn(q->tcp); q->tcp = mDNSNULL; }
3737 q->tcp = MakeTCPConn(m, mDNSNULL, mDNSNULL, kTCPSocketFlags_UseTLS, &zoneInfo->Addr, zoneInfo->Port, &q->nta->Host, q, mDNSNULL);
3944 LogInfo("SendRecordDeregistration TCP %p %s", rr->tcp, ARDisplayString(m, rr));
3945 if (rr->tcp) LogInfo("SendRecordDeregistration: Disposing existing TCP connection for %s", ARDisplayString(m, rr));
3946 if (rr->tcp) { DisposeTCPConn(rr->tcp); rr->tcp = mDNSNULL; }
3948 rr->tcp = MakeTCPConn(m, &m->omsg, ptr, kTCPSocketFlags_UseTLS, &rr->nta->Addr, rr->nta->Port, &rr->nta->Host, mDNSNULL, rr);
4003 // NOTE: SSL handshake failures normally free the TCP connection immediately. Hence, you may not
4004 // find the TCP below there. This case can happen only when tcp is trying to actively retransmit
4014 if (AuthRecord_uDNS(rr) && mDNSSameOpaque16(anchorRR->updateid, rr->updateid) && anchorRR->tcp)
4019 DisposeTCPConn(anchorRR->tcp);
4020 anchorRR->tcp = mDNSNULL;
4529 if (rr->tcp) { DisposeTCPConn(rr->tcp); rr->tcp = mDNSNULL; }