mDNSResponder: Update to v567

The sources can be obtained via:

https://opensource.apple.com/tarballs/mDNSResponder/mDNSResponder-567.tar.gz

Update #3522.
This commit is contained in:
Sebastian Huber 2018-09-19 08:49:34 +02:00
parent 111789e4af
commit e36ca10181
24 changed files with 308 additions and 171 deletions

BIN
mDNSResponder/.DS_Store vendored Normal file

Binary file not shown.

BIN
mDNSResponder/._.DS_Store Normal file

Binary file not shown.

BIN
mDNSResponder/Clients/.DS_Store vendored Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,6 +1,6 @@
# -*- tab-width: 4 -*- # -*- tab-width: 4 -*-
# #
# Copyright (c) 2002-2004 Apple Computer, Inc. All rights reserved. # Copyright (c) 2002-2004, 2015 Apple Computer, Inc. All rights reserved.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -20,6 +20,10 @@
# $+ means "The names of all the prerequisites, with spaces between them, exactly as given" # $+ means "The names of all the prerequisites, with spaces between them, exactly as given"
# For more magic automatic variables, see # For more magic automatic variables, see
# <http://www.gnu.org/software/make/manual/html_chapter/make_10.html#SEC111> # <http://www.gnu.org/software/make/manual/html_chapter/make_10.html#SEC111>
#
# This makefile uses $(CC) for compilation and linking, which is
# an automatic implicit gcc variable that defaults to "cc"
# <https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html>
############################################################################# #############################################################################
@ -42,10 +46,10 @@ build:
mkdir build mkdir build
build/dns-sd: build dns-sd.c ClientCommon.c build/dns-sd: build dns-sd.c ClientCommon.c
cc $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@ $(CC) $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@
build/dns-sd64: build dns-sd.c ClientCommon.c build/dns-sd64: build dns-sd.c ClientCommon.c
cc $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@ -m64 $(CC) $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@ -m64
# Note, we can make a 'fat' version of dns-sd using 'lipo', as shown below, but we # Note, we can make a 'fat' version of dns-sd using 'lipo', as shown below, but we
# don't, because we don't want or need a 'fat' version of dns-sd, because it will # don't, because we don't want or need a 'fat' version of dns-sd, because it will

View File

@ -1617,7 +1617,6 @@ int main(int argc, char **argv)
err = RegisterService(&client, argv[opi+0], typ, dom, NULL, argv[opi+3], argc-(opi+4), argv+(opi+4), flags); err = RegisterService(&client, argv[opi+0], typ, dom, NULL, argv[opi+3], argc-(opi+4), argv+(opi+4), flags);
break; break;
case 'P': if (argc < opi+6) goto Fail; case 'P': if (argc < opi+6) goto Fail;
err = DNSServiceCreateConnection(&client_pa); err = DNSServiceCreateConnection(&client_pa);
if (err) { fprintf(stderr, "DNSServiceCreateConnection returned %d\n", err); return(err); } if (err) { fprintf(stderr, "DNSServiceCreateConnection returned %d\n", err); return(err); }
@ -1781,7 +1780,12 @@ int main(int argc, char **argv)
default: goto Fail; default: goto Fail;
} }
if (!client || err != kDNSServiceErr_NoError) { fprintf(stderr, "DNSService call failed %ld\n", (long int)err); return (-1); } if (!client || err != kDNSServiceErr_NoError)
{
fprintf(stderr, "DNSService call failed %ld%s\n", (long int)err,
(err == kDNSServiceErr_ServiceNotRunning) ? " (Service Not Running)" : "");
return (-1);
}
printtimestamp(); printtimestamp();
printf("...STARTING...\n"); printf("...STARTING...\n");
HandleEvents(); HandleEvents();

View File

@ -16,7 +16,7 @@
include $(MAKEFILEPATH)/pb_makefiles/platform.make include $(MAKEFILEPATH)/pb_makefiles/platform.make
MVERS = "mDNSResponder-561.1.1" MVERS = "mDNSResponder-567"
DDNSWRITECONFIG = "$(DSTROOT)/Library/Application Support/Bonjour/ddnswriteconfig" DDNSWRITECONFIG = "$(DSTROOT)/Library/Application Support/Bonjour/ddnswriteconfig"
VER = VER =

View File

