mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2025-07-19 15:29:08 +02:00

Apple's default implementation of the Posix backend for mDNSResponder has a number of weaknesses. Address several of them, most notably: * Improve interface tracking, preventing confusion to mdns's state machine. Prevents spurious removal/republication cycles whenever network interfaces are added or removed. * Support network interfaces whose indeces are great than 31. Indices grow past that range surprisingly quickly, especially with multi- homed, mobile, wifi, Bluetooth, VPN, VLANs, or other interfaces present. * Correctly handle edge cases during removal of a network interface. The fixes are kept as a patch series for clarity. Signed-off-by: Matt Hoosier <matt.hoosier@garmin.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
52 lines
1.6 KiB
Diff
52 lines
1.6 KiB
Diff
From 157d67f152777754c059ced7511352102f23ffae Mon Sep 17 00:00:00 2001
|
|
From: Nate Karstens <nate.karstens@garmin.com>
|
|
Date: Mon, 24 Jul 2017 09:39:18 -0500
|
|
Subject: [PATCH 06/11] Remove unneeded function
|
|
|
|
Removes a function we no longer need by integrating it into the only
|
|
function that calls it. This was originally separated so that we could
|
|
only process network interfaces that netlink indicated had been changed,
|
|
this has since been extended to test for all network intefaces.
|
|
|
|
Upstream-Status: Submitted [dts@apple.com]
|
|
|
|
Signed-off-by: Nate Karstens <nate.karstens@garmin.com>
|
|
---
|
|
mDNSPosix/mDNSPosix.c | 13 ++-----------
|
|
1 file changed, 2 insertions(+), 11 deletions(-)
|
|
|
|
diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c
|
|
index 59a8b8c..3fc5451 100644
|
|
--- a/mDNSPosix/mDNSPosix.c
|
|
+++ b/mDNSPosix/mDNSPosix.c
|
|
@@ -1079,24 +1079,15 @@ mDNSlocal mStatus OpenIfNotifySocket(int *pFD)
|
|
return err;
|
|
}
|
|
|
|
-mDNSlocal mDNSBool ListContainsInterfaceIndex(GenLinkedList *list, int if_index)
|
|
+mDNSlocal void AddInterfaceIndexToList(GenLinkedList *list, int if_index)
|
|
{
|
|
NetworkInterfaceIndex *item;
|
|
|
|
for (item = (NetworkInterfaceIndex*)list->Head; item != NULL; item = item->Next)
|
|
{
|
|
- if (if_index == item->if_index) return mDNStrue;
|
|
+ if (if_index == item->if_index) return;
|
|
}
|
|
|
|
- return mDNSfalse;
|
|
-}
|
|
-
|
|
-mDNSlocal void AddInterfaceIndexToList(GenLinkedList *list, int if_index)
|
|
-{
|
|
- NetworkInterfaceIndex *item;
|
|
-
|
|
- if (ListContainsInterfaceIndex(list, if_index)) return;
|
|
-
|
|
item = malloc(sizeof *item);
|
|
if (item == NULL) return;
|
|
|
|
--
|
|
2.17.1
|
|
|