Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/apache2/mDNSResponder merge conflicts; also:



details:   https://anonhg.NetBSD.org/src/rev/5a6dd7f05756
branches:  trunk
changeset: 830099:5a6dd7f05756
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Feb 25 20:04:55 2018 +0000

description:
merge conflicts; also:
- Do the reuse-port first like MacOS/X otherwise we can't bind
- Disable SO_RECV_ANYIF hack

diffstat:

 external/apache2/mDNSResponder/dist/mDNSCore/mDNS.c            |  15 +++++++--
 external/apache2/mDNSResponder/dist/mDNSCore/mDNSEmbeddedAPI.h |   6 ++--
 external/apache2/mDNSResponder/dist/mDNSCore/uDNS.c            |  15 ++++++++-
 external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c      |   4 ++-
 external/apache2/mDNSResponder/dist/mDNSShared/dns_sd.h        |   2 +-
 external/apache2/mDNSResponder/prepare-import.sh               |   6 ++--
 6 files changed, 34 insertions(+), 14 deletions(-)

diffs (186 lines):

diff -r 0b842e6bfd63 -r 5a6dd7f05756 external/apache2/mDNSResponder/dist/mDNSCore/mDNS.c
--- a/external/apache2/mDNSResponder/dist/mDNSCore/mDNS.c       Sun Feb 25 19:25:33 2018 +0000
+++ b/external/apache2/mDNSResponder/dist/mDNSCore/mDNS.c       Sun Feb 25 20:04:55 2018 +0000
@@ -1,6 +1,6 @@
 /* -*- Mode: C; tab-width: 4 -*-
  *
- * Copyright (c) 2002-2015 Apple Inc. All rights reserved.
+ * Copyright (c) 2002-2017 Apple Inc. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -4172,12 +4172,12 @@
                 responseLatencyMs = 0;
             }
 
-            MetricsUpdateUDNSQueryStats(queryName, q->qtype, &rr->resrec, q->metrics.querySendCount, responseLatencyMs, isForCellular);
+            MetricsUpdateDNSQueryStats(queryName, q->qtype, &rr->resrec, q->metrics.querySendCount, responseLatencyMs, isForCellular);
             q->metrics.answered = mDNStrue;
         }
         if (q->metrics.querySendCount > 0)
         {
-            MetricsUpdateUDNSResolveStats(queryName, &rr->resrec, isForCellular);
+            MetricsUpdateDNSResolveStats(queryName, &rr->resrec, isForCellular);
         }
     }
 #endif
@@ -8946,6 +8946,13 @@
            response->h.numAuthorities, response->h.numAuthorities == 1 ? "y,  " : "ies,",
            response->h.numAdditionals, response->h.numAdditionals == 1 ? " "    : "s", end - response->data, LLQType);
 
+#if AWD_METRICS
+    if (mDNSSameIPPort(srcport, UnicastDNSPort))
+    {
+        MetricsUpdateDNSResponseSize((mDNSu32)(end - (mDNSu8 *)response));
+    }
+#endif
+
     // According to RFC 2181 <http://www.ietf.org/rfc/rfc2181.txt>
     //    When a DNS client receives a reply with TC
     //    set, it should ignore that response, and query again, using a
@@ -12129,7 +12136,7 @@
         queryName  = question->metrics.originalQName ? question->metrics.originalQName : &question->qname;
         isForCell  = (question->qDNSServer && question->qDNSServer->cellIntf);
         durationMs = ((m->timenow - question->metrics.firstQueryTime) * 1000) / mDNSPlatformOneSecond;
-        MetricsUpdateUDNSQueryStats(queryName, question->qtype, mDNSNULL, question->metrics.querySendCount, durationMs, isForCell);
+        MetricsUpdateDNSQueryStats(queryName, question->qtype, mDNSNULL, question->metrics.querySendCount, durationMs, isForCell);
     }
 #endif
     // Take care to cut question from list *before* calling UpdateQuestionDuplicates
diff -r 0b842e6bfd63 -r 5a6dd7f05756 external/apache2/mDNSResponder/dist/mDNSCore/mDNSEmbeddedAPI.h
--- a/external/apache2/mDNSResponder/dist/mDNSCore/mDNSEmbeddedAPI.h    Sun Feb 25 19:25:33 2018 +0000
+++ b/external/apache2/mDNSResponder/dist/mDNSCore/mDNSEmbeddedAPI.h    Sun Feb 25 20:04:55 2018 +0000
@@ -1,6 +1,6 @@
 /* -*- Mode: C; tab-width: 4 -*-
  *
- * Copyright (c) 2002-2015 Apple Inc. All rights reserved.
+ * Copyright (c) 2002-2017 Apple Inc. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -1896,7 +1896,7 @@
 // RFC 4122 defines it to be 16 bytes 
 #define UUID_SIZE       16
 
-#define AWD_METRICS (USE_AWD && TARGET_OS_EMBEDDED)
+#define AWD_METRICS (USE_AWD && TARGET_OS_IOS)
 
 #if AWD_METRICS
 typedef struct
@@ -2039,7 +2039,7 @@
     domainname           *qnameOrig;        // Copy of the original question name if it is not fully qualified
     mDNSQuestionCallback *QuestionCallback;
     void                 *QuestionContext;
-#if TARGET_OS_EMBEDDED
+#if AWD_METRICS
     uDNSMetrics metrics;                    // Data used for collecting unicast DNS query metrics.
 #endif
 #if USE_DNS64
diff -r 0b842e6bfd63 -r 5a6dd7f05756 external/apache2/mDNSResponder/dist/mDNSCore/uDNS.c
--- a/external/apache2/mDNSResponder/dist/mDNSCore/uDNS.c       Sun Feb 25 19:25:33 2018 +0000
+++ b/external/apache2/mDNSResponder/dist/mDNSCore/uDNS.c       Sun Feb 25 20:04:55 2018 +0000
@@ -1,6 +1,6 @@
 /* -*- Mode: C; tab-width: 4 -*-
  *
- * Copyright (c) 2002-2015 Apple Inc. All rights reserved.
+ * Copyright (c) 2002-2017 Apple Inc. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -25,6 +25,10 @@
 #endif
 #include "uDNS.h"
 
+#if AWD_METRICS
+#include "Metrics.h"
+#endif
+
 #if (defined(_MSC_VER))
 // Disable "assignment within conditional expression".
 // Other compilers understand the convention that if you place the assignment expression within an extra pair
@@ -1329,6 +1333,12 @@
 
         err = mDNSSendDNSMessage(m, &tcpInfo->request, end, mDNSInterface_Any, mDNSNULL, &tcpInfo->Addr, tcpInfo->Port, sock, AuthInfo, mDNSfalse);
         if (err) { debugf("ERROR: tcpCallback: mDNSSendDNSMessage - %d", err); err = mStatus_UnknownErr; goto exit; }
+#if AWD_METRICS
+        if (mDNSSameIPPort(tcpInfo->Port, UnicastDNSPort))
+        {
+            MetricsUpdateDNSQuerySize((mDNSu32)(end - (mDNSu8 *)&tcpInfo->request));
+        }
+#endif
 
         // Record time we sent this question
         if (q)
@@ -4758,9 +4768,10 @@
                     else
                     {
                         err = mDNSSendDNSMessage(m, &m->omsg, end, q->qDNSServer->interface, q->LocalSocket, &q->qDNSServer->addr, q->qDNSServer->port, mDNSNULL, mDNSNULL, 
q->UseBackgroundTrafficClass);
-#if TARGET_OS_EMBEDDED
+#if AWD_METRICS
                         if (!err)
                         {
+                            MetricsUpdateDNSQuerySize((mDNSu32)(end - (mDNSu8 *)&m->omsg));
                             if (q->metrics.answered)
                             {
                                 q->metrics.querySendCount = 0;
diff -r 0b842e6bfd63 -r 5a6dd7f05756 external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c
--- a/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c Sun Feb 25 19:25:33 2018 +0000
+++ b/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c Sun Feb 25 20:04:55 2018 +0000
@@ -657,7 +657,7 @@
         // to bind to the socket. Our suggestion was to switch the order in which
         // SO_REUSEPORT and SO_REUSEADDR was tested so that SO_REUSEADDR stays on
         // top and SO_REUSEPORT to be used only if SO_REUSEADDR doesn't exist.
-        #if defined(SO_REUSEADDR) && !defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
+        #if defined(SO_REUSEADDR) && !defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && !defined(__NetBSD__)
         err = setsockopt(*sktPtr, SOL_SOCKET, SO_REUSEADDR, &kOn, sizeof(kOn));
         #elif defined(SO_REUSEPORT)
         err = setsockopt(*sktPtr, SOL_SOCKET, SO_REUSEPORT, &kOn, sizeof(kOn));
@@ -666,6 +666,7 @@
         #endif
         if (err < 0) { err = errno; perror("setsockopt - SO_REUSExxxx"); }
 
+#ifndef __NetBSD__
         // 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.
@@ -673,6 +674,7 @@
         #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");
+#endif
     }
 
     // We want to receive destination addresses and interface identifiers.
diff -r 0b842e6bfd63 -r 5a6dd7f05756 external/apache2/mDNSResponder/dist/mDNSShared/dns_sd.h
--- a/external/apache2/mDNSResponder/dist/mDNSShared/dns_sd.h   Sun Feb 25 19:25:33 2018 +0000
+++ b/external/apache2/mDNSResponder/dist/mDNSShared/dns_sd.h   Sun Feb 25 20:04:55 2018 +0000
@@ -66,7 +66,7 @@
  */
 
 #ifndef _DNS_SD_H
