include $(MAKEFILEPATH)/pb_makefiles/platform.make
-MVERS = "mDNSResponder-878.200.35"
+MVERS = "mDNSResponder-878.230.2"
VER =
ifneq ($(strip $(GCC_VERSION)),)
{
debugf("mDNSCoreReceiveResponse: InterfaceID %p %##s (%s)", q->InterfaceID, q->qname.c, DNSTypeName(q->qtype));
m->rec.r.resrec.rDNSServer = uDNSServer = q->qDNSServer;
+ if (!unicastQuestion) unicastQuestion = q; // Acceptable responses to unicast questions need to have (unicastQuestion != nil)
}
else
{
}
}
+#define TrueFalseStr(X) ((X) ? "true" : "false")
+
// This function takes the DNSServer as a separate argument because sometimes the
// caller has not yet assigned the DNSServer, but wants to evaluate the SuppressQuery
// status before switching to it.
}
// Check if the DNS Configuration allows A/AAAA queries to be sent
- if ((q->qtype == kDNSType_A) && (d->req_A))
+ if ((q->qtype == kDNSType_A) && d->req_A)
{
- LogDebug("ShouldSuppressUnicastQuery: Query not suppressed for %##s, qtype %s, DNSServer %##s %#a:%d allows A queries", q->qname.c,
- DNSTypeName(q->qtype), d->domain.c, &d->addr, mDNSVal16(d->port));
- return mDNSfalse;
+ // The server's configuration allows A record queries, so don't suppress this query unless
+ // 1. the interface associated with the server is CLAT46; and
+ // 2. the query has the kDNSServiceFlagsPathEvaluationDone flag, which indicates that it came from libnetcore.
+ // See <rdar://problem/42672030> for more info.
+ if (!(d->isCLAT46 && (q->flags & kDNSServiceFlagsPathEvaluationDone)))
+ {
+ LogDebug("ShouldSuppressUnicastQuery: Query not suppressed for %##s, qtype %s, DNSServer %##s %#a:%d allows A queries", q->qname.c,
+ DNSTypeName(q->qtype), d->domain.c, &d->addr, mDNSVal16(d->port));
+ return mDNSfalse;
+ }
}
- if ((q->qtype == kDNSType_AAAA) && (d->req_AAAA))
+ if ((q->qtype == kDNSType_AAAA) && d->req_AAAA)
{
LogDebug("ShouldSuppressUnicastQuery: Query not suppressed for %##s, qtype %s, DNSServer %##s %#a:%d allows AAAA queries", q->qname.c,
DNSTypeName(q->qtype), d->domain.c, &d->addr, mDNSVal16(d->port));
}
#endif
- LogInfo("ShouldSuppressUnicastQuery: Query suppressed for %##s, qtype %s, since DNS Configuration does not allow (req_A is %s and req_AAAA is %s)",
- q->qname.c, DNSTypeName(q->qtype), d->req_A ? "true" : "false", d->req_AAAA ? "true" : "false");
+ LogInfo("ShouldSuppressUnicastQuery: Query suppressed for %##s, qtype %s, since DNS Configuration does not allow (req_A %s, req_AAAA %s, CLAT46 %s)",
+ q->qname.c, DNSTypeName(q->qtype), TrueFalseStr(d->req_A), TrueFalseStr(d->req_AAAA), TrueFalseStr(d->isCLAT46));
return mDNStrue;
}
mDNSBool req_DO; // If set, okay to send DNSSEC queries (EDNS DO bit is supported)
mDNSBool DNSSECAware; // Set if we are able to receive a response to a request sent with DO option.
mDNSBool isExpensive; // True if the interface to this server is expensive.
+ mDNSBool isCLAT46; // True if the interface to this server is CLAT46.
} DNSServer;
typedef struct
extern void mDNS_RemoveDynDNSHostName(mDNS *m, const domainname *fqdn);
extern void mDNS_SetPrimaryInterfaceInfo(mDNS *m, const mDNSAddr *v4addr, const mDNSAddr *v6addr, const mDNSAddr *router);
extern DNSServer *mDNS_AddDNSServer(mDNS *const m, const domainname *d, const mDNSInterfaceID interface, mDNSs32 serviceID, const mDNSAddr *addr,
- const mDNSIPPort port, mDNSu32 scoped, mDNSu32 timeout, mDNSBool cellIntf, mDNSBool isExpensive, mDNSu16 resGroupID,
- mDNSBool reqA, mDNSBool reqAAAA, mDNSBool reqDO);
+ const mDNSIPPort port, mDNSu32 scoped, mDNSu32 timeout, mDNSBool cellIntf, mDNSBool isExpensive, mDNSBool isCLAT46,
+ mDNSu16 resGroupID, mDNSBool reqA, mDNSBool reqAAAA, mDNSBool reqDO);
extern void PenalizeDNSServer(mDNS *const m, DNSQuestion *q, mDNSOpaque16 responseFlags);
extern void mDNS_AddSearchDomain(const domainname *const domain, mDNSInterfaceID InterfaceID);
#pragma mark - Name Server List Management
#endif
+#define TrueFalseStr(X) ((X) ? "true" : "false")
+
mDNSexport DNSServer *mDNS_AddDNSServer(mDNS *const m, const domainname *d, const mDNSInterfaceID interface, const mDNSs32 serviceID, const mDNSAddr *addr,
- const mDNSIPPort port, mDNSu32 scoped, mDNSu32 timeout, mDNSBool cellIntf, mDNSBool isExpensive, mDNSu16 resGroupID,
- mDNSBool reqA, mDNSBool reqAAAA, mDNSBool reqDO)
+ const mDNSIPPort port, mDNSu32 scoped, mDNSu32 timeout, mDNSBool cellIntf, mDNSBool isExpensive, mDNSBool isCLAT46,
+ mDNSu16 resGroupID, mDNSBool reqA, mDNSBool reqAAAA, mDNSBool reqDO)
{
DNSServer **p = &m->DNSServers;
DNSServer *tmp = mDNSNULL;
if (!d)
d = (const domainname *)"";
- LogInfo("mDNS_AddDNSServer(%d): Adding %#a for %##s, InterfaceID %p, serviceID %u, scoped %d, resGroupID %d req_A is %s req_AAAA is %s cell %s isExpensive %s req_DO is %s",
- NumUnicastDNSServers, addr, d->c, interface, serviceID, scoped, resGroupID, reqA ? "True" : "False", reqAAAA ? "True" : "False",
- cellIntf ? "True" : "False", isExpensive ? "True" : "False", reqDO ? "True" : "False");
+ LogInfo("mDNS_AddDNSServer(%d): Adding %#a for %##s, InterfaceID %p, serviceID %u, scoped %d, resGroupID %d req_A %s, req_AAAA %s, cell %s, expensive %s, CLAT46 %s, req_DO %s",
+ NumUnicastDNSServers, addr, d->c, interface, serviceID, scoped, resGroupID,
+ TrueFalseStr(reqA), TrueFalseStr(reqAAAA), TrueFalseStr(cellIntf), TrueFalseStr(isExpensive), TrueFalseStr(isCLAT46), TrueFalseStr(reqDO));
mDNS_CheckLock(m);
(*p)->timeout = timeout;
(*p)->cellIntf = cellIntf;
(*p)->isExpensive = isExpensive;
+ (*p)->isCLAT46 = isCLAT46;
(*p)->req_A = reqA;
(*p)->req_AAAA = reqAAAA;
(*p)->req_DO = reqDO;
for (s = mDNSStorage.DNSServers; s; s = s->next)
{
NetworkInterfaceInfoOSX *ifx = IfindexToInterfaceInfoOSX(s->interface);
- LogMsgNoIdent("DNS Server %##s %s%s%#a:%d %d %s %d %d %s %s %s %s %s",
+ LogMsgNoIdent("DNS Server %##s %s%s%#a:%d %d %s %d %d %s %s %s %s %s %s",
s->domain.c, ifx ? ifx->ifinfo.ifname : "", ifx ? " " : "", &s->addr, mDNSVal16(s->port),
s->penaltyTime ? s->penaltyTime - mDNS_TimeNow(&mDNSStorage) : 0, DNSScopeToString(s->scoped),
s->timeout, s->resGroupID,
s->req_AAAA ? "v6" : "!v6",
s->cellIntf ? "cell" : "!cell",
s->isExpensive ? "exp" : "!exp",
+ s->isCLAT46 ? "clat46" : "!clat46",
s->DNSSECAware ? "DNSSECAware" : "!DNSSECAware");
}
}
i->isExpensive = (eflags & IFEF_EXPENSIVE) ? mDNStrue: mDNSfalse;
i->isAWDL = (eflags & IFEF_AWDL) ? mDNStrue: mDNSfalse;
+ i->isCLAT46 = (eflags & IFEF_CLAT46) ? mDNStrue: mDNSfalse;
if (eflags & IFEF_AWDL)
{
// Set SupportsUnicastMDNSResponse false for the AWDL interface since unicast reserves
mDNSBool reqA, reqAAAA;
NetworkInterfaceInfoOSX *info;
mDNSBool isExpensive;
+ mDNSBool isCLAT46;
if (!r->domain || !*r->domain)
{
reqA = (r->flags & DNS_RESOLVER_FLAGS_REQUEST_A_RECORDS ? mDNStrue : mDNSfalse);
reqAAAA = (r->flags & DNS_RESOLVER_FLAGS_REQUEST_AAAA_RECORDS ? mDNStrue : mDNSfalse);
info = IfindexToInterfaceInfoOSX(interface);
- isExpensive = info ? info->isExpensive : mDNSfalse;
+ isExpensive = (info && info->isExpensive) ? mDNStrue : mDNSfalse;
+ isCLAT46 = (info && info->isCLAT46) ? mDNStrue : mDNSfalse;
for (n = 0; n < r->n_nameserver; n++)
{
// it takes the sum of all the timeout values for all DNS servers. By doing this, it
// tries all the DNS servers in a specified timeout
s = mDNS_AddDNSServer(&mDNSStorage, &d, interface, serviceID, &saddr, r->port ? mDNSOpaque16fromIntVal(r->port) : UnicastDNSPort, scope,
- (n == 0 ? (r->timeout ? r->timeout : DEFAULT_UDNS_TIMEOUT) : 0), cellIntf, isExpensive, resGroupID, reqA, reqAAAA, mDNStrue);
+ (n == 0 ? (r->timeout ? r->timeout : DEFAULT_UDNS_TIMEOUT) : 0), cellIntf, isExpensive, isCLAT46,
+ resGroupID, reqA, reqAAAA, mDNStrue);
if (s)
{
LogInfo("ConfigDNSServers(%s): DNS server %#a:%d for domain %##s", DNSScopeToString(scope), &s->addr, mDNSVal16(s->port), d.c);
u_int BPF_len;
mDNSBool isExpensive; // True if this interface has the IFEF_EXPENSIVE flag set.
mDNSBool isAWDL; // True if this interface has the IFEF_AWDL flag set.
+ mDNSBool isCLAT46; // True if this interface has the IFEF_CLAT46 flag set.
#ifdef MDNSRESPONDER_USES_LIB_DISPATCH_AS_PRIMARY_EVENT_LOOP_MECHANISM
dispatch_source_t BPF_source;
#else
mDNSAddr DNSAddr;
DNSAddr.type = mDNSAddrType_IPv4;
DNSAddr.ip.v4.NotAnInteger = ina.s_addr;
- mDNS_AddDNSServer(m, NULL, mDNSInterface_Any, 0, &DNSAddr, UnicastDNSPort, kScopeNone, 0, mDNSfalse, mDNSfalse, 0, mDNStrue, mDNStrue, mDNSfalse);
+ mDNS_AddDNSServer(m, NULL, mDNSInterface_Any, 0, &DNSAddr, UnicastDNSPort, kScopeNone, 0, mDNSfalse, mDNSfalse, mDNSfalse, 0, mDNStrue, mDNStrue, mDNSfalse);
numOfServers++;
}
}
*/
#ifndef _DNS_SD_H
-#define _DNS_SD_H 8800035
+#define _DNS_SD_H 8803002
#ifdef __cplusplus
extern "C" {
const mDNSAddr *const dstaddr, const mDNSIPPort dstport, const mDNSInterfaceID iid)
{ ( void ) m; ( void ) msg; ( void ) end; ( void ) srcaddr; ( void ) srcport; ( void ) dstaddr; ( void ) dstport; ( void ) iid; }
DNSServer *mDNS_AddDNSServer(mDNS *const m, const domainname *d, const mDNSInterfaceID interface, const int serviceID, const mDNSAddr *addr, const mDNSIPPort port,
- mDNSu32 scoped, mDNSu32 timeout, mDNSBool cellIntf, mDNSBool isExpensive, mDNSu16 resGroupID, mDNSBool reqA, mDNSBool reqAAAA, mDNSBool reqDO)
-{ ( void ) m; ( void ) d; ( void ) interface; ( void ) serviceID; ( void ) addr; ( void ) port; ( void ) scoped; ( void ) timeout; (void) cellIntf; (void) isExpensive;
+ mDNSu32 scoped, mDNSu32 timeout, mDNSBool cellIntf, mDNSBool isExpensive, mDNSBool isCLAT46, mDNSu16 resGroupID, mDNSBool reqA, mDNSBool reqAAAA, mDNSBool reqDO)
+{ ( void ) m; ( void ) d; ( void ) interface; ( void ) serviceID; ( void ) addr; ( void ) port; ( void ) scoped; ( void ) timeout; (void) cellIntf; (void) isExpensive; (void) isCLAT46;
(void) resGroupID; (void) reqA; (void) reqAAAA; (void) reqDO; return(NULL); }
void mDNS_AddSearchDomain(const domainname *const domain, mDNSInterfaceID InterfaceID) { (void)domain; (void) InterfaceID;}
void mDNS_AddDynDNSHostName(mDNS *m, const domainname *fqdn, mDNSRecordCallback *StatusCallback, const void *StatusContext)
{
mDNSAddr addr;
err = StringToAddress( &addr, ipAddr->IpAddress.String );
- if ( !err ) mDNS_AddDNSServer(m, mDNSNULL, mDNSInterface_Any, 0, &addr, UnicastDNSPort, kScopeNone, DEFAULT_UDNS_TIMEOUT, mDNSfalse, mDNSfalse, 0, mDNStrue, mDNStrue, mDNSfalse);
+ if ( !err ) mDNS_AddDNSServer(m, mDNSNULL, mDNSInterface_Any, 0, &addr, UnicastDNSPort, kScopeNone, DEFAULT_UDNS_TIMEOUT, mDNSfalse, mDNSfalse, mDNSfalse, 0, mDNStrue, mDNStrue, mDNSfalse);
}
exit:
mDNSu32 timeout = dns_server_timeout;
mDNSBool cellIntf = 0;
mDNSBool isExpensive = 0;
+ mDNSBool isCLAT46 = mDNSfalse;
mDNSu16 resGroupID = dns_server_resGroupID;
mDNSBool reqA = mDNStrue;
mDNSBool reqAAAA = mDNStrue;
addr.ip.v4.NotAnInteger = dns_server_ipv4.NotAnInteger;
port.NotAnInteger = client_resp_src_port;
mDNS_AddDNSServer(m, &d, primary_interfaceID, serviceID, &addr, port, scoped, timeout,
- cellIntf, isExpensive, resGroupID,
+ cellIntf, isExpensive, isCLAT46, resGroupID,
reqA, reqAAAA, reqDO);
mDNS_Unlock(m);
return mStatus_NoError;