@ -370,7 +370,7 @@ mDNSexport char *GetRRDisplayString_rdb(const ResourceRecord *const rr, const RD
char *ptr = buffer; char *ptr = buffer;
mDNSu32 length = mDNS_snprintf(buffer, MaxMsg-1, "%4d %##s %s ", rr->rdlength, rr->name->c, DNSTypeName(rr->rrtype)); mDNSu32 length = mDNS_snprintf(buffer, MaxMsg-1, "%4d %##s %s ", rr->rdlength, rr->name->c, DNSTypeName(rr->rrtype));
if (rr->RecordType == kDNSRecordTypePacketNegative) return(buffer); if (rr->RecordType == kDNSRecordTypePacketNegative) return(buffer);
if (!rr->rdlength) { mDNS_snprintf(buffer+length, RemSpc, "<< ZERO RDATA LENGTH >>"); return(buffer); } if (!rr->rdlength && rr->rrtype != kDNSType_OPT) { mDNS_snprintf(buffer+length, RemSpc, "<< ZERO RDATA LENGTH >>"); return(buffer); }
switch (rr->rrtype) switch (rr->rrtype)
{ {
@ -408,6 +408,7 @@ mDNSexport char *GetRRDisplayString_rdb(const ResourceRecord *const rr, const RD
switch(opt->opt) switch(opt->opt)
{ {
case kDNSOpt_LLQ: case kDNSOpt_LLQ:
length += mDNS_snprintf(buffer+length, RemSpc, " LLQ");
length += mDNS_snprintf(buffer+length, RemSpc, " Vers %d", opt->u.llq.vers); length += mDNS_snprintf(buffer+length, RemSpc, " Vers %d", opt->u.llq.vers);
length += mDNS_snprintf(buffer+length, RemSpc, " Op %d", opt->u.llq.llqOp); length += mDNS_snprintf(buffer+length, RemSpc, " Op %d", opt->u.llq.llqOp);
length += mDNS_snprintf(buffer+length, RemSpc, " Err/Port %d", opt->u.llq.err); length += mDNS_snprintf(buffer+length, RemSpc, " Err/Port %d", opt->u.llq.err);
@ -418,6 +419,7 @@ mDNSexport char *GetRRDisplayString_rdb(const ResourceRecord *const rr, const RD
length += mDNS_snprintf(buffer+length, RemSpc, " Lease %d", opt->u.updatelease); length += mDNS_snprintf(buffer+length, RemSpc, " Lease %d", opt->u.updatelease);
break; break;
case kDNSOpt_Owner: case kDNSOpt_Owner:
length += mDNS_snprintf(buffer+length, RemSpc, " Owner");
length += mDNS_snprintf(buffer+length, RemSpc, " Vers %d", opt->u.owner.vers); length += mDNS_snprintf(buffer+length, RemSpc, " Vers %d", opt->u.owner.vers);
length += mDNS_snprintf(buffer+length, RemSpc, " Seq %3d", (mDNSu8)opt->u.owner.seq); // Display as unsigned length += mDNS_snprintf(buffer+length, RemSpc, " Seq %3d", (mDNSu8)opt->u.owner.seq); // Display as unsigned
length += mDNS_snprintf(buffer+length, RemSpc, " MAC %.6a", opt->u.owner.HMAC.b); length += mDNS_snprintf(buffer+length, RemSpc, " MAC %.6a", opt->u.owner.HMAC.b);
@ -429,6 +431,7 @@ mDNSexport char *GetRRDisplayString_rdb(const ResourceRecord *const rr, const RD
} }
break; break;
case kDNSOpt_Trace: case kDNSOpt_Trace:
length += mDNS_snprintf(buffer+length, RemSpc, " Trace");
length += mDNS_snprintf(buffer+length, RemSpc, " Platform %d", opt->u.tracer.platf); length += mDNS_snprintf(buffer+length, RemSpc, " Platform %d", opt->u.tracer.platf);
length += mDNS_snprintf(buffer+length, RemSpc, " mDNSVers %d", opt->u.tracer.mDNSv); length += mDNS_snprintf(buffer+length, RemSpc, " mDNSVers %d", opt->u.tracer.mDNSv);
break; break;
@ -3201,6 +3204,12 @@ mDNSexport mDNSBool SetRData(const DNSMessage *const msg, const mDNSu8 *ptr, con
opt->u.tracer.mDNSv = (mDNSu32) ((mDNSu32)ptr[1] << 24 | (mDNSu32)ptr[2] << 16 | (mDNSu32)ptr[3] << 8 | ptr[4]); opt->u.tracer.mDNSv = (mDNSu32) ((mDNSu32)ptr[1] << 24 | (mDNSu32)ptr[2] << 16 | (mDNSu32)ptr[3] << 8 | ptr[4]);
opt++; opt++;
} }
else
{
opt->u.tracer.platf = 0xFF;
opt->u.tracer.mDNSv = 0xFFFFFFFF;
opt++;
}
break; break;
} }
ptr += currentopt->optlen; ptr += currentopt->optlen;

View File

@ -23,7 +23,7 @@
* routines, or types (which may or may not be present on any given platform). * routines, or types (which may or may not be present on any given platform).
*/ */
#include "DNSCommon.h" // Defines general DNS untility routines #include "DNSCommon.h" // Defines general DNS utility routines
#include "uDNS.h" // Defines entry points into unicast-specific routines #include "uDNS.h" // Defines entry points into unicast-specific routines
#include "nsec.h" #include "nsec.h"
#include "dnssec.h" #include "dnssec.h"
@ -11170,7 +11170,7 @@ mDNSlocal mDNSBool CacheRecordRmvEventsForQuestion(mDNS *const m, DNSQuestion *q
mDNSlocal void SuppressStatusChanged(mDNS *const m, DNSQuestion *q, DNSQuestion **restart) mDNSlocal void SuppressStatusChanged(mDNS *const m, DNSQuestion *q, DNSQuestion **restart)
{ {
// NOTE: CacheRecordRmvEventsForQuestion will not generate RMV events for queries that have non-zero // NOTE: CacheRecordRmvEventsForQuestion will not generate RMV events for queries that have non-zero
// LOddressAnswers. Hence it is important that we call CacheRecordRmvEventsForQuestion before // LOAddressAnswers. Hence it is important that we call CacheRecordRmvEventsForQuestion before
// LocalRecordRmvEventsForQuestion (which decrements LOAddressAnswers) // LocalRecordRmvEventsForQuestion (which decrements LOAddressAnswers)
if (q->SuppressQuery) if (q->SuppressQuery)
{ {

View File

@ -96,6 +96,9 @@ extern "C" {
#ifdef LIMITED_RESOURCES_TARGET #ifdef LIMITED_RESOURCES_TARGET
// Don't support jumbo frames // Don't support jumbo frames
#define AbsoluteMaxDNSMessageData 1500 #define AbsoluteMaxDNSMessageData 1500
// By the time you add IPv6 header (40 bytes) UDP header (8 bytes) and DNS message header (12 bytes)
// this makes 1560 which is 60 bytes over the standard Ethernet MTU. D'oh!
// StandardAuthRDSize is 264 (256+8), which is large enough to hold a maximum-sized SRV record (6 + 256 bytes) // StandardAuthRDSize is 264 (256+8), which is large enough to hold a maximum-sized SRV record (6 + 256 bytes)
#define MaximumRDSize 264 #define MaximumRDSize 264
// Don't cache anything // Don't cache anything

View File

@ -1329,7 +1329,8 @@ mDNSlocal void tcpCallback(TCPSocket *sock, void *context, mDNSBool ConnectionEs
else else
{ {
long n; long n;
if (tcpInfo->nread < 2) // First read the two-byte length preceeding the DNS message const mDNSBool Read_replylen = (tcpInfo->nread < 2); // Do we need to read the replylen field first?
if (Read_replylen) // First read the two-byte length preceeding the DNS message
{ {
mDNSu8 *lenptr = (mDNSu8 *)&tcpInfo->replylen; mDNSu8 *lenptr = (mDNSu8 *)&tcpInfo->replylen;
n = mDNSPlatformReadTCP(sock, lenptr + tcpInfo->nread, 2 - tcpInfo->nread, &closed); n = mDNSPlatformReadTCP(sock, lenptr + tcpInfo->nread, 2 - tcpInfo->nread, &closed);
@ -1377,8 +1378,13 @@ mDNSlocal void tcpCallback(TCPSocket *sock, void *context, mDNSBool ConnectionEs
if (n < 0) if (n < 0)
{ {
LogMsg("ERROR: tcpCallback - read returned %d", n); // If this is our only read for this invokation, and it fails, then that's bad.
err = mStatus_ConnFailed; // But if we did successfully read some or all of the replylen field this time through,
// and this is now our second read from the socket, then it's expected that sometimes
// there may be no more data present, and that's perfectly okay.
// Assuming failure of the second read is a problem is what caused this bug:
// <rdar://problem/15043194> mDNSResponder fails to read DNS over TCP packet correctly
if (!Read_replylen) { LogMsg("ERROR: tcpCallback - read returned %d", n); err = mStatus_ConnFailed; }
goto exit; goto exit;
} }
else if (closed) else if (closed)

View File

@ -1,8 +1,2 @@
#include "<DEVELOPER_DIR>/AppleInternal/XcodeConfig/SimulatorSupport.xcconfig" PUBLIC_HEADERS_FOLDER_PATH = /usr/include
PRIVATE_HEADERS_FOLDER_PATH = /usr/local/include
// Set INSTALL_PATH[sdk=macosx*] when SimulatorSupport.xcconfig is unavailable
INSTALL_PATH[sdk=macosx*] = $(INSTALL_PATH_ACTUAL)
// Use $(INSTALL_PATH_PREFIX) instead of $(SDKROOT) as an unconditional prefix
PUBLIC_HEADERS_FOLDER_PATH = $(INSTALL_PATH_PREFIX)/usr/include
PRIVATE_HEADERS_FOLDER_PATH = $(INSTALL_PATH_PREFIX)/usr/local/include

View File

@ -2593,6 +2593,14 @@ mDNSlocal void KQWokenFlushBytes(int fd, __unused short filter, __unused void *c
while (recv(fd, buffer, sizeof(buffer), MSG_DONTWAIT) > 0) continue; while (recv(fd, buffer, sizeof(buffer), MSG_DONTWAIT) > 0) continue;
} }
mDNSlocal void SetLowWater(const KQSocketSet *const k, const int r)
{
if (setsockopt(k->sktv4, SOL_SOCKET, SO_RCVLOWAT, &r, sizeof(r)) < 0)
LogMsg("SO_RCVLOWAT IPv4 %d error %d errno %d (%s)", k->sktv4, r, errno, strerror(errno));
if (setsockopt(k->sktv6, SOL_SOCKET, SO_RCVLOWAT, &r, sizeof(r)) < 0)
LogMsg("SO_RCVLOWAT IPv6 %d error %d errno %d (%s)", k->sktv6, r, errno, strerror(errno));
}
mDNSlocal void * KQueueLoop(void *m_param) mDNSlocal void * KQueueLoop(void *m_param)
{ {
mDNS *m = m_param; mDNS *m = m_param;
@ -2678,6 +2686,13 @@ mDNSlocal void * KQueueLoop(void *m_param)
// 3. The timeout expires // 3. The timeout expires
pthread_mutex_unlock(&PlatformStorage.BigMutex); pthread_mutex_unlock(&PlatformStorage.BigMutex);
// If we woke up to receive a multicast, set low-water mark to dampen excessive wakeup rate
if (m->p->num_mcasts)
{
SetLowWater(&m->p->permanentsockets, 0x10000);
if (ticks > mDNSPlatformOneSecond / 8) ticks = mDNSPlatformOneSecond / 8;
}
#if USE_SELECT_WITH_KQUEUEFD #if USE_SELECT_WITH_KQUEUEFD
struct timeval timeout; struct timeval timeout;
timeout.tv_sec = ticks / mDNSPlatformOneSecond; timeout.tv_sec = ticks / mDNSPlatformOneSecond;
@ -2705,6 +2720,13 @@ mDNSlocal void * KQueueLoop(void *m_param)
// makes the event no longer valid. Now we have the lock, we call kevent again // makes the event no longer valid. Now we have the lock, we call kevent again
// and this time we can safely process the events it tells us about. // and this time we can safely process the events it tells us about.
// If we changed UDP socket low-water mark, restore it, so we will be told about every packet
if (m->p->num_mcasts)
{
SetLowWater(&m->p->permanentsockets, 1);
m->p->num_mcasts = 0;
}
static const struct timespec zero_timeout = { 0, 0 }; static const struct timespec zero_timeout = { 0, 0 };
int events_found; int events_found;
while ((events_found = kevent(KQueueFD, NULL, 0, new_events, kEventsToReadAtOnce, &zero_timeout)) != 0) while ((events_found = kevent(KQueueFD, NULL, 0, new_events, kEventsToReadAtOnce, &zero_timeout)) != 0)

View File

@ -615,7 +615,7 @@ do_mDNSPreferencesSetName(__unused mach_port_t port, int key, const char* old, c
} }
// If we are not showing the dialogue, we need to remember the first "old" value so that // If we are not showing the dialogue, we need to remember the first "old" value so that
// we maintain the same through the lifetime of the dialogue. Subsequence conflicts don't // we maintain the same through the lifetime of the dialogue. Subsequent conflicts don't
// update the "old" value. // update the "old" value.
if (!user[0]) if (!user[0])
{ {

View File

@ -2064,6 +2064,9 @@ mDNSexport void myKQSocketCallBack(int s1, short filter, void *context)
err = myrecvfrom(s1, &m->imsg, sizeof(m->imsg), (struct sockaddr *)&from, &fromlen, &destAddr, packetifname, &ttl); err = myrecvfrom(s1, &m->imsg, sizeof(m->imsg), (struct sockaddr *)&from, &fromlen, &destAddr, packetifname, &ttl);
if (err < 0) break; if (err < 0) break;
if ((destAddr.type == mDNSAddrType_IPv4 && (destAddr.ip.v4.b[0] & 0xF0) == 0xE0) ||
(destAddr.type == mDNSAddrType_IPv6 && (destAddr.ip.v6.b[0] == 0xFF))) m->p->num_mcasts++;
count++; count++;
if (from.ss_family == AF_INET) if (from.ss_family == AF_INET)
{ {
@ -3010,8 +3013,11 @@ mDNSlocal mStatus SetupSocket(KQSocketSet *cp, const mDNSIPPort port, u_short sa
#endif // SO_RECV_ANYIF #endif // SO_RECV_ANYIF
// ... with a shared UDP port, if it's for multicast receiving // ... with a shared UDP port, if it's for multicast receiving
if (mDNSSameIPPort(port, MulticastDNSPort) || mDNSSameIPPort(port, NATPMPAnnouncementPort)) err = setsockopt(skt, SOL_SOCKET, SO_REUSEPORT, &on, sizeof(on)); if (mDNSSameIPPort(port, MulticastDNSPort) || mDNSSameIPPort(port, NATPMPAnnouncementPort))
{
err = setsockopt(skt, SOL_SOCKET, SO_REUSEPORT, &on, sizeof(on));
if (err < 0) { errstr = "setsockopt - SO_REUSEPORT"; goto fail; } if (err < 0) { errstr = "setsockopt - SO_REUSEPORT"; goto fail; }
}
if (sa_family == AF_INET) if (sa_family == AF_INET)
{ {
@ -6074,7 +6080,7 @@ mDNSlocal void SetupDDNSDomains(domainname *const fqdn, DNameListElem **RegDomai
char buf[MAX_ESCAPED_DOMAIN_NAME]; // Max legal C-string name, including terminating NUL char buf[MAX_ESCAPED_DOMAIN_NAME]; // Max legal C-string name, including terminating NUL
domainname d; domainname d;
SCDynamicStoreRef store = SCDynamicStoreCreate(NULL, CFSTR("mDNSResponder:mDNSPlatformSetDNSConfig"), NULL, NULL); SCDynamicStoreRef store = SCDynamicStoreCreate(NULL, CFSTR("mDNSResponder:SetupDDNSDomains"), NULL, NULL);
if (!store) if (!store)
{ {
LogMsg("SetupDDNSDomains: SCDynamicStoreCreate failed: %s", SCErrorString(SCError())); LogMsg("SetupDDNSDomains: SCDynamicStoreCreate failed: %s", SCErrorString(SCError()));
@ -6271,7 +6277,8 @@ mDNSexport mDNSBool mDNSPlatformSetDNSConfig(mDNS *const m, mDNSBool setservers,
else else
{ {
LogInfo("mDNSPlatformSetDNSConfig: config->n_resolver = %d, generation %llu", config->n_resolver, config->generation); LogInfo("mDNSPlatformSetDNSConfig: config->n_resolver = %d, generation %llu", config->n_resolver, config->generation);
if (m->p->LastConfigGeneration == config->generation) // SameDomainName check below is to fix <rdar://problem/18059009> Dynamic DNS hostname changes not noticed
if (m->p->LastConfigGeneration == config->generation && (!fqdn || (SameDomainName(fqdn, &m->FQDN))))
{ {
LogInfo("mDNSPlatformSetDNSConfig: generation number %llu same, not processing", config->generation); LogInfo("mDNSPlatformSetDNSConfig: generation number %llu same, not processing", config->generation);
dns_configuration_free(config); dns_configuration_free(config);

View File

@ -169,6 +169,7 @@ struct mDNS_PlatformSupport_struct
{ {
NetworkInterfaceInfoOSX *InterfaceList; NetworkInterfaceInfoOSX *InterfaceList;
KQSocketSet permanentsockets; KQSocketSet permanentsockets;
int num_mcasts; // Number of multicasts received during this CPU scheduling period (used for CPU limiting)
domainlabel userhostlabel; // The hostlabel as it was set in System Preferences the last time we looked domainlabel userhostlabel; // The hostlabel as it was set in System Preferences the last time we looked
domainlabel usernicelabel; // The nicelabel as it was set in System Preferences the last time we looked domainlabel usernicelabel; // The nicelabel as it was set in System Preferences the last time we looked
// Following four variables are used for optimization where the helper is not // Following four variables are used for optimization where the helper is not

View File

@ -25,14 +25,10 @@
isa = PBXAggregateTarget; isa = PBXAggregateTarget;
buildConfigurationList = 03067D730C83A3CB0022BE1F /* Build configuration list for PBXAggregateTarget "Build Some" */; buildConfigurationList = 03067D730C83A3CB0022BE1F /* Build configuration list for PBXAggregateTarget "Build Some" */;
buildPhases = ( buildPhases = (
FF045B6A0C7E4AA600448140 /* ShellScript */,
); );
dependencies = ( dependencies = (
217A4C49138EE14C000A5BA8 /* PBXTargetDependency */, 217A4C49138EE14C000A5BA8 /* PBXTargetDependency */,
03067D680C83A3830022BE1F /* PBXTargetDependency */,
03067D6A0C83A3890022BE1F /* PBXTargetDependency */,
03067D6C0C83A3920022BE1F /* PBXTargetDependency */, 03067D6C0C83A3920022BE1F /* PBXTargetDependency */,
03067D6E0C83A39C0022BE1F /* PBXTargetDependency */,
84C5B3411665544B00C324A8 /* PBXTargetDependency */, 84C5B3411665544B00C324A8 /* PBXTargetDependency */,
); );
name = "Build Some"; name = "Build Some";
@ -63,6 +59,19 @@
name = SystemLibrariesStatic; name = SystemLibrariesStatic;
productName = SystemLibrariesStatic; productName = SystemLibrariesStatic;
}; };
3F2EAA9F1A5B85FF007F5A52 /* Build Deprecated */ = {
isa = PBXAggregateTarget;
buildConfigurationList = 3F2EAAA11A5B85FF007F5A52 /* Build configuration list for PBXAggregateTarget "Build Deprecated" */;
buildPhases = (
);
dependencies = (
3F2EAAA71A5B861D007F5A52 /* PBXTargetDependency */,
3F2EAAA51A5B861C007F5A52 /* PBXTargetDependency */,
3F2EAAA91A5B861E007F5A52 /* PBXTargetDependency */,
);
name = "Build Deprecated";
productName = "Build Deprecated";
};
FFA572650AF190F10055A0F1 /* SystemLibrariesDynamic */ = { FFA572650AF190F10055A0F1 /* SystemLibrariesDynamic */ = {
isa = PBXAggregateTarget; isa = PBXAggregateTarget;
buildConfigurationList = FFA5726E0AF191200055A0F1 /* Build configuration list for PBXAggregateTarget "SystemLibrariesDynamic" */; buildConfigurationList = FFA5726E0AF191200055A0F1 /* Build configuration list for PBXAggregateTarget "SystemLibrariesDynamic" */;
@ -83,6 +92,7 @@
); );
dependencies = ( dependencies = (
FFB7657D0AEED97F00583A2C /* PBXTargetDependency */, FFB7657D0AEED97F00583A2C /* PBXTargetDependency */,
3F2EAAA31A5B8608007F5A52 /* PBXTargetDependency */,
2141DCFD123FFB7D0086D23E /* PBXTargetDependency */, 2141DCFD123FFB7D0086D23E /* PBXTargetDependency */,
); );
name = "Build All"; name = "Build All";
@ -337,20 +347,6 @@
/* End PBXBuildRule section */ /* End PBXBuildRule section */
/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
03067D670C83A3830022BE1F /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
proxyType = 1;
remoteGlobalIDString = D284BE500ADD80740027CCDF;
remoteInfo = mDNSResponder;
};
03067D690C83A3890022BE1F /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
proxyType = 1;
remoteGlobalIDString = D284BE750ADD80800027CCDF;
remoteInfo = "mDNSResponder debug";
};
03067D6B0C83A3920022BE1F /* PBXContainerItemProxy */ = { 03067D6B0C83A3920022BE1F /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy; isa = PBXContainerItemProxy;
containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
@ -358,13 +354,6 @@
remoteGlobalIDString = D284BEA50ADD80920027CCDF; remoteGlobalIDString = D284BEA50ADD80920027CCDF;
remoteInfo = "dns-sd tool"; remoteInfo = "dns-sd tool";
}; };
03067D6D0C83A39C0022BE1F /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 2E0405EF0C31955500F13B59;
remoteInfo = mDNSResponderHelper;
};
03067D850C849CC30022BE1F /* PBXContainerItemProxy */ = { 03067D850C849CC30022BE1F /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy; isa = PBXContainerItemProxy;
containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
@ -421,6 +410,34 @@
remoteGlobalIDString = 213FB21712028A7A002B3A08; remoteGlobalIDString = 213FB21712028A7A002B3A08;
remoteInfo = BonjourEvents; remoteInfo = BonjourEvents;
}; };
3F2EAAA21A5B8608007F5A52 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 3F2EAA9F1A5B85FF007F5A52;
remoteInfo = "Build Deprecated";
};
3F2EAAA41A5B861C007F5A52 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
proxyType = 1;
remoteGlobalIDString = D284BE750ADD80800027CCDF;
remoteInfo = "mDNSResponder debug";
};
3F2EAAA61A5B861D007F5A52 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
proxyType = 1;
remoteGlobalIDString = D284BE500ADD80740027CCDF;
remoteInfo = mDNSResponder;
};
3F2EAAA81A5B861E007F5A52 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 2E0405EF0C31955500F13B59;
remoteInfo = mDNSResponderHelper;
};
4AE471690EAFF83800A6C5AD /* PBXContainerItemProxy */ = { 4AE471690EAFF83800A6C5AD /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy; isa = PBXContainerItemProxy;
containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
@ -1625,6 +1642,11 @@
08FB7793FE84155DC02AAC07 /* Project object */ = { 08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
TargetAttributes = {
3F2EAA9F1A5B85FF007F5A52 = {
CreatedOnToolsVersion = 6.3;
};
};
}; };
buildConfigurationList = D284BE2B0ADD78180027CCDF /* Build configuration list for PBXProject "mDNSResponder" */; buildConfigurationList = D284BE2B0ADD78180027CCDF /* Build configuration list for PBXProject "mDNSResponder" */;
compatibilityVersion = "Xcode 3.1"; compatibilityVersion = "Xcode 3.1";
@ -1642,6 +1664,7 @@
targets = ( targets = (
00AD62BB032D7A0C0CCA2C71 /* Build More */, 00AD62BB032D7A0C0CCA2C71 /* Build More */,
03067D640C83A3700022BE1F /* Build Some */, 03067D640C83A3700022BE1F /* Build Some */,
3F2EAA9F1A5B85FF007F5A52 /* Build Deprecated */,
FFB7657B0AEED96B00583A2C /* Build All */, FFB7657B0AEED96B00583A2C /* Build All */,
D284BE500ADD80740027CCDF /* mDNSResponder */, D284BE500ADD80740027CCDF /* mDNSResponder */,
D284BE750ADD80800027CCDF /* mDNSResponder debug */, D284BE750ADD80800027CCDF /* mDNSResponder debug */,
@ -1770,7 +1793,7 @@
); );
runOnlyForDeploymentPostprocessing = 1; runOnlyForDeploymentPostprocessing = 1;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "DSTROOT=${DSTROOT}${INSTALL_PATH_PREFIX}\n\nmkdir -p \"$DSTROOT/usr/include\"\nsed 's/\\(^#define _DNS_SD_LIBDISPATCH \\)0$/\\1 1/' \"$SRCROOT/../mDNSShared/dns_sd.h\" > \"$DSTROOT/usr/include/dns_sd.h\""; shellScript = "DSTROOT=${DSTROOT}\n\nmkdir -p \"$DSTROOT/usr/include\"\nsed 's/\\(^#define _DNS_SD_LIBDISPATCH \\)0$/\\1 1/' \"$SRCROOT/../mDNSShared/dns_sd.h\" > \"$DSTROOT/usr/include/dns_sd.h\"";
}; };
21DE714D115831CB00DD4BD1 /* ShellScript */ = { 21DE714D115831CB00DD4BD1 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
@ -1782,8 +1805,8 @@
outputPaths = ( outputPaths = (
); );
runOnlyForDeploymentPostprocessing = 1; runOnlyForDeploymentPostprocessing = 1;
shellPath = /bin/sh; shellPath = "/bin/bash -e -x";
shellScript = "DSTROOT=${DSTROOT}${INSTALL_PATH_PREFIX}\nmkdir -p \"$DSTROOT/usr/include\"\nsed 's/\\(^#define _DNS_SD_LIBDISPATCH \\)0$/\\1 1/' \"$SRCROOT/../mDNSShared/dns_sd.h\" > \"$DSTROOT/usr/include/dns_sd.h\""; shellScript = "DSTROOT=${DSTROOT}\nmkdir -p \"$DSTROOT/usr/include\"\nsed 's/\\(^#define _DNS_SD_LIBDISPATCH \\)0$/\\1 1/' \"$SRCROOT/../mDNSShared/dns_sd.h\" > \"$DSTROOT/usr/include/dns_sd.h\"\n\nif [[ \"${ACTION}\" == \"installhdrs\" ]]; then\n exit 0\nfi\n\nif [[ \"${PLATFORM_NAME}\" =~ \"simulator\" ]]; then\n ln -s libsystem_dnssd.dylib ${DSTROOT}${INSTALL_PATH}/libsystem_sim_dnssd.dylib\nfi\n";
}; };
4A4EE3A413CB8E82005C624B /* Build yacc file into derived source files */ = { 4A4EE3A413CB8E82005C624B /* Build yacc file into derived source files */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
@ -1829,19 +1852,6 @@
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "if [ -e \"${SDKROOT}/usr/local/include/dnsinfo.h\" ]\nthen\nrm -f \"${CONFIGURATION_TEMP_DIR}/dnsinfo.h\"\nrm -f \"${CONFIGURATION_TEMP_DIR}/libdnsinfo.a\"\nelse\necho \"#define MDNS_NO_DNSINFO 1\" > ${CONFIGURATION_TEMP_DIR}/dnsinfo.h\ntouch \"${CONFIGURATION_TEMP_DIR}/empty.c\"\nfor i in ${ARCHS}\ndo\nccflags=\"-arch $i $ccflags\"\ndone\ncc ${ccflags} \"${CONFIGURATION_TEMP_DIR}/empty.c\" -c -o \"${CONFIGURATION_TEMP_DIR}/libdnsinfo.a\"\nrm -f \"${CONFIGURATION_TEMP_DIR}/empty.c\"\nfi\n\nif [ -e \"${SDKROOT}/usr/include/sandbox.h\" ]\nthen\nrm -f \"${CONFIGURATION_TEMP_DIR}/sandbox.h\"\nelse\necho \"#define MDNS_NO_SANDBOX 1\" > \"${CONFIGURATION_TEMP_DIR}/sandbox.h\"\nfi\n\nif [ -e \"${SDKROOT}/usr/local/include/vproc.h\" -o -e \"${SDKROOT}/usr/include/vproc.h\" ]\nthen\nrm -f \"${CONFIGURATION_TEMP_DIR}/vproc.h\"\nelse\ntouch \"${CONFIGURATION_TEMP_DIR}/vproc.h\"\nfi\n\nif [ -e \"${SDKROOT}/System/Library/Frameworks/IOKit.framework/PrivateHeaders/pwr_mgt/IOPMLibPrivate.h\" ]\nthen\nrm -rf \"${CONFIGURATION_TEMP_DIR}/IOKit\"\nelse\nmkdir -p \"${CONFIGURATION_TEMP_DIR}/IOKit/pwr_mgt\"\ntouch \"${CONFIGURATION_TEMP_DIR}/IOKit/pwr_mgt/IOPMLibPrivate.h\"\nfi\n\nif [ -e \"${SDKROOT}/System/Library/PrivateFrameworks/DeviceToDeviceManager.framework/Headers/DeviceToDeviceManager.h\" ]\nthen\nrm -rf \"${CONFIGURATION_TEMP_DIR}/DeviceToDeviceManager\"\nelse\nmkdir -p \"${CONFIGURATION_TEMP_DIR}/DeviceToDeviceManager\"\necho \"#define NO_D2D 1\" > \"${CONFIGURATION_TEMP_DIR}/DeviceToDeviceManager/DeviceToDeviceManager.h\"\nfi\n\nif [ -e \"${SDKROOT}/System/Library/PrivateFrameworks/WebFilterDNS.framework/Headers/WebFilterDNS.h\" ]\nthen\nrm -rf \"${CONFIGURATION_TEMP_DIR}/WebFilterDNS\"\nelse\nmkdir -p \"${CONFIGURATION_TEMP_DIR}/WebFilterDNS\"\necho \"#define NO_WCF 1\" > \"${CONFIGURATION_TEMP_DIR}/WebFilterDNS/WebFilterDNS.h\"\nfi\n\nif [ -e \"${SDKROOT}/usr/local/include/AWACS.h\" ]\nthen\nrm -f \"${CONFIGURATION_TEMP_DIR}/AWACS.h\"\nrm -f \"${CONFIGURATION_TEMP_DIR}/libAWACS.a\"\nelse\necho \"#define NO_AWACS 1\" > \"${CONFIGURATION_TEMP_DIR}/AWACS.h\"\ntouch \"${CONFIGURATION_TEMP_DIR}/AWACSempty.c\"\nfor i in ${ARCHS}\ndo\nccflags=\"-arch $i $ccflags\"\ndone\ncc ${ccflags} \"${CONFIGURATION_TEMP_DIR}/AWACSempty.c\" -c -o \"${CONFIGURATION_TEMP_DIR}/libAWACS.a\"\nrm -f \"${CONFIGURATION_TEMP_DIR}/AWACSempty.c\"\nfi"; shellScript = "if [ -e \"${SDKROOT}/usr/local/include/dnsinfo.h\" ]\nthen\nrm -f \"${CONFIGURATION_TEMP_DIR}/dnsinfo.h\"\nrm -f \"${CONFIGURATION_TEMP_DIR}/libdnsinfo.a\"\nelse\necho \"#define MDNS_NO_DNSINFO 1\" > ${CONFIGURATION_TEMP_DIR}/dnsinfo.h\ntouch \"${CONFIGURATION_TEMP_DIR}/empty.c\"\nfor i in ${ARCHS}\ndo\nccflags=\"-arch $i $ccflags\"\ndone\ncc ${ccflags} \"${CONFIGURATION_TEMP_DIR}/empty.c\" -c -o \"${CONFIGURATION_TEMP_DIR}/libdnsinfo.a\"\nrm -f \"${CONFIGURATION_TEMP_DIR}/empty.c\"\nfi\n\nif [ -e \"${SDKROOT}/usr/include/sandbox.h\" ]\nthen\nrm -f \"${CONFIGURATION_TEMP_DIR}/sandbox.h\"\nelse\necho \"#define MDNS_NO_SANDBOX 1\" > \"${CONFIGURATION_TEMP_DIR}/sandbox.h\"\nfi\n\nif [ -e \"${SDKROOT}/usr/local/include/vproc.h\" -o -e \"${SDKROOT}/usr/include/vproc.h\" ]\nthen\nrm -f \"${CONFIGURATION_TEMP_DIR}/vproc.h\"\nelse\ntouch \"${CONFIGURATION_TEMP_DIR}/vproc.h\"\nfi\n\nif [ -e \"${SDKROOT}/System/Library/Frameworks/IOKit.framework/PrivateHeaders/pwr_mgt/IOPMLibPrivate.h\" ]\nthen\nrm -rf \"${CONFIGURATION_TEMP_DIR}/IOKit\"\nelse\nmkdir -p \"${CONFIGURATION_TEMP_DIR}/IOKit/pwr_mgt\"\ntouch \"${CONFIGURATION_TEMP_DIR}/IOKit/pwr_mgt/IOPMLibPrivate.h\"\nfi\n\nif [ -e \"${SDKROOT}/System/Library/PrivateFrameworks/DeviceToDeviceManager.framework/Headers/DeviceToDeviceManager.h\" ]\nthen\nrm -rf \"${CONFIGURATION_TEMP_DIR}/DeviceToDeviceManager\"\nelse\nmkdir -p \"${CONFIGURATION_TEMP_DIR}/DeviceToDeviceManager\"\necho \"#define NO_D2D 1\" > \"${CONFIGURATION_TEMP_DIR}/DeviceToDeviceManager/DeviceToDeviceManager.h\"\nfi\n\nif [ -e \"${SDKROOT}/System/Library/PrivateFrameworks/WebFilterDNS.framework/Headers/WebFilterDNS.h\" ]\nthen\nrm -rf \"${CONFIGURATION_TEMP_DIR}/WebFilterDNS\"\nelse\nmkdir -p \"${CONFIGURATION_TEMP_DIR}/WebFilterDNS\"\necho \"#define NO_WCF 1\" > \"${CONFIGURATION_TEMP_DIR}/WebFilterDNS/WebFilterDNS.h\"\nfi\n\nif [ -e \"${SDKROOT}/usr/local/include/AWACS.h\" ]\nthen\nrm -f \"${CONFIGURATION_TEMP_DIR}/AWACS.h\"\nrm -f \"${CONFIGURATION_TEMP_DIR}/libAWACS.a\"\nelse\necho \"#define NO_AWACS 1\" > \"${CONFIGURATION_TEMP_DIR}/AWACS.h\"\ntouch \"${CONFIGURATION_TEMP_DIR}/AWACSempty.c\"\nfor i in ${ARCHS}\ndo\nccflags=\"-arch $i $ccflags\"\ndone\ncc ${ccflags} \"${CONFIGURATION_TEMP_DIR}/AWACSempty.c\" -c -o \"${CONFIGURATION_TEMP_DIR}/libAWACS.a\"\nrm -f \"${CONFIGURATION_TEMP_DIR}/AWACSempty.c\"\nfi";
}; };
FF045B6A0C7E4AA600448140 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 8;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 1;
shellPath = /bin/sh;
shellScript = "# Install plists to tell launchd how to start mDNSResponder and mDNSResponderHelper\nmkdir -p ${DSTROOT}${SYSTEM_LIBRARY_DIR}/LaunchDaemons\n\nif [ ! -z \"${IPHONEOS_DEPLOYMENT_TARGET}\" ] ; then\nplutil -convert binary1 ${DSTROOT}${SYSTEM_LIBRARY_DIR}/LaunchDaemons/com.apple.mDNSResponder.plist\nplutil -convert binary1 ${DSTROOT}${SYSTEM_LIBRARY_DIR}/LaunchDaemons/com.apple.mDNSResponderHelper.plist\nfi\n";
};
FF37FAAD0BC581780044A5CF /* ShellScript */ = { FF37FAAD0BC581780044A5CF /* ShellScript */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 8; buildActionMask = 8;
@ -2095,26 +2105,11 @@
/* End PBXSourcesBuildPhase section */ /* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */ /* Begin PBXTargetDependency section */
03067D680C83A3830022BE1F /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = D284BE500ADD80740027CCDF /* mDNSResponder */;
targetProxy = 03067D670C83A3830022BE1F /* PBXContainerItemProxy */;
};
03067D6A0C83A3890022BE1F /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = D284BE750ADD80800027CCDF /* mDNSResponder debug */;
targetProxy = 03067D690C83A3890022BE1F /* PBXContainerItemProxy */;
};
03067D6C0C83A3920022BE1F /* PBXTargetDependency */ = { 03067D6C0C83A3920022BE1F /* PBXTargetDependency */ = {
isa = PBXTargetDependency; isa = PBXTargetDependency;
target = D284BEA50ADD80920027CCDF /* dns-sd tool */; target = D284BEA50ADD80920027CCDF /* dns-sd tool */;
targetProxy = 03067D6B0C83A3920022BE1F /* PBXContainerItemProxy */; targetProxy = 03067D6B0C83A3920022BE1F /* PBXContainerItemProxy */;
}; };
03067D6E0C83A39C0022BE1F /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 2E0405EF0C31955500F13B59 /* mDNSResponderHelper */;
targetProxy = 03067D6D0C83A39C0022BE1F /* PBXContainerItemProxy */;
};
03067D860C849CC30022BE1F /* PBXTargetDependency */ = { 03067D860C849CC30022BE1F /* PBXTargetDependency */ = {
isa = PBXTargetDependency; isa = PBXTargetDependency;
target = 03067D640C83A3700022BE1F /* Build Some */; target = 03067D640C83A3700022BE1F /* Build Some */;
@ -2155,6 +2150,26 @@
target = 213FB21712028A7A002B3A08 /* BonjourEvents */; target = 213FB21712028A7A002B3A08 /* BonjourEvents */;
targetProxy = 217A4C48138EE14C000A5BA8 /* PBXContainerItemProxy */; targetProxy = 217A4C48138EE14C000A5BA8 /* PBXContainerItemProxy */;
}; };
3F2EAAA31A5B8608007F5A52 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 3F2EAA9F1A5B85FF007F5A52 /* Build Deprecated */;
targetProxy = 3F2EAAA21A5B8608007F5A52 /* PBXContainerItemProxy */;
};
3F2EAAA51A5B861C007F5A52 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = D284BE750ADD80800027CCDF /* mDNSResponder debug */;
targetProxy = 3F2EAAA41A5B861C007F5A52 /* PBXContainerItemProxy */;
};
3F2EAAA71A5B861D007F5A52 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = D284BE500ADD80740027CCDF /* mDNSResponder */;
targetProxy = 3F2EAAA61A5B861D007F5A52 /* PBXContainerItemProxy */;
};
3F2EAAA91A5B861E007F5A52 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 2E0405EF0C31955500F13B59 /* mDNSResponderHelper */;
targetProxy = 3F2EAAA81A5B861E007F5A52 /* PBXContainerItemProxy */;
};
4AE4716A0EAFF83800A6C5AD /* PBXTargetDependency */ = { 4AE4716A0EAFF83800A6C5AD /* PBXTargetDependency */ = {
isa = PBXTargetDependency; isa = PBXTargetDependency;
target = 4AE471670EAFF81900A6C5AD /* dns_sd.jar */; target = 4AE471670EAFF81900A6C5AD /* dns_sd.jar */;
@ -2250,7 +2265,7 @@
GCC_DYNAMIC_NO_PIC = NO; GCC_DYNAMIC_NO_PIC = NO;
GCC_MODEL_TUNING = G5; GCC_MODEL_TUNING = G5;
INFOPLIST_FILE = "BonjourEvents-Info.plist"; INFOPLIST_FILE = "BonjourEvents-Info.plist";
INSTALL_PATH_ACTUAL = /System/Library/UserEventPlugins/; INSTALL_PATH = /System/Library/UserEventPlugins/;
PREBINDING = NO; PREBINDING = NO;
PRODUCT_NAME = BonjourEvents; PRODUCT_NAME = BonjourEvents;
PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE = "";
@ -2293,7 +2308,7 @@
HEADER_SEARCH_PATHS = "$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders/"; HEADER_SEARCH_PATHS = "$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders/";
INSTALLHDRS_COPY_PHASE = YES; INSTALLHDRS_COPY_PHASE = YES;
INSTALLHDRS_SCRIPT_PHASE = YES; INSTALLHDRS_SCRIPT_PHASE = YES;
INSTALL_PATH_ACTUAL = /usr/local/lib/system; INSTALL_PATH = /usr/local/lib/system;
PREBINDING = NO; PREBINDING = NO;
PRODUCT_NAME = dns_sd; PRODUCT_NAME = dns_sd;
"SKIP_INSTALL[sdk=iphonesimulator*]" = YES; "SKIP_INSTALL[sdk=iphonesimulator*]" = YES;
@ -2313,7 +2328,7 @@
"__DARWIN_NON_CANCELABLE=1", "__DARWIN_NON_CANCELABLE=1",
); );
HEADER_SEARCH_PATHS = "$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders/"; HEADER_SEARCH_PATHS = "$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders/";
INSTALL_PATH_ACTUAL = /usr/local/lib/system; INSTALL_PATH = /usr/local/lib/system;
PREBINDING = NO; PREBINDING = NO;
PRODUCT_NAME = dns_sd_debug; PRODUCT_NAME = dns_sd_debug;
"SKIP_INSTALL[sdk=iphonesimulator*]" = YES; "SKIP_INSTALL[sdk=iphonesimulator*]" = YES;
@ -2333,7 +2348,7 @@
"__DARWIN_NON_CANCELABLE=1", "__DARWIN_NON_CANCELABLE=1",
); );
HEADER_SEARCH_PATHS = "$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders/"; HEADER_SEARCH_PATHS = "$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders/";
INSTALL_PATH_ACTUAL = /usr/local/lib/system; INSTALL_PATH = /usr/local/lib/system;
PREBINDING = NO; PREBINDING = NO;
PRODUCT_NAME = dns_sd_profile; PRODUCT_NAME = dns_sd_profile;
"SKIP_INSTALL[sdk=iphonesimulator*]" = YES; "SKIP_INSTALL[sdk=iphonesimulator*]" = YES;
@ -2356,9 +2371,7 @@
"$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders", "$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders",
"$(SDKROOT)/usr/local/include", "$(SDKROOT)/usr/local/include",
); );
INSTALL_PATH = ""; INSTALL_PATH = /usr/sbin;
"INSTALL_PATH[sdk=macosx*]" = "";
INSTALL_PATH_ACTUAL = /usr/sbin;
LD_MAP_FILE_PATH = "$(TARGET_TEMP_DIR)/$(PRODUCT_NAME)-LinkMap-$(CURRENT_VARIANT)-$(CURRENT_ARCH).txt"; LD_MAP_FILE_PATH = "$(TARGET_TEMP_DIR)/$(PRODUCT_NAME)-LinkMap-$(CURRENT_VARIANT)-$(CURRENT_ARCH).txt";
LIBRARY_SEARCH_PATHS = "\"${CONFIGURATION_TEMP_DIR}\""; LIBRARY_SEARCH_PATHS = "\"${CONFIGURATION_TEMP_DIR}\"";
MACOSX_DEPLOYMENT_TARGET = 10.5; MACOSX_DEPLOYMENT_TARGET = 10.5;
@ -2377,6 +2390,13 @@
}; };
name = Development; name = Development;
}; };
3F2EAAA01A5B85FF007F5A52 /* Development */ = {
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Development;
};
4AE471680EAFF81900A6C5AD /* Development */ = { 4AE471680EAFF81900A6C5AD /* Development */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
@ -2418,7 +2438,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
INSTALL_PATH_ACTUAL = /usr/bin; INSTALL_PATH = /usr/bin;
MACOSX_DEPLOYMENT_TARGET = 10.9; MACOSX_DEPLOYMENT_TARGET = 10.9;
ONLY_ACTIVE_ARCH = NO; ONLY_ACTIVE_ARCH = NO;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
@ -2452,7 +2472,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
INSTALL_PATH_ACTUAL = /usr/lib; INSTALL_PATH = /usr/lib;
MACOSX_DEPLOYMENT_TARGET = 10.8; MACOSX_DEPLOYMENT_TARGET = 10.8;
ONLY_ACTIVE_ARCH = NO; ONLY_ACTIVE_ARCH = NO;
PRODUCT_NAME = "$(TARGET_NAME)_mdns"; PRODUCT_NAME = "$(TARGET_NAME)_mdns";
@ -2497,7 +2517,6 @@
"-DUSE_SYSTEMCONFIGURATION_PRIVATE_HEADERS", "-DUSE_SYSTEMCONFIGURATION_PRIVATE_HEADERS",
"-fwrapv", "-fwrapv",
); );
"OTHER_LDFLAGS[sdk=macosx*]" = "";
PREBINDING = NO; PREBINDING = NO;
STRIP_STYLE = debugging; STRIP_STYLE = debugging;
WARNING_CFLAGS = ( WARNING_CFLAGS = (
@ -2535,9 +2554,7 @@
"$(SDKROOT)/usr/include/libxml2", "$(SDKROOT)/usr/include/libxml2",
"$(SDKROOT)/usr/local/include/", "$(SDKROOT)/usr/local/include/",
); );
INSTALL_PATH = ""; INSTALL_PATH = /usr/sbin;
"INSTALL_PATH[sdk=macosx*]" = "";
INSTALL_PATH_ACTUAL = /usr/sbin;
LIBRARY_SEARCH_PATHS = "\"${CONFIGURATION_TEMP_DIR}\""; LIBRARY_SEARCH_PATHS = "\"${CONFIGURATION_TEMP_DIR}\"";
MACOSX_DEPLOYMENT_TARGET = 10.5; MACOSX_DEPLOYMENT_TARGET = 10.5;
ORDER_FILE = "${SRCROOT}/mDNSResponder.order"; ORDER_FILE = "${SRCROOT}/mDNSResponder.order";
@ -2642,7 +2659,7 @@
../mDNSShared, ../mDNSShared,
"${SYSTEM_LIBRARY_DIR}/Frameworks/System.framework/PrivateHeaders", "${SYSTEM_LIBRARY_DIR}/Frameworks/System.framework/PrivateHeaders",
); );
INSTALL_PATH_ACTUAL = /usr/bin; INSTALL_PATH = /usr/bin;
OTHER_CFLAGS = "-no-cpp-precomp"; OTHER_CFLAGS = "-no-cpp-precomp";
OTHER_LDFLAGS = ""; OTHER_LDFLAGS = "";
OTHER_REZFLAGS = ""; OTHER_REZFLAGS = "";
@ -2669,7 +2686,7 @@
"${SYSTEM_LIBRARY_DIR}/Frameworks/JavaVM.framework/Versions/1.3.1/Headers", "${SYSTEM_LIBRARY_DIR}/Frameworks/JavaVM.framework/Versions/1.3.1/Headers",
"${PROJECT_DERIVED_FILE_DIR}", "${PROJECT_DERIVED_FILE_DIR}",
); );
INSTALL_PATH_ACTUAL = /usr/lib/java; INSTALL_PATH = /usr/lib/java;
LIBRARY_STYLE = DYNAMIC; LIBRARY_STYLE = DYNAMIC;
MACH_O_TYPE = mh_dylib; MACH_O_TYPE = mh_dylib;
OTHER_CFLAGS = ""; OTHER_CFLAGS = "";
@ -2695,7 +2712,7 @@
"${CONFIGURATION_TEMP_DIR}", "${CONFIGURATION_TEMP_DIR}",
/System/Library/Frameworks/System.Framework/PrivateHeaders, /System/Library/Frameworks/System.Framework/PrivateHeaders,
); );
INSTALL_PATH_ACTUAL = /usr/sbin; INSTALL_PATH = /usr/sbin;
LIBRARY_SEARCH_PATHS = "\"${CONFIGURATION_TEMP_DIR}\""; LIBRARY_SEARCH_PATHS = "\"${CONFIGURATION_TEMP_DIR}\"";
MACOSX_DEPLOYMENT_TARGET = 10.5; MACOSX_DEPLOYMENT_TARGET = 10.5;
OTHER_CFLAGS = ( OTHER_CFLAGS = (
@ -2717,7 +2734,7 @@
CONFIGURATION_TEMP_DIR = "${BUILD_DIR}/mDNSResponder.build"; CONFIGURATION_TEMP_DIR = "${BUILD_DIR}/mDNSResponder.build";
GCC_DYNAMIC_NO_PIC = NO; GCC_DYNAMIC_NO_PIC = NO;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
INSTALL_PATH_ACTUAL = "/Library/Application Support/Bonjour"; INSTALL_PATH = "/Library/Application Support/Bonjour";
MACOSX_DEPLOYMENT_TARGET = 10.5; MACOSX_DEPLOYMENT_TARGET = 10.5;
OTHER_CFLAGS = ""; OTHER_CFLAGS = "";
OTHER_LDFLAGS = ""; OTHER_LDFLAGS = "";
@ -2741,7 +2758,7 @@
GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_SYMBOLS_PRIVATE_EXTERN = NO;
INFOPLIST_FILE = "PreferencePane/Info-PreferencePane.plist"; INFOPLIST_FILE = "PreferencePane/Info-PreferencePane.plist";
INSTALL_PATH_ACTUAL = /AppleInternal/Library/PreferencePanes; INSTALL_PATH = /AppleInternal/Library/PreferencePanes;
MACOSX_DEPLOYMENT_TARGET = 10.5; MACOSX_DEPLOYMENT_TARGET = 10.5;
OTHER_CFLAGS = ""; OTHER_CFLAGS = "";
OTHER_LDFLAGS = "-twolevel_namespace"; OTHER_LDFLAGS = "-twolevel_namespace";
@ -2767,16 +2784,18 @@
"__DARWIN_NON_CANCELABLE=1", "__DARWIN_NON_CANCELABLE=1",
); );
HEADER_SEARCH_PATHS = "$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders/"; HEADER_SEARCH_PATHS = "$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders/";
INSTALL_PATH_ACTUAL = /usr/lib/system; INSTALL_PATH = /usr/lib/system;
INTERPOSITION_SIM_SUFFIX = "";
"INTERPOSITION_SIM_SUFFIX[sdk=iphonesimulator*]" = _sim;
LINK_WITH_STANDARD_LIBRARIES = NO; LINK_WITH_STANDARD_LIBRARIES = NO;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"-Wl,-umbrella,System", "-Wl,-umbrella,System",
"-L/usr/lib/system", "-L/usr/lib/system",
"-ldyld", "-ldyld",
"-lcompiler_rt", "-lcompiler_rt",
"-lsystem_kernel", "-lsystem$(INTERPOSITION_SIM_SUFFIX)_kernel",
"-lsystem_platform", "-lsystem$(INTERPOSITION_SIM_SUFFIX)_platform",
"-lsystem_pthread", "-lsystem$(INTERPOSITION_SIM_SUFFIX)_pthread",
"-lsystem_malloc", "-lsystem_malloc",
"-lsystem_c", "-lsystem_c",
"-lsystem_blocks", "-lsystem_blocks",
@ -2784,18 +2803,7 @@
"-llaunch", "-llaunch",
"-lsystem_asl", "-lsystem_asl",
); );
"OTHER_LDFLAGS[sdk=iphonesimulator*]" = (
"-Wl,-umbrella,System",
"-L/usr/lib/system",
"-ldyld_sim",
"-lcompiler_rt_sim",
"-lsystem_sim_c",
"-lsystem_sim_blocks",
"-ldispatch",
"-Wl,-upward-lSystem",
);
PRODUCT_NAME = libsystem_dnssd_debug; PRODUCT_NAME = libsystem_dnssd_debug;
"PRODUCT_NAME[sdk=iphonesimulator*]" = libsystem_sim_dnssd_debug;
}; };
name = Development; name = Development;
}; };
@ -2815,16 +2823,18 @@
); );
GENERATE_PROFILING_CODE = YES; GENERATE_PROFILING_CODE = YES;
HEADER_SEARCH_PATHS = "$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders/"; HEADER_SEARCH_PATHS = "$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders/";
INSTALL_PATH_ACTUAL = /usr/lib/system; INSTALL_PATH = /usr/lib/system;
INTERPOSITION_SIM_SUFFIX = "";
"INTERPOSITION_SIM_SUFFIX[sdk=iphonesimulator*]" = _sim;
LINK_WITH_STANDARD_LIBRARIES = NO; LINK_WITH_STANDARD_LIBRARIES = NO;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"-Wl,-umbrella,System", "-Wl,-umbrella,System",
"-L/usr/lib/system", "-L/usr/lib/system",
"-ldyld", "-ldyld",
"-lcompiler_rt", "-lcompiler_rt",
"-lsystem_kernel", "-lsystem$(INTERPOSITION_SIM_SUFFIX)_kernel",
"-lsystem_platform", "-lsystem$(INTERPOSITION_SIM_SUFFIX)_platform",
"-lsystem_pthread", "-lsystem$(INTERPOSITION_SIM_SUFFIX)_pthread",
"-lsystem_malloc", "-lsystem_malloc",
"-lsystem_c", "-lsystem_c",
"-lsystem_blocks", "-lsystem_blocks",
@ -2832,18 +2842,7 @@
"-llaunch", "-llaunch",
"-lsystem_asl", "-lsystem_asl",
); );
"OTHER_LDFLAGS[sdk=iphonesimulator*]" = (
"-Wl,-umbrella,System",
"-L/usr/lib/system",
"-ldyld_sim",
"-lcompiler_rt_sim",
"-lsystem_sim_c",
"-lsystem_sim_blocks",
"-ldispatch",
"-Wl,-upward-lSystem",
);
PRODUCT_NAME = libsystem_dnssd_profile; PRODUCT_NAME = libsystem_dnssd_profile;
"PRODUCT_NAME[sdk=iphonesimulator*]" = libsystem_sim_dnssd_profile;
}; };
name = Development; name = Development;
}; };
@ -2887,16 +2886,18 @@
HEADER_SEARCH_PATHS = "$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders/"; HEADER_SEARCH_PATHS = "$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders/";
INSTALLHDRS_COPY_PHASE = YES; INSTALLHDRS_COPY_PHASE = YES;
INSTALLHDRS_SCRIPT_PHASE = YES; INSTALLHDRS_SCRIPT_PHASE = YES;
INSTALL_PATH_ACTUAL = /usr/lib/system; INSTALL_PATH = /usr/lib/system;
INTERPOSITION_SIM_SUFFIX = "";
"INTERPOSITION_SIM_SUFFIX[sdk=iphonesimulator*]" = _sim;
LINK_WITH_STANDARD_LIBRARIES = NO; LINK_WITH_STANDARD_LIBRARIES = NO;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"-Wl,-umbrella,System", "-Wl,-umbrella,System",
"-L/usr/lib/system", "-L/usr/lib/system",
"-ldyld", "-ldyld",
"-lcompiler_rt", "-lcompiler_rt",
"-lsystem_kernel", "-lsystem$(INTERPOSITION_SIM_SUFFIX)_kernel",
"-lsystem_platform", "-lsystem$(INTERPOSITION_SIM_SUFFIX)_platform",
"-lsystem_pthread", "-lsystem$(INTERPOSITION_SIM_SUFFIX)_pthread",
"-lsystem_malloc", "-lsystem_malloc",
"-lsystem_c", "-lsystem_c",
"-lsystem_blocks", "-lsystem_blocks",
@ -2904,18 +2905,7 @@
"-llaunch", "-llaunch",
"-lsystem_asl", "-lsystem_asl",
); );
"OTHER_LDFLAGS[sdk=iphonesimulator*]" = (
"-Wl,-umbrella,System",
"-L/usr/lib/system",
"-ldyld_sim",
"-lcompiler_rt_sim",
"-lsystem_sim_c",
"-lsystem_sim_blocks",
"-ldispatch",
"-Wl,-upward-lSystem",
);
PRODUCT_NAME = libsystem_dnssd; PRODUCT_NAME = libsystem_dnssd;
"PRODUCT_NAME[sdk=iphonesimulator*]" = libsystem_sim_dnssd;
}; };
name = Development; name = Development;
}; };
@ -2986,6 +2976,14 @@
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Development; defaultConfigurationName = Development;
}; };
3F2EAAA11A5B85FF007F5A52 /* Build configuration list for PBXAggregateTarget "Build Deprecated" */ = {
isa = XCConfigurationList;
buildConfigurations = (
3F2EAAA01A5B85FF007F5A52 /* Development */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Development;
};
4AE471770EAFF84000A6C5AD /* Build configuration list for PBXLegacyTarget "dns_sd.jar" */ = { 4AE471770EAFF84000A6C5AD /* Build configuration list for PBXLegacyTarget "dns_sd.jar" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
buildConfigurations = ( buildConfigurations = (

View File

@ -1,6 +1,6 @@
# -*- tab-width: 4 -*- # -*- tab-width: 4 -*-
# #
# Copyright (c) 2002-2004, Apple Computer, Inc. All rights reserved. # Copyright (c) 2002-2004, 2015, Apple Computer, Inc. All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met: # modification, are permitted provided that the following conditions are met:
@ -57,6 +57,7 @@ JDK = /usr/jdk
CC = @cc CC = @cc
BISON = @bison BISON = @bison
FLEX = @flex FLEX = @flex
ST = @strip
LD = ld -shared LD = ld -shared
CP = cp CP = cp
RM = rm RM = rm
@ -82,7 +83,7 @@ else
CFLAGS_DEBUG = -Os -DMDNS_DEBUGMSGS=0 CFLAGS_DEBUG = -Os -DMDNS_DEBUGMSGS=0
OBJDIR ?= objects/prod OBJDIR ?= objects/prod
BUILDDIR ?= build/prod BUILDDIR ?= build/prod
STRIP = strip -S STRIP = $(ST) -S
endif endif
# Configure per-OS peculiarities # Configure per-OS peculiarities
@ -95,14 +96,14 @@ LD = gcc -shared
LINKOPTS = -lsocket -lnsl -lresolv LINKOPTS = -lsocket -lnsl -lresolv
JAVACFLAGS_OS += -I$(JDK)/include/solaris JAVACFLAGS_OS += -I$(JDK)/include/solaris
ifneq ($(DEBUG),1) ifneq ($(DEBUG),1)
STRIP = strip STRIP = $(ST)
endif endif
else else
# any target that contains the string "linux" # any target that contains the string "linux"
ifeq ($(findstring linux,$(os)),linux) ifeq ($(findstring linux,$(os)),linux)
CFLAGS_OS = -D_GNU_SOURCE -DHAVE_IPV6 -DNOT_HAVE_SA_LEN -DUSES_NETLINK -DHAVE_LINUX -DTARGET_OS_LINUX -fno-strict-aliasing CFLAGS_OS = -D_GNU_SOURCE -DHAVE_IPV6 -DNOT_HAVE_SA_LEN -DUSES_NETLINK -DHAVE_LINUX -DTARGET_OS_LINUX -fno-strict-aliasing
LD = gcc -shared LD = $(CC) -shared
FLEXFLAGS_OS = -l FLEXFLAGS_OS = -l
JAVACFLAGS_OS += -I$(JDK)/include/linux JAVACFLAGS_OS += -I$(JDK)/include/linux

View File

@ -120,6 +120,7 @@ struct timeval tv_start, tv_end, tv_interval;
static int FilterInterface = 0; static int FilterInterface = 0;
static FilterList *Filters; static FilterList *Filters;
#define ExactlyOneFilter (Filters && !Filters->next) #define ExactlyOneFilter (Filters && !Filters->next)
static mDNSBool AddressType = mDNSAddrType_IPv4;
static int NumPktQ, NumPktL, NumPktR, NumPktB; // Query/Legacy/Response/Bad static int NumPktQ, NumPktL, NumPktR, NumPktB; // Query/Legacy/Response/Bad
static int NumProbes, NumGoodbyes, NumQuestions, NumLegacy, NumAnswers, NumAdditionals; static int NumProbes, NumGoodbyes, NumQuestions, NumLegacy, NumAnswers, NumAdditionals;
@ -466,7 +467,7 @@ mDNSlocal void DisplayPacketHeader(mDNS *const m, const DNSMessage *const msg, c
{ {
const char *const ptype = (msg->h.flags.b[0] & kDNSFlag0_QR_Response) ? "-R- " : const char *const ptype = (msg->h.flags.b[0] & kDNSFlag0_QR_Response) ? "-R- " :
(srcport.NotAnInteger == MulticastDNSPort.NotAnInteger) ? "-Q- " : "-LQ-"; (srcport.NotAnInteger == MulticastDNSPort.NotAnInteger) ? "-Q- " : "-LQ-";
const unsigned length = end - (mDNSu8 *)msg;
struct timeval tv; struct timeval tv;
struct tm tm; struct tm tm;
const mDNSu32 index = mDNSPlatformInterfaceIndexfromInterfaceID(m, InterfaceID, mDNSfalse); const mDNSu32 index = mDNSPlatformInterfaceIndexfromInterfaceID(m, InterfaceID, mDNSfalse);
@ -477,7 +478,7 @@ mDNSlocal void DisplayPacketHeader(mDNS *const m, const DNSMessage *const msg, c
mprintf("\n%d:%02d:%02d.%06d Interface %d/%s\n", tm.tm_hour, tm.tm_min, tm.tm_sec, tv.tv_usec, index, if_name); mprintf("\n%d:%02d:%02d.%06d Interface %d/%s\n", tm.tm_hour, tm.tm_min, tm.tm_sec, tv.tv_usec, index, if_name);
mprintf("%#-16a %s Q:%3d Ans:%3d Auth:%3d Add:%3d Size:%5d bytes", mprintf("%#-16a %s Q:%3d Ans:%3d Auth:%3d Add:%3d Size:%5d bytes",
srcaddr, ptype, msg->h.numQuestions, msg->h.numAnswers, msg->h.numAuthorities, msg->h.numAdditionals, end - (mDNSu8 *)msg); srcaddr, ptype, msg->h.numQuestions, msg->h.numAnswers, msg->h.numAuthorities, msg->h.numAdditionals, length);
if (msg->h.id.NotAnInteger) mprintf(" ID:%u", mDNSVal16(msg->h.id)); if (msg->h.id.NotAnInteger) mprintf(" ID:%u", mDNSVal16(msg->h.id));
@ -488,7 +489,27 @@ mDNSlocal void DisplayPacketHeader(mDNS *const m, const DNSMessage *const msg, c
if (msg->h.flags.b[0] & kDNSFlag0_QR_Response) mprintf(" Truncated"); if (msg->h.flags.b[0] & kDNSFlag0_QR_Response) mprintf(" Truncated");
else mprintf(" Truncated (KA list continues in next packet)"); else mprintf(" Truncated (KA list continues in next packet)");
} }
mprintf("\n"); mprintf("\n");
if (length < sizeof(DNSMessageHeader) + NormalMaxDNSMessageData - 192)
if (msg->h.flags.b[0] & kDNSFlag0_TC)
mprintf("%#-16a **** WARNING: Packet suspiciously small. Payload size (excluding IP and UDP headers)\n"
"%#-16a **** should usually be closer to %d bytes before truncation becomes necessary.\n",
srcaddr, srcaddr, sizeof(DNSMessageHeader) + NormalMaxDNSMessageData);
}
mDNSlocal void DisplaySizeCheck(const DNSMessage *const msg, const mDNSu8 *const end, const mDNSAddr *srcaddr, int num_opts)
{
const unsigned length = end - (mDNSu8 *)msg;
const int num_records = msg->h.numAnswers + msg->h.numAuthorities + msg->h.numAdditionals - num_opts;
if (length > sizeof(DNSMessageHeader) + NormalMaxDNSMessageData)
if (num_records > 1)
mprintf("%#-16a **** ERROR: Oversized packet with %d records.\n"
"%#-16a **** Many network devices cannot receive packets larger than %d bytes.\n"
"%#-16a **** To minimize interoperability failures, oversized packets MUST be limited to a single resource record.\n",
srcaddr, num_records, srcaddr, 40 + 8 + sizeof(DNSMessageHeader) + NormalMaxDNSMessageData, srcaddr);
} }
mDNSlocal void DisplayResourceRecord(const mDNSAddr *const srcaddr, const char *const op, const ResourceRecord *const pktrr) mDNSlocal void DisplayResourceRecord(const mDNSAddr *const srcaddr, const char *const op, const ResourceRecord *const pktrr)
@ -602,6 +623,7 @@ mDNSlocal void DisplayQuery(mDNS *const m, const DNSMessage *const msg, const mD
const mDNSAddr *srcaddr, mDNSIPPort srcport, const mDNSAddr *dstaddr, const mDNSInterfaceID InterfaceID) const mDNSAddr *srcaddr, mDNSIPPort srcport, const mDNSAddr *dstaddr, const mDNSInterfaceID InterfaceID)
{ {
int i; int i;
int num_opts = 0;
const mDNSu8 *ptr = msg->data; const mDNSu8 *ptr = msg->data;
const mDNSu8 *auth = LocateAuthorities(msg, end); const mDNSu8 *auth = LocateAuthorities(msg, end);
mDNSBool MQ = (srcport.NotAnInteger == MulticastDNSPort.NotAnInteger); mDNSBool MQ = (srcport.NotAnInteger == MulticastDNSPort.NotAnInteger);
@ -648,6 +670,8 @@ mDNSlocal void DisplayQuery(mDNS *const m, const DNSMessage *const msg, const mD
ptr = GetLargeResourceRecord(m, msg, ptr, end, InterfaceID, kDNSRecordTypePacketAns, &pkt); ptr = GetLargeResourceRecord(m, msg, ptr, end, InterfaceID, kDNSRecordTypePacketAns, &pkt);
if (!ptr) { DisplayError(srcaddr, ep, end, "KNOWN ANSWER"); return; } if (!ptr) { DisplayError(srcaddr, ep, end, "KNOWN ANSWER"); return; }
DisplayResourceRecord(srcaddr, "(KA)", &pkt.r.resrec); DisplayResourceRecord(srcaddr, "(KA)", &pkt.r.resrec);
if (pkt.r.resrec.rrtype == kDNSType_OPT)
{ num_opts++; mprintf("%#-16a **** ERROR: OPT RECORD IN ANSWER SECTION ****\n", srcaddr); }
// In the case of queries with long multi-packet KA lists, we count each subsequent KA packet // In the case of queries with long multi-packet KA lists, we count each subsequent KA packet
// the same as a single query, to more accurately reflect the burden on the network // the same as a single query, to more accurately reflect the burden on the network
@ -664,6 +688,8 @@ mDNSlocal void DisplayQuery(mDNS *const m, const DNSMessage *const msg, const mD
// After we display an Update record with its matching question (above) we zero out its type and class // After we display an Update record with its matching question (above) we zero out its type and class
// If any remain that haven't been zero'd out, display them here // If any remain that haven't been zero'd out, display them here
if (pkt.r.resrec.rrtype || pkt.r.resrec.rrclass) DisplayResourceRecord(srcaddr, "(AU)", &pkt.r.resrec); if (pkt.r.resrec.rrtype || pkt.r.resrec.rrclass) DisplayResourceRecord(srcaddr, "(AU)", &pkt.r.resrec);
if (pkt.r.resrec.rrtype == kDNSType_OPT)
{ num_opts++; mprintf("%#-16a **** ERROR: OPT RECORD IN AUTHORITY SECTION ****\n", srcaddr); }
} }
for (i=0; i<msg->h.numAdditionals; i++) for (i=0; i<msg->h.numAdditionals; i++)
@ -672,8 +698,15 @@ mDNSlocal void DisplayQuery(mDNS *const m, const DNSMessage *const msg, const mD
ptr = GetLargeResourceRecord(m, msg, ptr, end, InterfaceID, kDNSRecordTypePacketAdd, &pkt); ptr = GetLargeResourceRecord(m, msg, ptr, end, InterfaceID, kDNSRecordTypePacketAdd, &pkt);
if (!ptr) { DisplayError(srcaddr, ep, end, "ADDITIONAL"); return; } if (!ptr) { DisplayError(srcaddr, ep, end, "ADDITIONAL"); return; }
DisplayResourceRecord(srcaddr, pkt.r.resrec.rrtype == kDNSType_OPT ? "(OP)" : "(AD)", &pkt.r.resrec); DisplayResourceRecord(srcaddr, pkt.r.resrec.rrtype == kDNSType_OPT ? "(OP)" : "(AD)", &pkt.r.resrec);
if (pkt.r.resrec.rrtype == kDNSType_OPT) num_opts++;
} }
DisplaySizeCheck(msg, end, srcaddr, num_opts);
// We don't hexdump the DNSMessageHeader here because those six fields (id, flags, numQuestions, numAnswers, numAuthorities, numAdditionals)
// have already been swapped to host byte order and displayed, so including them in the hexdump is confusing
if (num_opts > 1) { mprintf("%#-16a **** ERROR: MULTIPLE OPT RECORDS ****\n", srcaddr); HexDump(msg->data, end); }
if (entry) AnalyseHost(m, entry, InterfaceID); if (entry) AnalyseHost(m, entry, InterfaceID);
} }
@ -681,6 +714,7 @@ mDNSlocal void DisplayResponse(mDNS *const m, const DNSMessage *const msg, const
const mDNSAddr *srcaddr, mDNSIPPort srcport, const mDNSAddr *dstaddr, const mDNSInterfaceID InterfaceID) const mDNSAddr *srcaddr, mDNSIPPort srcport, const mDNSAddr *dstaddr, const mDNSInterfaceID InterfaceID)
{ {
int i; int i;
int num_opts = 0;
const mDNSu8 *ptr = msg->data; const mDNSu8 *ptr = msg->data;
HostEntry *entry = GotPacketFromHost(srcaddr, HostPkt_R, msg->h.id); HostEntry *entry = GotPacketFromHost(srcaddr, HostPkt_R, msg->h.id);
LargeCacheRecord pkt; LargeCacheRecord pkt;
@ -718,6 +752,8 @@ mDNSlocal void DisplayResponse(mDNS *const m, const DNSMessage *const msg, const
DisplayResourceRecord(srcaddr, "(DE)", &pkt.r.resrec); DisplayResourceRecord(srcaddr, "(DE)", &pkt.r.resrec);
recordstat(entry, pkt.r.resrec.name, OP_goodbye, pkt.r.resrec.rrtype); recordstat(entry, pkt.r.resrec.name, OP_goodbye, pkt.r.resrec.rrtype);
} }
if (pkt.r.resrec.rrtype == kDNSType_OPT)
{ num_opts++; mprintf("%#-16a **** ERROR: OPT RECORD IN ANSWER SECTION ****\n", srcaddr); }
} }
for (i=0; i<msg->h.numAuthorities; i++) for (i=0; i<msg->h.numAuthorities; i++)
@ -725,7 +761,10 @@ mDNSlocal void DisplayResponse(mDNS *const m, const DNSMessage *const msg, const
const mDNSu8 *ep = ptr; const mDNSu8 *ep = ptr;
ptr = GetLargeResourceRecord(m, msg, ptr, end, InterfaceID, kDNSRecordTypePacketAuth, &pkt); ptr = GetLargeResourceRecord(m, msg, ptr, end, InterfaceID, kDNSRecordTypePacketAuth, &pkt);
if (!ptr) { DisplayError(srcaddr, ep, end, "AUTHORITY"); return; } if (!ptr) { DisplayError(srcaddr, ep, end, "AUTHORITY"); return; }
if (pkt.r.resrec.rrtype != kDNSType_NSEC3) DisplayResourceRecord(srcaddr, "(AU)", &pkt.r.resrec);
if (pkt.r.resrec.rrtype == kDNSType_OPT)
{ num_opts++; mprintf("%#-16a **** ERROR: OPT RECORD IN AUTHORITY SECTION ****\n", srcaddr); }
else if (pkt.r.resrec.rrtype != kDNSType_NSEC3)
mprintf("%#-16a (?) **** ERROR: SHOULD NOT HAVE AUTHORITY IN mDNS RESPONSE **** %-5s %##s\n", mprintf("%#-16a (?) **** ERROR: SHOULD NOT HAVE AUTHORITY IN mDNS RESPONSE **** %-5s %##s\n",
srcaddr, DNSTypeName(pkt.r.resrec.rrtype), pkt.r.resrec.name->c); srcaddr, DNSTypeName(pkt.r.resrec.rrtype), pkt.r.resrec.name->c);
} }
@ -736,12 +775,19 @@ mDNSlocal void DisplayResponse(mDNS *const m, const DNSMessage *const msg, const
ptr = GetLargeResourceRecord(m, msg, ptr, end, InterfaceID, kDNSRecordTypePacketAdd, &pkt); ptr = GetLargeResourceRecord(m, msg, ptr, end, InterfaceID, kDNSRecordTypePacketAdd, &pkt);
if (!ptr) { DisplayError(srcaddr, ep, end, "ADDITIONAL"); return; } if (!ptr) { DisplayError(srcaddr, ep, end, "ADDITIONAL"); return; }
NumAdditionals++; NumAdditionals++;
if (pkt.r.resrec.rrtype == kDNSType_OPT) num_opts++;
DisplayResourceRecord(srcaddr, DisplayResourceRecord(srcaddr,
pkt.r.resrec.rrtype == kDNSType_OPT ? "(OP)" : (pkt.r.resrec.RecordType & kDNSRecordTypePacketUniqueMask) ? "(AD)" : "(AD+)", pkt.r.resrec.rrtype == kDNSType_OPT ? "(OP)" : (pkt.r.resrec.RecordType & kDNSRecordTypePacketUniqueMask) ? "(AD)" : "(AD+)",
&pkt.r.resrec); &pkt.r.resrec);
if (entry) RecordHostInfo(entry, &pkt.r.resrec); if (entry) RecordHostInfo(entry, &pkt.r.resrec);
} }
DisplaySizeCheck(msg, end, srcaddr, num_opts);
// We don't hexdump the DNSMessageHeader here because those six fields (id, flags, numQuestions, numAnswers, numAuthorities, numAdditionals)
// have already been swapped to host byte order and displayed, so including them in the hexdump is confusing
if (num_opts > 1) { mprintf("%#-16a **** ERROR: MULTIPLE OPT RECORDS ****\n", srcaddr); HexDump(msg->data, end); }
if (entry) AnalyseHost(m, entry, InterfaceID); if (entry) AnalyseHost(m, entry, InterfaceID);
} }
@ -763,7 +809,7 @@ mDNSlocal void ProcessUnicastResponse(mDNS *const m, const DNSMessage *const msg
mDNSlocal mDNSBool AddressMatchesFilterList(const mDNSAddr *srcaddr) mDNSlocal mDNSBool AddressMatchesFilterList(const mDNSAddr *srcaddr)
{ {
FilterList *f; FilterList *f;
if (!Filters) return(srcaddr->type == mDNSAddrType_IPv4); if (!Filters) return(srcaddr->type == AddressType);
for (f=Filters; f; f=f->next) if (mDNSSameAddress(srcaddr, &f->FilterAddr)) return(mDNStrue); for (f=Filters; f; f=f->next) if (mDNSSameAddress(srcaddr, &f->FilterAddr)) return(mDNStrue);
return(mDNSfalse); return(mDNSfalse);
} }
@ -930,9 +976,14 @@ mDNSexport int main(int argc, char **argv)
if (i+1 < argc && !strcmp(argv[i], "-i") && atoi(argv[i+1])) if (i+1 < argc && !strcmp(argv[i], "-i") && atoi(argv[i+1]))
{ {
FilterInterface = atoi(argv[i+1]); FilterInterface = atoi(argv[i+1]);
i += 2; i += 1;
printf("Monitoring interface %d\n", FilterInterface); printf("Monitoring interface %d\n", FilterInterface);
} }
else if (!strcmp(argv[i], "-6"))
{
AddressType = mDNSAddrType_IPv6;
printf("Monitoring IPv6 traffic\n");
}
else else
{ {
struct in_addr s4; struct in_addr s4;

View File

@ -90,6 +90,8 @@ static GenLinkedList gEventSources; // linked list of PosixEventSour
static sigset_t gEventSignalSet; // Signals which event loop listens for static sigset_t gEventSignalSet; // Signals which event loop listens for
static sigset_t gEventSignals; // Signals which were received while inside loop static sigset_t gEventSignals; // Signals which were received while inside loop
static PosixNetworkInterface *gRecentInterfaces;
// *************************************************************************** // ***************************************************************************
// Globals (for debugging) // Globals (for debugging)
@ -574,6 +576,13 @@ mDNSexport mDNSu32 mDNSPlatformInterfaceIndexfromInterfaceID(mDNS *const m, mDNS
while ((intf != NULL) && (mDNSInterfaceID) intf != id) while ((intf != NULL) && (mDNSInterfaceID) intf != id)
intf = (PosixNetworkInterface *)(intf->coreIntf.next); intf = (PosixNetworkInterface *)(intf->coreIntf.next);
if (intf) return intf->index;
// If we didn't find the interface, check the RecentInterfaces list as well
intf = gRecentInterfaces;
while ((intf != NULL) && (mDNSInterfaceID) intf != id)
intf = (PosixNetworkInterface *)(intf->coreIntf.next);
return intf ? intf->index : 0; return intf ? intf->index : 0;
} }
@ -587,7 +596,11 @@ mDNSlocal void FreePosixNetworkInterface(PosixNetworkInterface *intf)
#if HAVE_IPV6 #if HAVE_IPV6
if (intf->multicastSocket6 != -1) assert(close(intf->multicastSocket6) == 0); if (intf->multicastSocket6 != -1) assert(close(intf->multicastSocket6) == 0);
#endif #endif
free(intf);
// Move interface to the RecentInterfaces list for a minute
intf->LastSeen = mDNSPlatformUTC();
intf->coreIntf.next = &gRecentInterfaces->coreIntf;
gRecentInterfaces = intf;
} }
// Grab the first interface, deregister it, free it, and repeat until done. // Grab the first interface, deregister it, free it, and repeat until done.
@ -643,6 +656,14 @@ mDNSlocal int SetupSocket(struct sockaddr *intfAddr, mDNSIPPort port, int interf
#error This platform has no way to avoid address busy errors on multicast. #error This platform has no way to avoid address busy errors on multicast.
#endif #endif
if (err < 0) { err = errno; perror("setsockopt - SO_REUSExxxx"); } if (err < 0) { err = errno; perror("setsockopt - SO_REUSExxxx"); }
// Enable inbound packets on IFEF_AWDL interface.
// Only done for multicast sockets, since we don't expect unicast socket operations
// on the IFEF_AWDL interface. Operation is a no-op for other interface types.
#ifndef SO_RECV_ANYIF
#define SO_RECV_ANYIF 0x1104 /* unrestricted inbound processing */
#endif
if (setsockopt(*sktPtr, SOL_SOCKET, SO_RECV_ANYIF, &kOn, sizeof(kOn)) < 0) perror("setsockopt - SO_RECV_ANYIF");
} }
// We want to receive destination addresses and interface identifiers. // We want to receive destination addresses and interface identifiers.
@ -978,6 +999,17 @@ mDNSlocal int SetupInterfaceList(mDNS *const m)
// Clean up. // Clean up.
if (intfList != NULL) free_ifi_info(intfList); if (intfList != NULL) free_ifi_info(intfList);
// Clean up any interfaces that have been hanging around on the RecentInterfaces list for more than a minute
PosixNetworkInterface **ri = &gRecentInterfaces;
const mDNSs32 utc = mDNSPlatformUTC();
while (*ri)
{
PosixNetworkInterface *pi = *ri;
if (utc - pi->LastSeen < 60) ri = (PosixNetworkInterface **)&pi->coreIntf.next;
else { *ri = (PosixNetworkInterface *)pi->coreIntf.next; free(pi); }
}
return err; return err;
} }
@ -1318,9 +1350,15 @@ mDNSexport void mDNSPlatformClose(mDNS *const m)
#endif #endif
} }
// This is used internally by InterfaceChangeCallback.
// It's also exported so that the Standalone Responder (mDNSResponderPosix)
// can call it in response to a SIGHUP (mainly for debugging purposes).
mDNSexport mStatus mDNSPlatformPosixRefreshInterfaceList(mDNS *const m) mDNSexport mStatus mDNSPlatformPosixRefreshInterfaceList(mDNS *const m)
{ {
int err; int err;
// This is a pretty heavyweight way to process interface changes --
// destroying the entire interface list and then making fresh one from scratch.
// We should make it like the OS X version, which leaves unchanged interfaces alone.
ClearInterfaceList(m); ClearInterfaceList(m);
err = SetupInterfaceList(m); err = SetupInterfaceList(m);
return PosixErrorToStatus(err); return PosixErrorToStatus(err);

View File

@ -38,7 +38,8 @@ typedef struct PosixNetworkInterface PosixNetworkInterface;
struct PosixNetworkInterface struct PosixNetworkInterface
{ {
NetworkInterfaceInfo coreIntf; NetworkInterfaceInfo coreIntf; // MUST be the first element in this structure
mDNSs32 LastSeen;
const char * intfName; const char * intfName;
PosixNetworkInterface * aliasIntf; PosixNetworkInterface * aliasIntf;
int index; int index;

View File

@ -66,7 +66,7 @@
*/ */
#ifndef _DNS_SD_H #ifndef _DNS_SD_H
#define _DNS_SD_H 5610101 #define _DNS_SD_H 5670000
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -1961,7 +1961,6 @@ DNSServiceErrorType DNSSD_API DNSServiceReconfirmRecord
const void *rdata const void *rdata
); );
/********************************************************************************************* /*********************************************************************************************
* *
* NAT Port Mapping * NAT Port Mapping

View File

@ -817,5 +817,4 @@ DNSServiceErrorType DNSSD_API DNSServiceReconfirmRecord
return(kDNSServiceErr_Unsupported); return(kDNSServiceErr_Unsupported);
} }
#endif // !MDNS_BUILDINGSTUBLIBRARY #endif // !MDNS_BUILDINGSTUBLIBRARY

View File

@ -1112,6 +1112,7 @@ void DNSSD_API DNSServiceRefDeallocate(DNSServiceRef sdRef)
// callbacks when we return from this function. Setting ProcessReply to NULL // callbacks when we return from this function. Setting ProcessReply to NULL
// provides extra protection. // provides extra protection.
sdRef->ProcessReply = NULL; sdRef->ProcessReply = NULL;
shutdown(sdRef->sockfd, SHUT_WR);
dispatch_source_cancel(sdRef->disp_source); dispatch_source_cancel(sdRef->disp_source);
dispatch_release(sdRef->disp_source); dispatch_release(sdRef->disp_source);
sdRef->disp_source = NULL; sdRef->disp_source = NULL;
@ -2092,7 +2093,6 @@ DNSServiceErrorType DNSSD_API DNSServiceReconfirmRecord
return err; return err;
} }
static void handle_port_mapping_response(DNSServiceOp *const sdr, const CallbackHeader *const cbh, const char *data, const char *const end) static void handle_port_mapping_response(DNSServiceOp *const sdr, const CallbackHeader *const cbh, const char *data, const char *const end)
{ {
union { uint32_t l; u_char b[4]; } addr; union { uint32_t l; u_char b[4]; } addr;