-#define _DNS_SD_H 8780101
+#define _DNS_SD_H 8783004
 
 #ifdef  __cplusplus
 extern "C" {
diff -r 0b842e6bfd63 -r 5a6dd7f05756 external/apache2/mDNSResponder/prepare-import.sh
--- a/external/apache2/mDNSResponder/prepare-import.sh  Sun Feb 25 19:25:33 2018 +0000
+++ b/external/apache2/mDNSResponder/prepare-import.sh  Sun Feb 25 20:04:55 2018 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: prepare-import.sh,v 1.4 2018/01/14 22:51:12 christos Exp $
+# $NetBSD: prepare-import.sh,v 1.5 2018/02/25 20:04:55 christos Exp $
 #
 # Extract the new tarball and run this script with the first argument
 # the mDNSResponder-X.Y directory that was created. cd to that directory
@@ -10,8 +10,8 @@
 
 set -e
 cd "$1"
-rm -rf mDNSMacOS9 mDNSMacOSX mDNSVxWorks mDNSWindows
-rm -f Makefile mDNSResponder.sln README.txt PrivateDNS.txt Documents
+rm -rf mDNSMacOS9 mDNSMacOSX mDNSVxWorks mDNSWindows Documents
+rm -f Makefile mDNSResponder.sln README.txt PrivateDNS.txt
 
 (cd Clients
 rm -rf BonjourExample DNS-SD.VisualStudio DNS-SD.xcodeproj



Home | Main Index | Thread Index | Old Index