Changeset e36ca10 in rtems-libbsd


Ignore:
Timestamp:
Sep 19, 2018, 6:49:34 AM (13 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
c1e05b9ea378b2971e3d7704779112b4bc4296da, 4a77611a223ea883fb548679b516d326a020d447
Children:
49ebc73
Parents:
111789e
git-author:
Sebastian Huber <sebastian.huber@…> (09/19/18 06:49:34)
git-committer:
Sebastian Huber <sebastian.huber@…> (09/20/18 09:23:31)
Message:

mDNSResponder: Update to v567

The sources can be obtained via:

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

Update #3522.

Location:
mDNSResponder
Files:
4 added
20 edited

Legend:

Unmodified
Added
Removed
  • mDNSResponder/Clients/Makefile

    r111789e re36ca10  
    11# -*- tab-width: 4 -*-
    22#
    3 # Copyright (c) 2002-2004 Apple Computer, Inc. All rights reserved.
     3# Copyright (c) 2002-2004, 2015 Apple Computer, Inc. All rights reserved.
    44#
    55# Licensed under the Apache License, Version 2.0 (the "License");
     
    2121# For more magic automatic variables, see
    2222# <http://www.gnu.org/software/make/manual/html_chapter/make_10.html#SEC111>
     23#
     24# This makefile uses $(CC) for compilation and linking, which is
     25# an automatic implicit gcc variable that defaults to "cc"
     26# <https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html>
    2327
    2428#############################################################################
     
    4347
    4448build/dns-sd: build dns-sd.c ClientCommon.c
    45         cc $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@
     49        $(CC) $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@
    4650
    4751build/dns-sd64: build dns-sd.c ClientCommon.c
    48         cc $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@ -m64
     52        $(CC) $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@ -m64
    4953
    5054# Note, we can make a 'fat' version of dns-sd using 'lipo', as shown below, but we
  • mDNSResponder/Clients/dns-sd.c

    r111789e re36ca10  
    16181618        break;
    16191619
    1620 
    16211620    case 'P':   if (argc < opi+6) goto Fail;
    16221621        err = DNSServiceCreateConnection(&client_pa);
     
    17821781    }
    17831782
    1784     if (!client || err != kDNSServiceErr_NoError) { fprintf(stderr, "DNSService call failed %ld\n", (long int)err); return (-1); }
     1783    if (!client || err != kDNSServiceErr_NoError)
     1784    {
     1785        fprintf(stderr, "DNSService call failed %ld%s\n", (long int)err,
     1786            (err == kDNSServiceErr_ServiceNotRunning) ? " (Service Not Running)" : "");
     1787        return (-1);
     1788    }
    17851789    printtimestamp();
    17861790    printf("...STARTING...\n");
  • mDNSResponder/Makefile

    r111789e re36ca10  
    1717include $(MAKEFILEPATH)/pb_makefiles/platform.make
    1818
    19 MVERS = "mDNSResponder-561.1.1"
     19MVERS = "mDNSResponder-567"
    2020
    2121DDNSWRITECONFIG = "$(DSTROOT)/Library/Application Support/Bonjour/ddnswriteconfig"
  • mDNSResponder/mDNSCore/DNSCommon.c

    r111789e re36ca10  
    371371    mDNSu32 length = mDNS_snprintf(buffer, MaxMsg-1, "%4d %##s %s ", rr->rdlength, rr->name->c, DNSTypeName(rr->rrtype));
    372372    if (rr->RecordType == kDNSRecordTypePacketNegative) return(buffer);
    373     if (!rr->rdlength) { mDNS_snprintf(buffer+length, RemSpc, "<< ZERO RDATA LENGTH >>"); return(buffer); }
     373    if (!rr->rdlength && rr->rrtype != kDNSType_OPT) { mDNS_snprintf(buffer+length, RemSpc, "<< ZERO RDATA LENGTH >>"); return(buffer); }
    374374
    375375    switch (rr->rrtype)
     
    409409            {
    410410            case kDNSOpt_LLQ:
     411                length += mDNS_snprintf(buffer+length, RemSpc, " LLQ");
    411412                length += mDNS_snprintf(buffer+length, RemSpc, " Vers %d",     opt->u.llq.vers);
    412413                length += mDNS_snprintf(buffer+length, RemSpc, " Op %d",       opt->u.llq.llqOp);
     
    419420                break;
    420421            case kDNSOpt_Owner:
     422                length += mDNS_snprintf(buffer+length, RemSpc, " Owner");
    421423                length += mDNS_snprintf(buffer+length, RemSpc, " Vers %d",     opt->u.owner.vers);
    422424                length += mDNS_snprintf(buffer+length, RemSpc, " Seq %3d", (mDNSu8)opt->u.owner.seq);                           // Display as unsigned
     
    430432                break;
    431433            case kDNSOpt_Trace:
     434                length += mDNS_snprintf(buffer+length, RemSpc, " Trace");
    432435                length += mDNS_snprintf(buffer+length, RemSpc, " Platform %d",    opt->u.tracer.platf);
    433436                length += mDNS_snprintf(buffer+length, RemSpc, " mDNSVers %d",    opt->u.tracer.mDNSv);
     
    32003203                    opt->u.tracer.platf   = ptr[0];
    32013204                    opt->u.tracer.mDNSv   = (mDNSu32) ((mDNSu32)ptr[1] << 24 | (mDNSu32)ptr[2] << 16 | (mDNSu32)ptr[3] << 8 | ptr[4]);
     3205                    opt++;
     3206                }
     3207                else
     3208                {
     3209                    opt->u.tracer.platf   = 0xFF;
     3210                    opt->u.tracer.mDNSv   = 0xFFFFFFFF;
    32023211                    opt++;
    32033212                }
  • mDNSResponder/mDNSCore/mDNS.c

    r111789e re36ca10  
    2424 */
    2525
    26 #include "DNSCommon.h"                  // Defines general DNS untility routines
     26#include "DNSCommon.h"                  // Defines general DNS utility routines
    2727#include "uDNS.h"                       // Defines entry points into unicast-specific routines
    2828#include "nsec.h"
     
    1117111171{
    1117211172    // NOTE: CacheRecordRmvEventsForQuestion will not generate RMV events for queries that have non-zero
    11173     // LOddressAnswers. Hence it is important that we call CacheRecordRmvEventsForQuestion before
     11173    // LOAddressAnswers. Hence it is important that we call CacheRecordRmvEventsForQuestion before
    1117411174    // LocalRecordRmvEventsForQuestion (which decrements LOAddressAnswers)
    1117511175    if (q->SuppressQuery)
  • mDNSResponder/mDNSCore/mDNSEmbeddedAPI.h

    r111789e re36ca10  
    9797// Don't support jumbo frames
    9898#define AbsoluteMaxDNSMessageData       1500
     99// By the time you add IPv6 header (40 bytes) UDP header (8 bytes) and DNS message header (12 bytes)
     100// this makes 1560 which is 60 bytes over the standard Ethernet MTU. D'oh!
     101
    99102// StandardAuthRDSize is 264 (256+8), which is large enough to hold a maximum-sized SRV record (6 + 256 bytes)
    100103#define MaximumRDSize                           264
  • mDNSResponder/mDNSCore/uDNS.c

    r111789e re36ca10  
    13301330    {
    13311331        long n;
    1332         if (tcpInfo->nread < 2)         // First read the two-byte length preceeding the DNS message
     1332        const mDNSBool Read_replylen = (tcpInfo->nread < 2);  // Do we need to read the replylen field first?
     1333        if (Read_replylen)         // First read the two-byte length preceeding the DNS message
    13331334        {
    13341335            mDNSu8 *lenptr = (mDNSu8 *)&tcpInfo->replylen;
     
    13781379        if (n < 0)
    13791380        {
    1380             LogMsg("ERROR: tcpCallback - read returned %d", n);
    1381             err = mStatus_ConnFailed;
     1381            // If this is our only read for this invokation, and it fails, then that's bad.
     1382            // But if we did successfully read some or all of the replylen field this time through,
     1383            // and this is now our second read from the socket, then it's expected that sometimes
     1384            // there may be no more data present, and that's perfectly okay.
     1385            // Assuming failure of the second read is a problem is what caused this bug:
     1386            // <rdar://problem/15043194> mDNSResponder fails to read DNS over TCP packet correctly
     1387            if (!Read_replylen) { LogMsg("ERROR: tcpCallback - read returned %d", n); err = mStatus_ConnFailed; }
    13821388            goto exit;
    13831389        }
  • mDNSResponder/mDNSMacOSX/base.xcconfig

    r111789e re36ca10  
    1 #include "<DEVELOPER_DIR>/AppleInternal/XcodeConfig/SimulatorSupport.xcconfig"
    2 
    3 // Set INSTALL_PATH[sdk=macosx*] when SimulatorSupport.xcconfig is unavailable
    4 INSTALL_PATH[sdk=macosx*] = $(INSTALL_PATH_ACTUAL)
    5 
    6 // Use $(INSTALL_PATH_PREFIX) instead of $(SDKROOT) as an unconditional prefix
    7 PUBLIC_HEADERS_FOLDER_PATH = $(INSTALL_PATH_PREFIX)/usr/include
    8 PRIVATE_HEADERS_FOLDER_PATH = $(INSTALL_PATH_PREFIX)/usr/local/include
     1PUBLIC_HEADERS_FOLDER_PATH = /usr/include
     2PRIVATE_HEADERS_FOLDER_PATH = /usr/local/include
  • mDNSResponder/mDNSMacOSX/daemon.c

    r111789e re36ca10  
    25942594}
    25952595
     2596mDNSlocal void SetLowWater(const KQSocketSet *const k, const int r)
     2597{
     2598    if (setsockopt(k->sktv4, SOL_SOCKET, SO_RCVLOWAT, &r, sizeof(r)) < 0)
     2599        LogMsg("SO_RCVLOWAT IPv4 %d error %d errno %d (%s)", k->sktv4, r, errno, strerror(errno));
     2600    if (setsockopt(k->sktv6, SOL_SOCKET, SO_RCVLOWAT, &r, sizeof(r)) < 0)
     2601        LogMsg("SO_RCVLOWAT IPv6 %d error %d errno %d (%s)", k->sktv6, r, errno, strerror(errno));
     2602}
     2603
    25962604mDNSlocal void * KQueueLoop(void *m_param)
    25972605{
     
    26782686        // 3. The timeout expires
    26792687        pthread_mutex_unlock(&PlatformStorage.BigMutex);
     2688
     2689        // If we woke up to receive a multicast, set low-water mark to dampen excessive wakeup rate
     2690        if (m->p->num_mcasts)
     2691        {
     2692            SetLowWater(&m->p->permanentsockets, 0x10000);
     2693            if (ticks > mDNSPlatformOneSecond / 8) ticks = mDNSPlatformOneSecond / 8;
     2694        }
    26802695
    26812696#if USE_SELECT_WITH_KQUEUEFD
     
    27052720        // makes the event no longer valid. Now we have the lock, we call kevent again
    27062721        // and this time we can safely process the events it tells us about.
     2722
     2723        // If we changed UDP socket low-water mark, restore it, so we will be told about every packet
     2724        if (m->p->num_mcasts)
     2725        {
     2726            SetLowWater(&m->p->permanentsockets, 1);
     2727            m->p->num_mcasts = 0;
     2728        }
    27072729
    27082730        static const struct timespec zero_timeout = { 0, 0 };
  • mDNSResponder/mDNSMacOSX/helper.c

    r111789e re36ca10  
    616616
    617617    // If we are not showing the dialogue, we need to remember the first "old" value so that
    618     // we maintain the same through the lifetime of the dialogue. Subsequence conflicts don't
     618    // we maintain the same through the lifetime of the dialogue. Subsequent conflicts don't
    619619    // update the "old" value.
    620620    if (!user[0])
  • mDNSResponder/mDNSMacOSX/mDNSMacOSX.c

    r111789e re36ca10  
    20652065        if (err < 0) break;
    20662066
     2067        if ((destAddr.type == mDNSAddrType_IPv4 && (destAddr.ip.v4.b[0] & 0xF0) == 0xE0) ||
     2068            (destAddr.type == mDNSAddrType_IPv6 && (destAddr.ip.v6.b[0]         == 0xFF))) m->p->num_mcasts++;
     2069
    20672070        count++;
    20682071        if (from.ss_family == AF_INET)
     
    30113014
    30123015    // ... with a shared UDP port, if it's for multicast receiving
    3013     if (mDNSSameIPPort(port, MulticastDNSPort) || mDNSSameIPPort(port, NATPMPAnnouncementPort)) err = setsockopt(skt, SOL_SOCKET, SO_REUSEPORT, &on, sizeof(on));
    3014     if (err < 0) { errstr = "setsockopt - SO_REUSEPORT"; goto fail; }
     3016    if (mDNSSameIPPort(port, MulticastDNSPort) || mDNSSameIPPort(port, NATPMPAnnouncementPort))
     3017    {
     3018        err = setsockopt(skt, SOL_SOCKET, SO_REUSEPORT, &on, sizeof(on));
     3019        if (err < 0) { errstr = "setsockopt - SO_REUSEPORT"; goto fail; }
     3020    }
    30153021
    30163022    if (sa_family == AF_INET)
     
    60756081    domainname d;
    60766082
    6077     SCDynamicStoreRef store = SCDynamicStoreCreate(NULL, CFSTR("mDNSResponder:mDNSPlatformSetDNSConfig"), NULL, NULL);
     6083    SCDynamicStoreRef store = SCDynamicStoreCreate(NULL, CFSTR("mDNSResponder:SetupDDNSDomains"), NULL, NULL);
    60786084    if (!store)
    60796085    {
     
    62006206
    62016207    // Need to set these here because we need to do this even if SCDynamicStoreCreate() or SCDynamicStoreCopyValue() below don't succeed
    6202     if (fqdn) fqdn->c[0]      = 0;
     6208    if (fqdn         ) fqdn->c[0]      = 0;
    62036209    if (RegDomains   ) *RegDomains     = NULL;
    62046210    if (BrowseDomains) *BrowseDomains  = NULL;
     
    62726278        {
    62736279            LogInfo("mDNSPlatformSetDNSConfig: config->n_resolver = %d, generation %llu", config->n_resolver, config->generation);
    6274             if (m->p->LastConfigGeneration == config->generation)
     6280                        // SameDomainName check below is to fix <rdar://problem/18059009> Dynamic DNS hostname changes not noticed
     6281            if (m->p->LastConfigGeneration == config->generation && (!fqdn || (SameDomainName(fqdn, &m->FQDN))))
    62756282            {
    62766283                LogInfo("mDNSPlatformSetDNSConfig: generation number %llu same, not processing", config->generation);
  • mDNSResponder/mDNSMacOSX/mDNSMacOSX.h

    r111789e re36ca10  
    170170    NetworkInterfaceInfoOSX *InterfaceList;
    171171    KQSocketSet permanentsockets;
     172    int num_mcasts;                              // Number of multicasts received during this CPU scheduling period (used for CPU limiting)
    172173    domainlabel userhostlabel;                  // The hostlabel as it was set in System Preferences the last time we looked
    173174    domainlabel usernicelabel;                  // The nicelabel as it was set in System Preferences the last time we looked
  • mDNSResponder/mDNSMacOSX/mDNSResponder.xcodeproj/project.pbxproj

    r111789e re36ca10  
    2626                        buildConfigurationList = 03067D730C83A3CB0022BE1F /* Build configuration list for PBXAggregateTarget "Build Some" */;
    2727                        buildPhases = (
    28                                 FF045B6A0C7E4AA600448140 /* ShellScript */,
    2928                        );
    3029                        dependencies = (
    3130                                217A4C49138EE14C000A5BA8 /* PBXTargetDependency */,
    32                                 03067D680C83A3830022BE1F /* PBXTargetDependency */,
    33                                 03067D6A0C83A3890022BE1F /* PBXTargetDependency */,
    3431                                03067D6C0C83A3920022BE1F /* PBXTargetDependency */,
    35                                 03067D6E0C83A39C0022BE1F /* PBXTargetDependency */,
    3632                                84C5B3411665544B00C324A8 /* PBXTargetDependency */,
    3733                        );
     
    6460                        productName = SystemLibrariesStatic;
    6561                };
     62                3F2EAA9F1A5B85FF007F5A52 /* Build Deprecated */ = {
     63                        isa = PBXAggregateTarget;
     64                        buildConfigurationList = 3F2EAAA11A5B85FF007F5A52 /* Build configuration list for PBXAggregateTarget "Build Deprecated" */;
     65                        buildPhases = (
     66                        );
     67                        dependencies = (
     68                                3F2EAAA71A5B861D007F5A52 /* PBXTargetDependency */,
     69                                3F2EAAA51A5B861C007F5A52 /* PBXTargetDependency */,
     70                                3F2EAAA91A5B861E007F5A52 /* PBXTargetDependency */,
     71                        );
     72                        name = "Build Deprecated";
     73                        productName = "Build Deprecated";
     74                };
    6675                FFA572650AF190F10055A0F1 /* SystemLibrariesDynamic */ = {
    6776                        isa = PBXAggregateTarget;
     
    8493                        dependencies = (
    8594                                FFB7657D0AEED97F00583A2C /* PBXTargetDependency */,
     95                                3F2EAAA31A5B8608007F5A52 /* PBXTargetDependency */,
    8696                                2141DCFD123FFB7D0086D23E /* PBXTargetDependency */,
    8797                        );
     
    338348
    339349/* Begin PBXContainerItemProxy section */
    340                 03067D670C83A3830022BE1F /* PBXContainerItemProxy */ = {
    341                         isa = PBXContainerItemProxy;
    342                         containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
    343                         proxyType = 1;
    344                         remoteGlobalIDString = D284BE500ADD80740027CCDF;
    345                         remoteInfo = mDNSResponder;
    346                 };
    347                 03067D690C83A3890022BE1F /* PBXContainerItemProxy */ = {
    348                         isa = PBXContainerItemProxy;
    349                         containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
    350                         proxyType = 1;
    351                         remoteGlobalIDString = D284BE750ADD80800027CCDF;
    352                         remoteInfo = "mDNSResponder debug";
    353                 };
    354350                03067D6B0C83A3920022BE1F /* PBXContainerItemProxy */ = {
    355351                        isa = PBXContainerItemProxy;
     
    359355                        remoteInfo = "dns-sd tool";
    360356                };
    361                 03067D6D0C83A39C0022BE1F /* PBXContainerItemProxy */ = {
    362                         isa = PBXContainerItemProxy;
    363                         containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
    364                         proxyType = 1;
    365                         remoteGlobalIDString = 2E0405EF0C31955500F13B59;
    366                         remoteInfo = mDNSResponderHelper;
    367                 };
    368357                03067D850C849CC30022BE1F /* PBXContainerItemProxy */ = {
    369358                        isa = PBXContainerItemProxy;
     
    421410                        remoteGlobalIDString = 213FB21712028A7A002B3A08;
    422411                        remoteInfo = BonjourEvents;
     412                };
     413                3F2EAAA21A5B8608007F5A52 /* PBXContainerItemProxy */ = {
     414                        isa = PBXContainerItemProxy;
     415                        containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
     416                        proxyType = 1;
     417                        remoteGlobalIDString = 3F2EAA9F1A5B85FF007F5A52;
     418                        remoteInfo = "Build Deprecated";
     419                };
     420                3F2EAAA41A5B861C007F5A52 /* PBXContainerItemProxy */ = {
     421                        isa = PBXContainerItemProxy;
     422                        containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
     423                        proxyType = 1;
     424                        remoteGlobalIDString = D284BE750ADD80800027CCDF;
     425                        remoteInfo = "mDNSResponder debug";
     426                };
     427                3F2EAAA61A5B861D007F5A52 /* PBXContainerItemProxy */ = {
     428                        isa = PBXContainerItemProxy;
     429                        containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
     430                        proxyType = 1;
     431                        remoteGlobalIDString = D284BE500ADD80740027CCDF;
     432                        remoteInfo = mDNSResponder;
     433                };
     434                3F2EAAA81A5B861E007F5A52 /* PBXContainerItemProxy */ = {
     435                        isa = PBXContainerItemProxy;
     436                        containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
     437                        proxyType = 1;
     438                        remoteGlobalIDString = 2E0405EF0C31955500F13B59;
     439                        remoteInfo = mDNSResponderHelper;
    423440                };
    424441                4AE471690EAFF83800A6C5AD /* PBXContainerItemProxy */ = {
     
    16261643                        isa = PBXProject;
    16271644                        attributes = {
     1645                                TargetAttributes = {
     1646                                        3F2EAA9F1A5B85FF007F5A52 = {
     1647                                                CreatedOnToolsVersion = 6.3;
     1648                                        };
     1649                                };
    16281650                        };
    16291651                        buildConfigurationList = D284BE2B0ADD78180027CCDF /* Build configuration list for PBXProject "mDNSResponder" */;
     
    16431665                                00AD62BB032D7A0C0CCA2C71 /* Build More */,
    16441666                                03067D640C83A3700022BE1F /* Build Some */,
     1667                                3F2EAA9F1A5B85FF007F5A52 /* Build Deprecated */,
    16451668                                FFB7657B0AEED96B00583A2C /* Build All */,
    16461669                                D284BE500ADD80740027CCDF /* mDNSResponder */,
     
    17711794                        runOnlyForDeploymentPostprocessing = 1;
    17721795                        shellPath = /bin/sh;
    1773                         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\"";
     1796                        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\"";
    17741797                };
    17751798                21DE714D115831CB00DD4BD1 /* ShellScript */ = {
     
    17831806                        );
    17841807                        runOnlyForDeploymentPostprocessing = 1;
    1785                         shellPath = /bin/sh;
    1786                         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\"";
     1808                        shellPath = "/bin/bash -e -x";
     1809                        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";
    17871810                };
    17881811                4A4EE3A413CB8E82005C624B /* Build yacc file into derived source files */ = {
     
    18101833                        runOnlyForDeploymentPostprocessing = 0;
    18111834                        shellPath = /bin/sh;
    1812                         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/PrivateFramework//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\n";
     1835                        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\n";
    18131836                };
    18141837                D284BE6C0ADD80740027CCDF /* ShellScript */ = {
     
    18291852                        shellPath = /bin/sh;
    18301853                        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";
    1831                 };
    1832                 FF045B6A0C7E4AA600448140 /* ShellScript */ = {
    1833                         isa = PBXShellScriptBuildPhase;
    1834                         buildActionMask = 8;
    1835                         files = (
    1836                         );
    1837                         inputPaths = (
    1838                         );
    1839                         outputPaths = (
    1840                         );
    1841                         runOnlyForDeploymentPostprocessing = 1;
    1842                         shellPath = /bin/sh;
    1843                         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";
    18441854                };
    18451855                FF37FAAD0BC581780044A5CF /* ShellScript */ = {
     
    20962106
    20972107/* Begin PBXTargetDependency section */
    2098                 03067D680C83A3830022BE1F /* PBXTargetDependency */ = {
    2099                         isa = PBXTargetDependency;
    2100                         target = D284BE500ADD80740027CCDF /* mDNSResponder */;
    2101                         targetProxy = 03067D670C83A3830022BE1F /* PBXContainerItemProxy */;
    2102                 };
    2103                 03067D6A0C83A3890022BE1F /* PBXTargetDependency */ = {
    2104                         isa = PBXTargetDependency;
    2105                         target = D284BE750ADD80800027CCDF /* mDNSResponder debug */;
    2106                         targetProxy = 03067D690C83A3890022BE1F /* PBXContainerItemProxy */;
    2107                 };
    21082108                03067D6C0C83A3920022BE1F /* PBXTargetDependency */ = {
    21092109                        isa = PBXTargetDependency;
     
    21112111                        targetProxy = 03067D6B0C83A3920022BE1F /* PBXContainerItemProxy */;
    21122112                };
    2113                 03067D6E0C83A39C0022BE1F /* PBXTargetDependency */ = {
    2114                         isa = PBXTargetDependency;
    2115                         target = 2E0405EF0C31955500F13B59 /* mDNSResponderHelper */;
    2116                         targetProxy = 03067D6D0C83A39C0022BE1F /* PBXContainerItemProxy */;
    2117                 };
    21182113                03067D860C849CC30022BE1F /* PBXTargetDependency */ = {
    21192114                        isa = PBXTargetDependency;
     
    21552150                        target = 213FB21712028A7A002B3A08 /* BonjourEvents */;
    21562151                        targetProxy = 217A4C48138EE14C000A5BA8 /* PBXContainerItemProxy */;
     2152                };
     2153                3F2EAAA31A5B8608007F5A52 /* PBXTargetDependency */ = {
     2154                        isa = PBXTargetDependency;
     2155                        target = 3F2EAA9F1A5B85FF007F5A52 /* Build Deprecated */;
     2156                        targetProxy = 3F2EAAA21A5B8608007F5A52 /* PBXContainerItemProxy */;
     2157                };
     2158                3F2EAAA51A5B861C007F5A52 /* PBXTargetDependency */ = {
     2159                        isa = PBXTargetDependency;
     2160                        target = D284BE750ADD80800027CCDF /* mDNSResponder debug */;
     2161                        targetProxy = 3F2EAAA41A5B861C007F5A52 /* PBXContainerItemProxy */;
     2162                };
     2163                3F2EAAA71A5B861D007F5A52 /* PBXTargetDependency */ = {
     2164                        isa = PBXTargetDependency;
     2165                        target = D284BE500ADD80740027CCDF /* mDNSResponder */;
     2166                        targetProxy = 3F2EAAA61A5B861D007F5A52 /* PBXContainerItemProxy */;
     2167                };
     2168                3F2EAAA91A5B861E007F5A52 /* PBXTargetDependency */ = {
     2169                        isa = PBXTargetDependency;
     2170                        target = 2E0405EF0C31955500F13B59 /* mDNSResponderHelper */;
     2171                        targetProxy = 3F2EAAA81A5B861E007F5A52 /* PBXContainerItemProxy */;
    21572172                };
    21582173                4AE4716A0EAFF83800A6C5AD /* PBXTargetDependency */ = {
     
    22512266                                GCC_MODEL_TUNING = G5;
    22522267                                INFOPLIST_FILE = "BonjourEvents-Info.plist";
    2253                                 INSTALL_PATH_ACTUAL = /System/Library/UserEventPlugins/;
     2268                                INSTALL_PATH = /System/Library/UserEventPlugins/;
    22542269                                PREBINDING = NO;
    22552270                                PRODUCT_NAME = BonjourEvents;
     
    22942309                                INSTALLHDRS_COPY_PHASE = YES;
    22952310                                INSTALLHDRS_SCRIPT_PHASE = YES;
    2296                                 INSTALL_PATH_ACTUAL = /usr/local/lib/system;
     2311                                INSTALL_PATH = /usr/local/lib/system;
    22972312                                PREBINDING = NO;
    22982313                                PRODUCT_NAME = dns_sd;
     
    23142329                                );
    23152330                                HEADER_SEARCH_PATHS = "$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders/";
    2316                                 INSTALL_PATH_ACTUAL = /usr/local/lib/system;
     2331                                INSTALL_PATH = /usr/local/lib/system;
    23172332                                PREBINDING = NO;
    23182333                                PRODUCT_NAME = dns_sd_debug;
     
    23342349                                );
    23352350                                HEADER_SEARCH_PATHS = "$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders/";
    2336                                 INSTALL_PATH_ACTUAL = /usr/local/lib/system;
     2351                                INSTALL_PATH = /usr/local/lib/system;
    23372352                                PREBINDING = NO;
    23382353                                PRODUCT_NAME = dns_sd_profile;
     
    23572372                                        "$(SDKROOT)/usr/local/include",
    23582373                                );
    2359                                 INSTALL_PATH = "";
    2360                                 "INSTALL_PATH[sdk=macosx*]" = "";
    2361                                 INSTALL_PATH_ACTUAL = /usr/sbin;
     2374                                INSTALL_PATH = /usr/sbin;
    23622375                                LD_MAP_FILE_PATH = "$(TARGET_TEMP_DIR)/$(PRODUCT_NAME)-LinkMap-$(CURRENT_VARIANT)-$(CURRENT_ARCH).txt";
    23632376                                LIBRARY_SEARCH_PATHS = "\"${CONFIGURATION_TEMP_DIR}\"";
     
    23752388                                PRODUCT_NAME = mDNSResponderHelper;
    23762389                                PROVISIONING_PROFILE = "";
     2390                        };
     2391                        name = Development;
     2392                };
     2393                3F2EAAA01A5B85FF007F5A52 /* Development */ = {
     2394                        isa = XCBuildConfiguration;
     2395                        buildSettings = {
     2396                                PRODUCT_NAME = "$(TARGET_NAME)";
    23772397                        };
    23782398                        name = Development;
     
    24192439                                GCC_WARN_UNINITIALIZED_AUTOS = YES;
    24202440                                GCC_WARN_UNUSED_VARIABLE = YES;
    2421                                 INSTALL_PATH_ACTUAL = /usr/bin;
     2441                                INSTALL_PATH = /usr/bin;
    24222442                                MACOSX_DEPLOYMENT_TARGET = 10.9;
    24232443                                ONLY_ACTIVE_ARCH = NO;
     
    24532473                                GCC_WARN_UNINITIALIZED_AUTOS = YES;
    24542474                                GCC_WARN_UNUSED_VARIABLE = YES;
    2455                                 INSTALL_PATH_ACTUAL = /usr/lib;
     2475                                INSTALL_PATH = /usr/lib;
    24562476                                MACOSX_DEPLOYMENT_TARGET = 10.8;
    24572477                                ONLY_ACTIVE_ARCH = NO;
     
    24982518                                        "-fwrapv",
    24992519                                );
    2500                                 "OTHER_LDFLAGS[sdk=macosx*]" = "";
    25012520                                PREBINDING = NO;
    25022521                                STRIP_STYLE = debugging;
     
    25362555                                        "$(SDKROOT)/usr/local/include/",
    25372556                                );
    2538                                 INSTALL_PATH = "";
    2539                                 "INSTALL_PATH[sdk=macosx*]" = "";
    2540                                 INSTALL_PATH_ACTUAL = /usr/sbin;
     2557                                INSTALL_PATH = /usr/sbin;
    25412558                                LIBRARY_SEARCH_PATHS = "\"${CONFIGURATION_TEMP_DIR}\"";
    25422559                                MACOSX_DEPLOYMENT_TARGET = 10.5;
     
    26432660                                        "${SYSTEM_LIBRARY_DIR}/Frameworks/System.framework/PrivateHeaders",
    26442661                                );
    2645                                 INSTALL_PATH_ACTUAL = /usr/bin;
     2662                                INSTALL_PATH = /usr/bin;
    26462663                                OTHER_CFLAGS = "-no-cpp-precomp";
    26472664                                OTHER_LDFLAGS = "";
     
    26702687                                        "${PROJECT_DERIVED_FILE_DIR}",
    26712688                                );
    2672                                 INSTALL_PATH_ACTUAL = /usr/lib/java;
     2689                                INSTALL_PATH = /usr/lib/java;
    26732690                                LIBRARY_STYLE = DYNAMIC;
    26742691                                MACH_O_TYPE = mh_dylib;
     
    26962713                                        /System/Library/Frameworks/System.Framework/PrivateHeaders,
    26972714                                );
    2698                                 INSTALL_PATH_ACTUAL = /usr/sbin;
     2715                                INSTALL_PATH = /usr/sbin;
    26992716                                LIBRARY_SEARCH_PATHS = "\"${CONFIGURATION_TEMP_DIR}\"";
    27002717                                MACOSX_DEPLOYMENT_TARGET = 10.5;
     
    27182735                                GCC_DYNAMIC_NO_PIC = NO;
    27192736                                GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
    2720                                 INSTALL_PATH_ACTUAL = "/Library/Application Support/Bonjour";
     2737                                INSTALL_PATH = "/Library/Application Support/Bonjour";
    27212738                                MACOSX_DEPLOYMENT_TARGET = 10.5;
    27222739                                OTHER_CFLAGS = "";
     
    27422759                                GCC_SYMBOLS_PRIVATE_EXTERN = NO;
    27432760                                INFOPLIST_FILE = "PreferencePane/Info-PreferencePane.plist";
    2744                                 INSTALL_PATH_ACTUAL = /AppleInternal/Library/PreferencePanes;
     2761                                INSTALL_PATH = /AppleInternal/Library/PreferencePanes;
    27452762                                MACOSX_DEPLOYMENT_TARGET = 10.5;
    27462763                                OTHER_CFLAGS = "";
     
    27682785                                );
    27692786                                HEADER_SEARCH_PATHS = "$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders/";
    2770                                 INSTALL_PATH_ACTUAL = /usr/lib/system;
     2787                                INSTALL_PATH = /usr/lib/system;
     2788                                INTERPOSITION_SIM_SUFFIX = "";
     2789                                "INTERPOSITION_SIM_SUFFIX[sdk=iphonesimulator*]" = _sim;
    27712790                                LINK_WITH_STANDARD_LIBRARIES = NO;
    27722791                                OTHER_LDFLAGS = (
     
    27752794                                        "-ldyld",
    27762795                                        "-lcompiler_rt",
    2777                                         "-lsystem_kernel",
    2778                                         "-lsystem_platform",
    2779                                         "-lsystem_pthread",
     2796                                        "-lsystem$(INTERPOSITION_SIM_SUFFIX)_kernel",
     2797                                        "-lsystem$(INTERPOSITION_SIM_SUFFIX)_platform",
     2798                                        "-lsystem$(INTERPOSITION_SIM_SUFFIX)_pthread",
    27802799                                        "-lsystem_malloc",
    27812800                                        "-lsystem_c",
     
    27852804                                        "-lsystem_asl",
    27862805                                );
    2787                                 "OTHER_LDFLAGS[sdk=iphonesimulator*]" = (
    2788                                         "-Wl,-umbrella,System",
    2789                                         "-L/usr/lib/system",
    2790                                         "-ldyld_sim",
    2791                                         "-lcompiler_rt_sim",
    2792                                         "-lsystem_sim_c",
    2793                                         "-lsystem_sim_blocks",
    2794                                         "-ldispatch",
    2795                                         "-Wl,-upward-lSystem",
    2796                                 );
    27972806                                PRODUCT_NAME = libsystem_dnssd_debug;
    2798                                 "PRODUCT_NAME[sdk=iphonesimulator*]" = libsystem_sim_dnssd_debug;
    27992807                        };
    28002808                        name = Development;
     
    28162824                                GENERATE_PROFILING_CODE = YES;
    28172825                                HEADER_SEARCH_PATHS = "$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders/";
    2818                                 INSTALL_PATH_ACTUAL = /usr/lib/system;
     2826                                INSTALL_PATH = /usr/lib/system;
     2827                                INTERPOSITION_SIM_SUFFIX = "";
     2828                                "INTERPOSITION_SIM_SUFFIX[sdk=iphonesimulator*]" = _sim;
    28192829                                LINK_WITH_STANDARD_LIBRARIES = NO;
    28202830                                OTHER_LDFLAGS = (
     
    28232833                                        "-ldyld",
    28242834                                        "-lcompiler_rt",
    2825                                         "-lsystem_kernel",
    2826                                         "-lsystem_platform",
    2827                                         "-lsystem_pthread",
     2835                                        "-lsystem$(INTERPOSITION_SIM_SUFFIX)_kernel",
     2836                                        "-lsystem$(INTERPOSITION_SIM_SUFFIX)_platform",
     2837                                        "-lsystem$(INTERPOSITION_SIM_SUFFIX)_pthread",
    28282838                                        "-lsystem_malloc",
    28292839                                        "-lsystem_c",
     
    28332843                                        "-lsystem_asl",
    28342844                                );
    2835                                 "OTHER_LDFLAGS[sdk=iphonesimulator*]" = (
    2836                                         "-Wl,-umbrella,System",
    2837                                         "-L/usr/lib/system",
    2838                                         "-ldyld_sim",
    2839                                         "-lcompiler_rt_sim",
    2840                                         "-lsystem_sim_c",
    2841                                         "-lsystem_sim_blocks",
    2842                                         "-ldispatch",
    2843                                         "-Wl,-upward-lSystem",
    2844                                 );
    28452845                                PRODUCT_NAME = libsystem_dnssd_profile;
    2846                                 "PRODUCT_NAME[sdk=iphonesimulator*]" = libsystem_sim_dnssd_profile;
    28472846                        };
    28482847                        name = Development;
     
    28882887                                INSTALLHDRS_COPY_PHASE = YES;
    28892888                                INSTALLHDRS_SCRIPT_PHASE = YES;
    2890                                 INSTALL_PATH_ACTUAL = /usr/lib/system;
     2889                                INSTALL_PATH = /usr/lib/system;
     2890                                INTERPOSITION_SIM_SUFFIX = "";
     2891                                "INTERPOSITION_SIM_SUFFIX[sdk=iphonesimulator*]" = _sim;
    28912892                                LINK_WITH_STANDARD_LIBRARIES = NO;
    28922893                                OTHER_LDFLAGS = (
     
    28952896                                        "-ldyld",
    28962897                                        "-lcompiler_rt",
    2897                                         "-lsystem_kernel",
    2898                                         "-lsystem_platform",
    2899                                         "-lsystem_pthread",
     2898                                        "-lsystem$(INTERPOSITION_SIM_SUFFIX)_kernel",
     2899                                        "-lsystem$(INTERPOSITION_SIM_SUFFIX)_platform",
     2900                                        "-lsystem$(INTERPOSITION_SIM_SUFFIX)_pthread",
    29002901                                        "-lsystem_malloc",
    29012902                                        "-lsystem_c",
     
    29052906                                        "-lsystem_asl",
    29062907                                );
    2907                                 "OTHER_LDFLAGS[sdk=iphonesimulator*]" = (
    2908                                         "-Wl,-umbrella,System",
    2909                                         "-L/usr/lib/system",
    2910                                         "-ldyld_sim",
    2911                                         "-lcompiler_rt_sim",
    2912                                         "-lsystem_sim_c",
    2913                                         "-lsystem_sim_blocks",
    2914                                         "-ldispatch",
    2915                                         "-Wl,-upward-lSystem",
    2916                                 );
    29172908                                PRODUCT_NAME = libsystem_dnssd;
    2918                                 "PRODUCT_NAME[sdk=iphonesimulator*]" = libsystem_sim_dnssd;
    29192909                        };
    29202910                        name = Development;
     
    29872977                        defaultConfigurationName = Development;
    29882978                };
     2979                3F2EAAA11A5B85FF007F5A52 /* Build configuration list for PBXAggregateTarget "Build Deprecated" */ = {
     2980                        isa = XCConfigurationList;
     2981                        buildConfigurations = (
     2982                                3F2EAAA01A5B85FF007F5A52 /* Development */,
     2983                        );
     2984                        defaultConfigurationIsVisible = 0;
     2985                        defaultConfigurationName = Development;
     2986                };
    29892987                4AE471770EAFF84000A6C5AD /* Build configuration list for PBXLegacyTarget "dns_sd.jar" */ = {
    29902988                        isa = XCConfigurationList;
  • mDNSResponder/mDNSPosix/Makefile

    r111789e re36ca10  
    11# -*- tab-width: 4 -*-
    22#
    3 # Copyright (c) 2002-2004, Apple Computer, Inc. All rights reserved.
     3# Copyright (c) 2002-2004, 2015, Apple Computer, Inc. All rights reserved.
    44#
    55# Redistribution and use in source and binary forms, with or without
     
    3131# then try typing "gmake os=xxx" instead.
    3232#
    33 # This Makefile builds an mDNSResponder daemon and a libdns_sd.so shared library 
    34 # for Linux. It also builds several example programs for embedded systems. 
     33# This Makefile builds an mDNSResponder daemon and a libdns_sd.so shared library
     34# for Linux. It also builds several example programs for embedded systems.
    3535#
    3636# Make with no arguments to build all production targets.
     
    5858BISON = @bison
    5959FLEX = @flex
     60ST = @strip
    6061LD = ld -shared
    6162CP = cp
     
    7273DEBUG=0
    7374ifeq ($(DEBUG),1)
    74 CFLAGS_DEBUG = -g -DMDNS_DEBUGMSGS=2 
     75CFLAGS_DEBUG = -g -DMDNS_DEBUGMSGS=2
    7576OBJDIR = objects/debug
    7677BUILDDIR = build/debug
    77 STRIP = echo 
     78STRIP = echo
    7879else
    7980# We use -Os for two reasons:
    8081# 1. We want to make small binaries, suitable for putting into hardware devices
    8182# 2. Some of the code analysis warnings only work when some form of optimization is enabled
    82 CFLAGS_DEBUG = -Os -DMDNS_DEBUGMSGS=0 
     83CFLAGS_DEBUG = -Os -DMDNS_DEBUGMSGS=0
    8384OBJDIR ?= objects/prod
    8485BUILDDIR ?= build/prod
    85 STRIP = strip -S
     86STRIP = $(ST) -S
    8687endif
    8788
     
    9697JAVACFLAGS_OS += -I$(JDK)/include/solaris
    9798ifneq ($(DEBUG),1)
    98 STRIP = strip
     99STRIP = $(ST)
    99100endif
    100101else
     
    103104ifeq ($(findstring linux,$(os)),linux)
    104105CFLAGS_OS = -D_GNU_SOURCE -DHAVE_IPV6 -DNOT_HAVE_SA_LEN -DUSES_NETLINK -DHAVE_LINUX -DTARGET_OS_LINUX -fno-strict-aliasing
    105 LD = gcc -shared
     106LD = $(CC) -shared
    106107FLEXFLAGS_OS = -l
    107108JAVACFLAGS_OS += -I$(JDK)/include/linux
     
    152153LDSUFFIX = dylib
    153154JDK = /System/Library/Frameworks/JavaVM.framework/Home
    154 JAVACFLAGS_OS = -dynamiclib -I/System/Library/Frameworks/JavaVM.framework/Headers -framework JavaVM 
     155JAVACFLAGS_OS = -dynamiclib -I/System/Library/Frameworks/JavaVM.framework/Headers -framework JavaVM
    155156else
    156157
    157158$(error ERROR: Must specify target OS on command-line, e.g. "make os=x [target]".\
    158 Supported operating systems include: x, linux, linux-uclibc, netbsd, freebsd, openbsd, solaris) 
     159Supported operating systems include: x, linux, linux-uclibc, netbsd, freebsd, openbsd, solaris)
    159160endif
    160161endif
  • mDNSResponder/mDNSPosix/NetMonitor.c

    r111789e re36ca10  
    121121static FilterList *Filters;
    122122#define ExactlyOneFilter (Filters && !Filters->next)
     123static mDNSBool AddressType = mDNSAddrType_IPv4;
    123124
    124125static int NumPktQ, NumPktL, NumPktR, NumPktB;  // Query/Legacy/Response/Bad
     
    465466mDNSlocal void DisplayPacketHeader(mDNS *const m, const DNSMessage *const msg, const mDNSu8 *const end, const mDNSAddr *srcaddr, mDNSIPPort srcport, const mDNSAddr *dstaddr, const mDNSInterfaceID InterfaceID)
    466467{
    467     const char *const ptype =   (msg->h.flags.b[0] & kDNSFlag0_QR_Response)             ? "-R- " :
     468    const char *const ptype = (msg->h.flags.b[0] & kDNSFlag0_QR_Response)             ? "-R- " :
    468469                              (srcport.NotAnInteger == MulticastDNSPort.NotAnInteger) ? "-Q- " : "-LQ-";
    469 
     470    const unsigned length = end - (mDNSu8 *)msg;
    470471    struct timeval tv;
    471472    struct tm tm;
     
    478479
    479480    mprintf("%#-16a %s             Q:%3d  Ans:%3d  Auth:%3d  Add:%3d  Size:%5d bytes",
    480             srcaddr, ptype, msg->h.numQuestions, msg->h.numAnswers, msg->h.numAuthorities, msg->h.numAdditionals, end - (mDNSu8 *)msg);
     481            srcaddr, ptype, msg->h.numQuestions, msg->h.numAnswers, msg->h.numAuthorities, msg->h.numAdditionals, length);
    481482
    482483    if (msg->h.id.NotAnInteger) mprintf("  ID:%u", mDNSVal16(msg->h.id));
     
    489490        else mprintf("   Truncated (KA list continues in next packet)");
    490491    }
     492
    491493    mprintf("\n");
     494
     495    if (length < sizeof(DNSMessageHeader) + NormalMaxDNSMessageData - 192)
     496        if (msg->h.flags.b[0] & kDNSFlag0_TC)
     497            mprintf("%#-16a **** WARNING: Packet suspiciously small. Payload size (excluding IP and UDP headers)\n"
     498                    "%#-16a **** should usually be closer to %d bytes before truncation becomes necessary.\n",
     499                    srcaddr, srcaddr, sizeof(DNSMessageHeader) + NormalMaxDNSMessageData);
     500}
     501
     502mDNSlocal void DisplaySizeCheck(const DNSMessage *const msg, const mDNSu8 *const end, const mDNSAddr *srcaddr, int num_opts)
     503{
     504    const unsigned length = end - (mDNSu8 *)msg;
     505    const int num_records = msg->h.numAnswers + msg->h.numAuthorities + msg->h.numAdditionals - num_opts;
     506
     507    if (length > sizeof(DNSMessageHeader) + NormalMaxDNSMessageData)
     508        if (num_records > 1)
     509            mprintf("%#-16a **** ERROR: Oversized packet with %d records.\n"
     510                    "%#-16a **** Many network devices cannot receive packets larger than %d bytes.\n"
     511                    "%#-16a **** To minimize interoperability failures, oversized packets MUST be limited to a single resource record.\n",
     512                    srcaddr, num_records, srcaddr, 40 + 8 + sizeof(DNSMessageHeader) + NormalMaxDNSMessageData, srcaddr);
    492513}
    493514
     
    595616mDNSlocal void DisplayError(const mDNSAddr *srcaddr, const mDNSu8 *ptr, const mDNSu8 *const end, char *msg)
    596617{
    597     mprintf("%#-16a **** ERROR: FAILED TO READ %s **** \n", srcaddr, msg);
     618    mprintf("%#-16a **** ERROR: FAILED TO READ %s ****\n", srcaddr, msg);
    598619    HexDump(ptr, end);
    599620}
     
    603624{
    604625    int i;
     626    int num_opts = 0;
    605627    const mDNSu8 *ptr = msg->data;
    606628    const mDNSu8 *auth = LocateAuthorities(msg, end);
     
    612634    if (msg->h.id.NotAnInteger != 0xFFFF)
    613635    {
    614         if (MQ) NumPktQ++;else NumPktL++;
     636        if (MQ) NumPktQ++; else NumPktL++;
    615637    }
    616638
     
    649671        if (!ptr) { DisplayError(srcaddr, ep, end, "KNOWN ANSWER"); return; }
    650672        DisplayResourceRecord(srcaddr, "(KA)", &pkt.r.resrec);
     673        if (pkt.r.resrec.rrtype == kDNSType_OPT)
     674            { num_opts++; mprintf("%#-16a **** ERROR: OPT RECORD IN ANSWER SECTION ****\n", srcaddr); }
    651675
    652676        // In the case of queries with long multi-packet KA lists, we count each subsequent KA packet
     
    665689        // If any remain that haven't been zero'd out, display them here
    666690        if (pkt.r.resrec.rrtype || pkt.r.resrec.rrclass) DisplayResourceRecord(srcaddr, "(AU)", &pkt.r.resrec);
     691        if (pkt.r.resrec.rrtype == kDNSType_OPT)
     692            { num_opts++; mprintf("%#-16a **** ERROR: OPT RECORD IN AUTHORITY SECTION ****\n", srcaddr); }
    667693    }
    668694
     
    673699        if (!ptr) { DisplayError(srcaddr, ep, end, "ADDITIONAL"); return; }
    674700        DisplayResourceRecord(srcaddr, pkt.r.resrec.rrtype == kDNSType_OPT ? "(OP)" : "(AD)", &pkt.r.resrec);
    675     }
     701        if (pkt.r.resrec.rrtype == kDNSType_OPT) num_opts++;
     702    }
     703
     704    DisplaySizeCheck(msg, end, srcaddr, num_opts);
     705
     706    // We don't hexdump the DNSMessageHeader here because those six fields (id, flags, numQuestions, numAnswers, numAuthorities, numAdditionals)
     707    // have already been swapped to host byte order and displayed, so including them in the hexdump is confusing
     708    if (num_opts > 1) { mprintf("%#-16a **** ERROR: MULTIPLE OPT RECORDS ****\n", srcaddr); HexDump(msg->data, end); }
    676709
    677710    if (entry) AnalyseHost(m, entry, InterfaceID);
     
    682715{
    683716    int i;
     717    int num_opts = 0;
    684718    const mDNSu8 *ptr = msg->data;
    685719    HostEntry *entry = GotPacketFromHost(srcaddr, HostPkt_R, msg->h.id);
     
    719753            recordstat(entry, pkt.r.resrec.name, OP_goodbye, pkt.r.resrec.rrtype);
    720754        }
     755        if (pkt.r.resrec.rrtype == kDNSType_OPT)
     756            { num_opts++; mprintf("%#-16a **** ERROR: OPT RECORD IN ANSWER SECTION ****\n", srcaddr); }
    721757    }
    722758
     
    726762        ptr = GetLargeResourceRecord(m, msg, ptr, end, InterfaceID, kDNSRecordTypePacketAuth, &pkt);
    727763        if (!ptr) { DisplayError(srcaddr, ep, end, "AUTHORITY"); return; }
    728         if (pkt.r.resrec.rrtype != kDNSType_NSEC3)
     764        DisplayResourceRecord(srcaddr, "(AU)", &pkt.r.resrec);
     765        if (pkt.r.resrec.rrtype == kDNSType_OPT)
     766            { num_opts++; mprintf("%#-16a **** ERROR: OPT RECORD IN AUTHORITY SECTION ****\n", srcaddr); }
     767        else if (pkt.r.resrec.rrtype != kDNSType_NSEC3)
    729768            mprintf("%#-16a (?)  **** ERROR: SHOULD NOT HAVE AUTHORITY IN mDNS RESPONSE **** %-5s %##s\n",
    730                     srcaddr, DNSTypeName(pkt.r.resrec.rrtype), pkt.r.resrec.name->c);
     769                srcaddr, DNSTypeName(pkt.r.resrec.rrtype), pkt.r.resrec.name->c);
    731770    }
    732771
     
    737776        if (!ptr) { DisplayError(srcaddr, ep, end, "ADDITIONAL"); return; }
    738777        NumAdditionals++;
     778        if (pkt.r.resrec.rrtype == kDNSType_OPT) num_opts++;
    739779        DisplayResourceRecord(srcaddr,
    740780                              pkt.r.resrec.rrtype == kDNSType_OPT ? "(OP)" : (pkt.r.resrec.RecordType & kDNSRecordTypePacketUniqueMask) ? "(AD)" : "(AD+)",
     
    743783    }
    744784
     785    DisplaySizeCheck(msg, end, srcaddr, num_opts);
     786
     787    // We don't hexdump the DNSMessageHeader here because those six fields (id, flags, numQuestions, numAnswers, numAuthorities, numAdditionals)
     788    // have already been swapped to host byte order and displayed, so including them in the hexdump is confusing
     789    if (num_opts > 1) { mprintf("%#-16a **** ERROR: MULTIPLE OPT RECORDS ****\n", srcaddr); HexDump(msg->data, end); }
     790
    745791    if (entry) AnalyseHost(m, entry, InterfaceID);
    746792}
     
    764810{
    765811    FilterList *f;
    766     if (!Filters) return(srcaddr->type == mDNSAddrType_IPv4);
     812    if (!Filters) return(srcaddr->type == AddressType);
    767813    for (f=Filters; f; f=f->next) if (mDNSSameAddress(srcaddr, &f->FilterAddr)) return(mDNStrue);
    768814    return(mDNSfalse);
     
    931977        {
    932978            FilterInterface = atoi(argv[i+1]);
    933             i += 2;
     979            i += 1;
    934980            printf("Monitoring interface %d\n", FilterInterface);
     981        }
     982        else if (!strcmp(argv[i], "-6"))
     983        {
     984            AddressType = mDNSAddrType_IPv6;
     985            printf("Monitoring IPv6 traffic\n");
    935986        }
    936987        else
  • mDNSResponder/mDNSPosix/mDNSPosix.c

    r111789e re36ca10  
    9090static sigset_t gEventSignalSet;                // Signals which event loop listens for
    9191static sigset_t gEventSignals;                  // Signals which were received while inside loop
     92
     93static PosixNetworkInterface *gRecentInterfaces;
    9294
    9395// ***************************************************************************
     
    575577        intf = (PosixNetworkInterface *)(intf->coreIntf.next);
    576578
     579    if (intf) return intf->index;
     580
     581    // If we didn't find the interface, check the RecentInterfaces list as well
     582    intf = gRecentInterfaces;
     583    while ((intf != NULL) && (mDNSInterfaceID) intf != id)
     584        intf = (PosixNetworkInterface *)(intf->coreIntf.next);
     585
    577586    return intf ? intf->index : 0;
    578587}
     
    588597    if (intf->multicastSocket6 != -1) assert(close(intf->multicastSocket6) == 0);
    589598#endif
    590     free(intf);
     599
     600    // Move interface to the RecentInterfaces list for a minute
     601    intf->LastSeen = mDNSPlatformUTC();
     602    intf->coreIntf.next = &gRecentInterfaces->coreIntf;
     603    gRecentInterfaces = intf;
    591604}
    592605
     
    644657        #endif
    645658        if (err < 0) { err = errno; perror("setsockopt - SO_REUSExxxx"); }
     659
     660        // Enable inbound packets on IFEF_AWDL interface.
     661        // Only done for multicast sockets, since we don't expect unicast socket operations
     662        // on the IFEF_AWDL interface. Operation is a no-op for other interface types.
     663        #ifndef SO_RECV_ANYIF
     664        #define SO_RECV_ANYIF   0x1104      /* unrestricted inbound processing */
     665        #endif
     666        if (setsockopt(*sktPtr, SOL_SOCKET, SO_RECV_ANYIF, &kOn, sizeof(kOn)) < 0) perror("setsockopt - SO_RECV_ANYIF");
    646667    }
    647668
     
    9791000    // Clean up.
    9801001    if (intfList != NULL) free_ifi_info(intfList);
     1002
     1003    // Clean up any interfaces that have been hanging around on the RecentInterfaces list for more than a minute
     1004    PosixNetworkInterface **ri = &gRecentInterfaces;
     1005    const mDNSs32 utc = mDNSPlatformUTC();
     1006    while (*ri)
     1007    {
     1008        PosixNetworkInterface *pi = *ri;
     1009        if (utc - pi->LastSeen < 60) ri = (PosixNetworkInterface **)&pi->coreIntf.next;
     1010        else { *ri = (PosixNetworkInterface *)pi->coreIntf.next; free(pi); }
     1011    }
     1012
    9811013    return err;
    9821014}
     
    13191351}
    13201352
     1353// This is used internally by InterfaceChangeCallback.
     1354// It's also exported so that the Standalone Responder (mDNSResponderPosix)
     1355// can call it in response to a SIGHUP (mainly for debugging purposes).
    13211356mDNSexport mStatus mDNSPlatformPosixRefreshInterfaceList(mDNS *const m)
    13221357{
    13231358    int err;
     1359    // This is a pretty heavyweight way to process interface changes --
     1360    // destroying the entire interface list and then making fresh one from scratch.
     1361    // We should make it like the OS X version, which leaves unchanged interfaces alone.
    13241362    ClearInterfaceList(m);
    13251363    err = SetupInterfaceList(m);
  • mDNSResponder/mDNSPosix/mDNSPosix.h

    r111789e re36ca10  
    3939struct PosixNetworkInterface
    4040{
    41     NetworkInterfaceInfo coreIntf;
     41    NetworkInterfaceInfo coreIntf;              // MUST be the first element in this structure
     42    mDNSs32 LastSeen;
    4243    const char *            intfName;
    4344    PosixNetworkInterface * aliasIntf;
  • mDNSResponder/mDNSShared/dns_sd.h

    r111789e re36ca10  
    6767
    6868#ifndef _DNS_SD_H
    69 #define _DNS_SD_H 5610101
     69#define _DNS_SD_H 5670000
    7070
    7171#ifdef  __cplusplus
     
    19621962);
    19631963
    1964 
    19651964/*********************************************************************************************
    19661965*
  • mDNSResponder/mDNSShared/dnssd_clientshim.c

    r111789e re36ca10  
    818818}
    819819
    820 
    821820#endif  // !MDNS_BUILDINGSTUBLIBRARY
  • mDNSResponder/mDNSShared/dnssd_clientstub.c

    r111789e re36ca10  
    11131113            // provides extra protection.
    11141114            sdRef->ProcessReply = NULL;
     1115            shutdown(sdRef->sockfd, SHUT_WR);
    11151116            dispatch_source_cancel(sdRef->disp_source);
    11161117            dispatch_release(sdRef->disp_source);
     
    20932094}
    20942095
    2095 
    20962096static void handle_port_mapping_response(DNSServiceOp *const sdr, const CallbackHeader *const cbh, const char *data, const char *const end)
    20972097{
Note: See TracChangeset for help on using the changeset viewer.