[rtems-libbsd commit] mDNSResponder: Fix for update to v765.1.2

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Oct 17 05:01:15 UTC 2018


On 17/10/2018 00:43, Chris Johns wrote:
> On 16/10/2018 22:29, Sebastian Huber wrote:
>> Module:    rtems-libbsd
>> Branch:    master
>> Commit:    c464b9e40478aeaf2691141952e553b31990cd8e
>> Changeset:http://git.rtems.org/rtems-libbsd/commit/?id=c464b9e40478aeaf2691141952e553b31990cd8e
>>
>> Author:    Sebastian Huber<sebastian.huber at embedded-brains.de>
>> Date:      Tue Oct 16 12:54:08 2018 +0200
>>
>> mDNSResponder: Fix for update to v765.1.2
>>
>> In the update to v765.1.2 the mDNS_Init() changed the initialization of
>> m->AutoTargetServices from 1 to 0.  The motivation for this change is
>> unclear.  This change prevents at least the mDNS hostname lookups.
>> Revert this change and initialize m->AutoTargetServices to 1 like it was
>> before the update.
>>
> I am no sure about this change, I feel it points to something else that may be
> missing or broken. It is OK going into our repo as is but I am concerned about
> our version becoming brittle over time with these types of changes.

Do you know why Apple changed it like this in v765.1.2?

diff --git a/mDNSResponder/mDNSCore/mDNS.c b/mDNSResponder/mDNSCore/mDNS.c
index 6b02be46c..d1841a5ee 100755
--- a/mDNSResponder/mDNSCore/mDNS.c
+++ b/mDNSResponder/mDNSCore/mDNS.c
@@ -14334,19 +14466,11 @@ mDNSexport mStatus mDNS_Init(mDNS *const m, 
mDNS_PlatformSupport *const p,
      m->WABBrowseQueriesCount    = 0;
      m->WABLBrowseQueriesCount   = 0;
      m->WABRegQueriesCount       = 0;
-#if TARGET_OS_EMBEDDED || TARGET_OS_WATCH
      m->AutoTargetServices       = 0;
-#else
-    m->AutoTargetServices       = 1;
-#endif
-#if TARGET_OS_WATCH
+
+#if BONJOUR_ON_DEMAND
      m->NumAllInterfaceRecords   = 0;
      m->NumAllInterfaceQuestions = 0;
-#else
-    // Initialize to 1 for these targets to prevent not joining 
multicast group for interfaces when
-    // both of these values are zero.
-    m->NumAllInterfaceRecords   = 1;
-    m->NumAllInterfaceQuestions = 1;
  #endif
      // NAT traversal fields
      m->LLQNAT.clientCallback    = mDNSNULL;

I don't know it. All I know is that the mDNS name resolution no longer 
worked with this change. I took me about six hours of debugging to 
figure this out. You can use the foobarserver and foobarclient to test it.

>
> Does the mDNSResponder service work on a standard FreeBSD install with the 0 value?

Is this code used by FreeBSD at all? I guess they use avahi:

https://www.freebsd.org/cgi/man.cgi?query=avahi-daemon&apropos=0&sektion=8&manpath=FreeBSD+11.2-RELEASE+and+Ports&arch=default&format=html

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.




More information about the devel mailing list