aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-protocols/mdns/files
diff options
context:
space:
mode:
Diffstat (limited to 'meta-networking/recipes-protocols/mdns/files')
-rw-r--r--meta-networking/recipes-protocols/mdns/files/0001-Create-subroutine-for-cleaning-recent-interfaces.patch59
-rw-r--r--meta-networking/recipes-protocols/mdns/files/0001-mdns-include-stddef.h-for-NULL.patch40
-rw-r--r--meta-networking/recipes-protocols/mdns/files/0002-Create-subroutine-for-tearing-down-an-interface.patch58
-rw-r--r--meta-networking/recipes-protocols/mdns/files/0002-mdns-cross-compilation-fixes-for-bitbake.patch145
-rw-r--r--meta-networking/recipes-protocols/mdns/files/0003-Track-interface-socket-family.patch50
-rw-r--r--meta-networking/recipes-protocols/mdns/files/0004-Use-list-for-changed-interfaces.patch177
-rw-r--r--meta-networking/recipes-protocols/mdns/files/0006-Remove-unneeded-function.patch51
-rw-r--r--meta-networking/recipes-protocols/mdns/files/0008-Mark-deleted-interfaces-as-being-changed.patch39
-rw-r--r--meta-networking/recipes-protocols/mdns/files/0009-Fix-possible-NULL-dereference.patch45
-rw-r--r--meta-networking/recipes-protocols/mdns/files/0010-Handle-errors-from-socket-calls.patch62
-rw-r--r--meta-networking/recipes-protocols/mdns/files/0011-Change-a-dynamic-allocation-to-file-scope-variable.patch53
-rw-r--r--meta-networking/recipes-protocols/mdns/files/mdns.service15
12 files changed, 0 insertions, 794 deletions
diff --git a/meta-networking/recipes-protocols/mdns/files/0001-Create-subroutine-for-cleaning-recent-interfaces.patch b/meta-networking/recipes-protocols/mdns/files/0001-Create-subroutine-for-cleaning-recent-interfaces.patch
deleted file mode 100644
index f8efc10448..0000000000
--- a/meta-networking/recipes-protocols/mdns/files/0001-Create-subroutine-for-cleaning-recent-interfaces.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 6d90f9fdaf008f5c3b8fd8d91594fa1461437888 Mon Sep 17 00:00:00 2001
-From: Nate Karstens <nate.karstens@garmin.com>
-Date: Wed, 28 Jun 2017 17:30:00 -0500
-Subject: [PATCH] Create subroutine for cleaning recent interfaces
-
-Moves functionality for cleaning the list of recent
-interfaces into its own subroutine.
-
-Upstream-Status: Submitted [dts@apple.com]
-
-Signed-off-by: Nate Karstens <nate.karstens@garmin.com>
----
- mDNSPosix/mDNSPosix.c | 23 ++++++++++++++---------
- 1 file changed, 14 insertions(+), 9 deletions(-)
-
-diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c
-index a63cd19..7aeee7b 100755
---- a/mDNSPosix/mDNSPosix.c
-+++ b/mDNSPosix/mDNSPosix.c
-@@ -1199,6 +1199,19 @@ mDNSlocal int SetupSocket(struct sockaddr *intfAddr, mDNSIPPort port, int interf
- return err;
- }
-
-+// Clean up any interfaces that have been hanging around on the RecentInterfaces list for more than a minute
-+mDNSlocal void CleanRecentInterfaces(void)
-+{
-+ 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); }
-+ }
-+}
-+
- // Creates a PosixNetworkInterface for the interface whose IP address is
- // intfAddr and whose name is intfName and registers it with mDNS core.
- mDNSlocal int SetupOneInterface(mDNS *const m, struct sockaddr *intfAddr, struct sockaddr *intfMask, const char *intfName, int intfIndex)
-@@ -1388,15 +1401,7 @@ mDNSlocal int SetupInterfaceList(mDNS *const m)
- // Clean up.
- if (intfList != NULL) freeifaddrs(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); }
-- }
-+ CleanRecentInterfaces();
-
- return err;
- }
---
-2.20.1
-
diff --git a/meta-networking/recipes-protocols/mdns/files/0001-mdns-include-stddef.h-for-NULL.patch b/meta-networking/recipes-protocols/mdns/files/0001-mdns-include-stddef.h-for-NULL.patch
deleted file mode 100644
index c57ce8fa53..0000000000
--- a/meta-networking/recipes-protocols/mdns/files/0001-mdns-include-stddef.h-for-NULL.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From d744609c56f9872e5aa71707f1f71feec9867f51 Mon Sep 17 00:00:00 2001
-From: Mikko Rapeli <mikko.rapeli@bmw.de>
-Date: Tue, 14 Jul 2020 16:36:29 +0000
-Subject: [PATCH 1/2] mdns: include <stddef.h> for NULL
-
-Fixes build error with version 1096.40.7:
-
-../mDNSCore/mDNS.c:11385:26: error: 'NULL' undeclared (first use in this function)
-11385 | const char *reason = NULL;
- | ^~~~
-../mDNSCore/mDNS.c:56:1: note: 'NULL' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
- 55 | #include "dns_sd_internal.h"
- +++ |+#include <stddef.h>
- 56 |
-../mDNSCore/mDNS.c:11385:26: note: each undeclared identifier is reported only once for each function it appears in
-11385 | const char *reason = NULL;
- | ^~~~
-
-Upstream-Status: Pending
-
-Signed-off-by: Mikko Rapeli <mikko.rapeli@bmw.de>
----
- mDNSCore/mDNS.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/mDNSCore/mDNS.c b/mDNSCore/mDNS.c
-index 2fbea04..d4b9af5 100755
---- a/mDNSCore/mDNS.c
-+++ b/mDNSCore/mDNS.c
-@@ -23,6 +23,7 @@
- * routines, or types (which may or may not be present on any given platform).
- */
-
-+#include <stddef.h> /* for NULL */
- #include "DNSCommon.h" // Defines general DNS utility routines
- #include "uDNS.h" // Defines entry points into unicast-specific routines
-
---
-2.20.1
-
diff --git a/meta-networking/recipes-protocols/mdns/files/0002-Create-subroutine-for-tearing-down-an-interface.patch b/meta-networking/recipes-protocols/mdns/files/0002-Create-subroutine-for-tearing-down-an-interface.patch
deleted file mode 100644
index 21ba318499..0000000000
--- a/meta-networking/recipes-protocols/mdns/files/0002-Create-subroutine-for-tearing-down-an-interface.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From a2148df99ddcd122247f95c4cbcce5c4118581a1 Mon Sep 17 00:00:00 2001
-From: Nate Karstens <nate.karstens@garmin.com>
-Date: Wed, 28 Jun 2017 17:30:00 -0500
-Subject: [PATCH 02/11] Create subroutine for tearing down an interface
-
-Creates a subroutine for tearing down an interface.
-
-Upstream-Status: Submitted [dts@apple.com]
-
-Signed-off-by: Nate Karstens <nate.karstens@garmin.com>
----
- mDNSPosix/mDNSPosix.c | 22 ++++++++++++++++------
- 1 file changed, 16 insertions(+), 6 deletions(-)
-
-diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c
-index ffc9696..5e5b2cd 100644
---- a/mDNSPosix/mDNSPosix.c
-+++ b/mDNSPosix/mDNSPosix.c
-@@ -591,6 +591,19 @@ mDNSlocal void FreePosixNetworkInterface(PosixNetworkInterface *intf)
- gRecentInterfaces = intf;
- }
-
-+mDNSlocal void TearDownInterface(mDNS *const m, PosixNetworkInterface *intf)
-+{
-+ mDNS_DeregisterInterface(m, &intf->coreIntf, NormalActivation);
-+ if (gMDNSPlatformPosixVerboseLevel > 0) fprintf(stderr, "Deregistered interface %s\n", intf->intfName);
-+ FreePosixNetworkInterface(intf);
-+
-+ num_registered_interfaces--;
-+ if (num_registered_interfaces == 0) {
-+ num_pkts_accepted = 0;
-+ num_pkts_rejected = 0;
-+ }
-+}
-+
- // Grab the first interface, deregister it, free it, and repeat until done.
- mDNSlocal void ClearInterfaceList(mDNS *const m)
- {
-@@ -599,13 +612,10 @@ mDNSlocal void ClearInterfaceList(mDNS *const m)
- while (m->HostInterfaces)
- {
- PosixNetworkInterface *intf = (PosixNetworkInterface*)(m->HostInterfaces);
-- mDNS_DeregisterInterface(m, &intf->coreIntf, NormalActivation);
-- if (gMDNSPlatformPosixVerboseLevel > 0) fprintf(stderr, "Deregistered interface %s\n", intf->intfName);
-- FreePosixNetworkInterface(intf);
-+ TearDownInterface(m, intf);
- }
-- num_registered_interfaces = 0;
-- num_pkts_accepted = 0;
-- num_pkts_rejected = 0;
-+
-+ assert(num_registered_interfaces == 0);
- }
-
- // Sets up a send/receive socket.
---
-2.17.1
-
diff --git a/meta-networking/recipes-protocols/mdns/files/0002-mdns-cross-compilation-fixes-for-bitbake.patch b/meta-networking/recipes-protocols/mdns/files/0002-mdns-cross-compilation-fixes-for-bitbake.patch
deleted file mode 100644
index 33590ffc57..0000000000
--- a/meta-networking/recipes-protocols/mdns/files/0002-mdns-cross-compilation-fixes-for-bitbake.patch
+++ /dev/null
@@ -1,145 +0,0 @@
-From 72405143f9d16514e70b88bc4843c9634b88036a Mon Sep 17 00:00:00 2001
-From: Brendan Le Foll <brendan.le.foll@intel.com>
-Date: Tue, 3 Mar 2015 11:42:57 +0000
-Subject: [PATCH 2/2] mdns: cross compilation fixes for bitbake
-
-Fixes several build errors when incorrect compiler or
-compiler flags are used.
-
-Upstream-Status: Inappropriate [OE-specific]
-
-Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
-Signed-off-by: Mikko Rapeli <mikko.rapeli@bmw.de>
----
- mDNSPosix/Makefile | 44 ++++++++++++++++++++------------------------
- 1 file changed, 20 insertions(+), 24 deletions(-)
-
-diff --git a/mDNSPosix/Makefile b/mDNSPosix/Makefile
-index 78222e0..18a3af5 100755
---- a/mDNSPosix/Makefile
-+++ b/mDNSPosix/Makefile
-@@ -50,6 +50,7 @@
-
- LIBVERS = 1
-
-+POSIXDIR = ../mDNSPosix
- COREDIR = ../mDNSCore
- SHAREDDIR ?= ../mDNSShared
- DSODIR ?= ../DSO
-@@ -62,16 +63,16 @@ else ifeq ($(SYSTEM), Linux)
- os=linux
- endif
-
--CC = cc
--BISON = bison
--FLEX = flex
--ST = strip
--LD = ld
-+CC ?= cc
-+BISON ?= bison
-+FLEX ?= flex
-+ST ?= strip
-+LD ?= ld
- SOOPTS = -shared
- CP = cp
- RM = rm
- LN = ln -s -f
--CFLAGS_COMMON = -I$(COREDIR) -I$(SHAREDDIR) -I$(DSODIR) -I$(PROXYDIR) -I$(OBJDIR) -fwrapv -W -Wall -DPID_FILE=\"/var/run/mdnsd.pid\" -DMDNS_UDS_SERVERPATH=\"/var/run/mdnsd\"
-+CFLAGS_COMMON = -I$(POSIXDIR) -I$(COREDIR) -I$(SHAREDDIR) -I$(DSODIR) -I$(PROXYDIR) -I$(OBJDIR) -fwrapv -W -Wall -DPID_FILE=\"/var/run/mdnsd.pid\" -DMDNS_UDS_SERVERPATH=\"/var/run/mdnsd\"
- CFLAGS_PTHREAD =
- LINKOPTS =
- LINKOPTS_PTHREAD = -lpthread
-@@ -85,6 +86,7 @@ CFLAGS_OPEN_SOURCE=
- endif
-
- # Set up diverging paths for debug vs. prod builds
-+DEBUG ?= 1
- ifeq "$(DEBUG)" "1"
- CFLAGS_DEBUGGING = -g -DMDNS_DEBUGMSGS=2
- OBJDIR = objects/debug
-@@ -101,8 +103,8 @@ else
- # 1. We want to make small binaries, suitable for putting into hardware devices
- # 2. Some of the code analysis warnings only work when some form of optimization is enabled
- CFLAGS_DEBUGGING = -g -DMDNS_DEBUGMSGS=0
--OBJDIR ?= objects/prod
--BUILDDIR ?= build/prod
-+OBJDIR = objects/prod
-+BUILDDIR = build/prod
- STRIP = $(ST) -S
- endif
- endif
-@@ -125,7 +127,7 @@ else
- # any target that contains the string "linux"
- ifeq ($(findstring linux,$(os)),linux)
- CFLAGS_OS = -D_GNU_SOURCE -DHAVE_IPV6 -DNOT_HAVE_SA_LEN -DUSES_NETLINK -DHAVE_LINUX -DTARGET_OS_LINUX -ftabstop=4
--LD = $(CC)
-+LD ?= $(CC)
- SOOPTS = -shared
- FLEXFLAGS_OS = -l
- JAVACFLAGS_OS += -I$(JDK)/include/linux
-@@ -276,8 +278,7 @@ Daemon: setup $(BUILDDIR)/mdnsd
- @echo "Responder daemon done"
-
- $(BUILDDIR)/mdnsd: $(DAEMONOBJS)
-- $(CC) -o $@ $+ $(LINKOPTS)
-- $(STRIP) $@
-+ $(LD) -o $@ $+
-
- # libdns_sd target builds the client library
- libdns_sd: setup $(BUILDDIR)/libdns_sd.$(LDSUFFIX)
-@@ -286,13 +287,9 @@ libdns_sd: setup $(BUILDDIR)/libdns_sd.$(LDSUFFIX)
- CLIENTLIBOBJS = $(OBJDIR)/dnssd_clientlib.c.so.o $(OBJDIR)/dnssd_clientstub.c.so.o $(OBJDIR)/dnssd_ipc.c.so.o
-
- $(BUILDDIR)/libdns_sd.$(LDSUFFIX): $(CLIENTLIBOBJS)
-- $(LD) $(SOOPTS) $(LINKOPTS) -o $@ $+
-- $(STRIP) $@
--
--Clients: setup libdns_sd ../Clients/build/dns-sd
-- @echo "Clients done"
-+ $(LD) -shared $(LINKOPTS) -Wl,-soname,libdns_sd.$(LDSUFFIX).1 -o $@ $+
-
--../Clients/build/dns-sd: ../Clients/dns-sd.c
-+Clients: setup libdns_sd
- $(MAKE) -C ../Clients DEBUG=$(DEBUG) SUPMAKE_CFLAGS="$(MDNSCFLAGS)"
-
- # nss_mdns target builds the Name Service Switch module
-@@ -300,8 +297,7 @@ nss_mdns: setup $(BUILDDIR)/$(NSSLIBFILE)
- @echo "Name Service Switch module done"
-
- $(BUILDDIR)/$(NSSLIBFILE): $(CLIENTLIBOBJS) $(OBJDIR)/nss_mdns.c.so.o
-- $(LD) $(SOOPTS) $(LINKOPTS) -o $@ $+
-- $(STRIP) $@
-+ $(LD) -shared $(LINKOPTS) -o $@ $+
-
- #############################################################################
-
-@@ -494,21 +490,21 @@ dnsextd: setup $(BUILDDIR)/dnsextd
- @echo "dnsextd done"
-
- $(BUILDDIR)/mDNSClientPosix: $(APPOBJ) $(OBJDIR)/Client.c.o
-- $(CC) $+ -o $@ $(LINKOPTS)
-+ $(CC) $+ -o $@
-
- $(BUILDDIR)/mDNSResponderPosix: $(COMMONOBJ) $(OBJDIR)/Responder.c.o
-- $(CC) $+ -o $@ $(LINKOPTS)
-+ $(CC) $+ -o $@
-
- $(BUILDDIR)/mDNSProxyResponderPosix: $(COMMONOBJ) $(OBJDIR)/ProxyResponder.c.o
-- $(CC) $+ -o $@ $(LINKOPTS)
-+ $(CC) $+ -o $@
-
- $(BUILDDIR)/mDNSNetMonitor: $(SPECIALOBJ) $(OBJDIR)/NetMonitor.c.o
-- $(CC) $+ -o $@ $(LINKOPTS)
-+ $(CC) $+ -o $@
-
- $(OBJDIR)/NetMonitor.c.o: $(COREDIR)/mDNS.c # Note: NetMonitor.c textually imports mDNS.c
-
- $(BUILDDIR)/dnsextd: $(DNSEXTDOBJ) $(OBJDIR)/dnsextd.c.threadsafe.o
-- $(CC) $+ -o $@ $(LINKOPTS) $(LINKOPTS_PTHREAD)
-+ $(CC) $+ -o $@ $(LINKOPTS_PTHREAD)
-
- #############################################################################
-
---
-2.20.1
-
diff --git a/meta-networking/recipes-protocols/mdns/files/0003-Track-interface-socket-family.patch b/meta-networking/recipes-protocols/mdns/files/0003-Track-interface-socket-family.patch
deleted file mode 100644
index 8c0e6bf397..0000000000
--- a/meta-networking/recipes-protocols/mdns/files/0003-Track-interface-socket-family.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From 71a7c728ae0d8143b66aa40decca74ebaa9aa2ce Mon Sep 17 00:00:00 2001
-From: Nate Karstens <nate.karstens@garmin.com>
-Date: Wed, 28 Jun 2017 17:30:00 -0500
-Subject: [PATCH 03/11] Track interface socket family
-
-Tracks the socket family associated with the interface.
-
-Upstream-Status: Submitted [dts@apple.com]
-
-Signed-off-by: Nate Karstens <nate.karstens@garmin.com>
----
- mDNSPosix/mDNSPosix.c | 1 +
- mDNSPosix/mDNSPosix.h | 2 ++
- 2 files changed, 3 insertions(+)
-
-diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c
-index 5e5b2cd..8fe22be 100644
---- a/mDNSPosix/mDNSPosix.c
-+++ b/mDNSPosix/mDNSPosix.c
-@@ -918,6 +918,7 @@ mDNSlocal int SetupOneInterface(mDNS *const m, struct sockaddr *intfAddr, struct
- // Set up the extra fields in PosixNetworkInterface.
- assert(intf->intfName != NULL); // intf->intfName already set up above
- intf->index = intfIndex;
-+ intf->sa_family = intfAddr->sa_family;
- intf->multicastSocket4 = -1;
- #if HAVE_IPV6
- intf->multicastSocket6 = -1;
-diff --git a/mDNSPosix/mDNSPosix.h b/mDNSPosix/mDNSPosix.h
-index ca60d80..f77c185 100644
---- a/mDNSPosix/mDNSPosix.h
-+++ b/mDNSPosix/mDNSPosix.h
-@@ -19,6 +19,7 @@
- #define __mDNSPlatformPosix_h
-
- #include <signal.h>
-+#include <sys/socket.h>
- #include <sys/time.h>
-
- #ifdef __cplusplus
-@@ -40,6 +41,7 @@ struct PosixNetworkInterface
- const char * intfName;
- PosixNetworkInterface * aliasIntf;
- int index;
-+ sa_family_t sa_family;
- int multicastSocket4;
- #if HAVE_IPV6
- int multicastSocket6;
---
-2.17.1
-
diff --git a/meta-networking/recipes-protocols/mdns/files/0004-Use-list-for-changed-interfaces.patch b/meta-networking/recipes-protocols/mdns/files/0004-Use-list-for-changed-interfaces.patch
deleted file mode 100644
index db3a63ea48..0000000000
--- a/meta-networking/recipes-protocols/mdns/files/0004-Use-list-for-changed-interfaces.patch
+++ /dev/null
@@ -1,177 +0,0 @@
-From 798bfb5e984845a27874d1a244686db6e384d7b8 Mon Sep 17 00:00:00 2001
-From: Nate Karstens <nate.karstens@garmin.com>
-Date: Thu, 13 Jul 2017 09:00:00 -0500
-Subject: [PATCH 04/11] Use list for changed interfaces
-
-Uses a linked list to store the index of changed network interfaces
-instead of a bitfield. This allows for network interfaces with an
-index greater than 31 (an index of 36 was seen on Android).
-
-Upstream-Status: Submitted [dts@apple.com]
-
-Signed-off-by: Nate Karstens <nate.karstens@garmin.com>
----
- mDNSPosix/mDNSPosix.c | 67 +++++++++++++++++++++++++++++++++----------
- 1 file changed, 52 insertions(+), 15 deletions(-)
-
-diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c
-index 195d04b..bb883c1 100755
---- a/mDNSPosix/mDNSPosix.c
-+++ b/mDNSPosix/mDNSPosix.c
-@@ -67,6 +67,14 @@ struct IfChangeRec
- };
- typedef struct IfChangeRec IfChangeRec;
-
-+// Used to build a list of network interface indices
-+struct NetworkInterfaceIndex
-+{
-+ int if_index;
-+ struct NetworkInterfaceIndex *Next;
-+};
-+typedef struct NetworkInterfaceIndex NetworkInterfaceIndex;
-+
- // Note that static data is initialized to zero in (modern) C.
- static PosixEventSource *gEventSources; // linked list of PosixEventSource's
- static sigset_t gEventSignalSet; // Signals which event loop listens for
-@@ -1458,6 +1466,32 @@ mDNSlocal mStatus OpenIfNotifySocket(int *pFD)
- return err;
- }
-
-+mDNSlocal mDNSBool ListContainsInterfaceIndex(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;
-+ }
-+
-+ 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;
-+
-+ item->if_index = if_index;
-+ item->Next = NULL;
-+ AddToTail(list, item);
-+}
-+
- #if MDNS_DEBUGMSGS
- mDNSlocal void PrintNetLinkMsg(const struct nlmsghdr *pNLMsg)
- {
-@@ -1485,14 +1519,13 @@ mDNSlocal void PrintNetLinkMsg(const struct nlmsghdr *pNLMsg)
- }
- #endif
-
--mDNSlocal mDNSu32 ProcessRoutingNotification(int sd)
-+mDNSlocal void ProcessRoutingNotification(int sd, GenLinkedList *changedInterfaces)
- // Read through the messages on sd and if any indicate that any interface records should
- // be torn down and rebuilt, return affected indices as a bitmask. Otherwise return 0.
- {
- ssize_t readCount;
- char buff[4096];
- struct nlmsghdr *pNLMsg = (struct nlmsghdr*) buff;
-- mDNSu32 result = 0;
-
- // The structure here is more complex than it really ought to be because,
- // unfortunately, there's no good way to size a buffer in advance large
-@@ -1528,9 +1561,9 @@ mDNSlocal mDNSu32 ProcessRoutingNotification(int sd)
-
- // Process the NetLink message
- if (pNLMsg->nlmsg_type == RTM_GETLINK || pNLMsg->nlmsg_type == RTM_NEWLINK)
-- result |= 1 << ((struct ifinfomsg*) NLMSG_DATA(pNLMsg))->ifi_index;
-+ AddInterfaceIndexToList(changedInterfaces, ((struct ifinfomsg*) NLMSG_DATA(pNLMsg))->ifi_index);
- else if (pNLMsg->nlmsg_type == RTM_DELADDR || pNLMsg->nlmsg_type == RTM_NEWADDR)
-- result |= 1 << ((struct ifaddrmsg*) NLMSG_DATA(pNLMsg))->ifa_index;
-+ AddInterfaceIndexToList(changedInterfaces, ((struct ifaddrmsg*) NLMSG_DATA(pNLMsg))->ifa_index);
-
- // Advance pNLMsg to the next message in the buffer
- if ((pNLMsg->nlmsg_flags & NLM_F_MULTI) != 0 && pNLMsg->nlmsg_type != NLMSG_DONE)
-@@ -1541,8 +1574,6 @@ mDNSlocal mDNSu32 ProcessRoutingNotification(int sd)
- else
- break; // all done!
- }
--
-- return result;
- }
-
- #else // USES_NETLINK
-@@ -1574,14 +1605,13 @@ mDNSlocal void PrintRoutingSocketMsg(const struct ifa_msghdr *pRSMsg)
- }
- #endif
-
--mDNSlocal mDNSu32 ProcessRoutingNotification(int sd)
-+mDNSlocal void ProcessRoutingNotification(int sd, GenLinkedList *changedInterfaces)
- // Read through the messages on sd and if any indicate that any interface records should
- // be torn down and rebuilt, return affected indices as a bitmask. Otherwise return 0.
- {
- ssize_t readCount;
- char buff[4096];
- struct ifa_msghdr *pRSMsg = (struct ifa_msghdr*) buff;
-- mDNSu32 result = 0;
-
- readCount = read(sd, buff, sizeof buff);
- if (readCount < (ssize_t) sizeof(struct ifa_msghdr))
-@@ -1596,12 +1626,10 @@ mDNSlocal mDNSu32 ProcessRoutingNotification(int sd)
- pRSMsg->ifam_type == RTM_IFINFO)
- {
- if (pRSMsg->ifam_type == RTM_IFINFO)
-- result |= 1 << ((struct if_msghdr*) pRSMsg)->ifm_index;
-+ AddInterfaceIndexToList(changedInterfaces, ((struct if_msghdr*) pRSMsg)->ifm_index);
- else
-- result |= 1 << pRSMsg->ifam_index;
-+ AddInterfaceIndexToList(changedInterfaces, pRSMsg->ifam_index);
- }
--
-- return result;
- }
-
- #endif // USES_NETLINK
-@@ -1611,7 +1639,8 @@ mDNSlocal void InterfaceChangeCallback(int fd, void *context)
- {
- IfChangeRec *pChgRec = (IfChangeRec*) context;
- fd_set readFDs;
-- mDNSu32 changedInterfaces = 0;
-+ GenLinkedList changedInterfaces;
-+ NetworkInterfaceIndex *changedInterface;
- struct timeval zeroTimeout = { 0, 0 };
-
- (void)fd; // Unused
-@@ -1619,17 +1648,25 @@ mDNSlocal void InterfaceChangeCallback(int fd, void *context)
- FD_ZERO(&readFDs);
- FD_SET(pChgRec->NotifySD, &readFDs);
-
-+ InitLinkedList(&changedInterfaces, offsetof(NetworkInterfaceIndex, Next));
-+
- do
- {
-- changedInterfaces |= ProcessRoutingNotification(pChgRec->NotifySD);
-+ ProcessRoutingNotification(pChgRec->NotifySD, &changedInterfaces);
- }
- while (0 < select(pChgRec->NotifySD + 1, &readFDs, (fd_set*) NULL, (fd_set*) NULL, &zeroTimeout));
-
- // Currently we rebuild the entire interface list whenever any interface change is
- // detected. If this ever proves to be a performance issue in a multi-homed
- // configuration, more care should be paid to changedInterfaces.
-- if (changedInterfaces)
-+ if (changedInterfaces.Head != NULL)
- mDNSPlatformPosixRefreshInterfaceList(pChgRec->mDNS);
-+
-+ while ((changedInterface = (NetworkInterfaceIndex*)changedInterfaces.Head) != NULL)
-+ {
-+ RemoveFromList(&changedInterfaces, changedInterface);
-+ free(changedInterface);
-+ }
- }
-
- // Register with either a Routing Socket or RtNetLink to listen for interface changes.
---
-2.20.1
-
diff --git a/meta-networking/recipes-protocols/mdns/files/0006-Remove-unneeded-function.patch b/meta-networking/recipes-protocols/mdns/files/0006-Remove-unneeded-function.patch
deleted file mode 100644
index b461a60df7..0000000000
--- a/meta-networking/recipes-protocols/mdns/files/0006-Remove-unneeded-function.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-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
-
diff --git a/meta-networking/recipes-protocols/mdns/files/0008-Mark-deleted-interfaces-as-being-changed.patch b/meta-networking/recipes-protocols/mdns/files/0008-Mark-deleted-interfaces-as-being-changed.patch
deleted file mode 100644
index fdc5105cb9..0000000000
--- a/meta-networking/recipes-protocols/mdns/files/0008-Mark-deleted-interfaces-as-being-changed.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 0fcc0f210f3a9310a1963de640b384ce866410fd Mon Sep 17 00:00:00 2001
-From: Nate Karstens <nate.karstens@garmin.com>
-Date: Wed, 9 Aug 2017 09:16:58 -0500
-Subject: [PATCH 08/11] Mark deleted interfaces as being changed
-
-Netlink notification handling ignores messages for deleted links,
-RTM_DELLINK. It does handle RTM_GETLINK. According to libnl docu-
-mentation (http://www.infradead.org/~tgr/libnl/doc/route.html)
-RTM_DELLINK can be sent by the kernel, but RTM_GETLINK cannot.
-There was likely a mixup in the original implementation, so this
-change replaces handling for RTM_GETLINK with RTM_DELLINK.
-
-Testing and Verification Instructions:
- 1. Use ip-link to add and remove a VLAN interface and verify
- that mDNSResponder handles the deleted link.
-
-Upstream-Status: Submitted [dts@apple.com]
-
-Signed-off-by: Nate Karstens <nate.karstens@garmin.com>
----
- mDNSPosix/mDNSPosix.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c
-index 798ab10..a8a57df 100644
---- a/mDNSPosix/mDNSPosix.c
-+++ b/mDNSPosix/mDNSPosix.c
-@@ -1163,7 +1163,7 @@ mDNSlocal void ProcessRoutingNotification(int sd, GenLinkedList *change
- #endif
-
- // Process the NetLink message
-- if (pNLMsg->nlmsg_type == RTM_GETLINK || pNLMsg->nlmsg_type == RTM_NEWLINK)
-+ if (pNLMsg->nlmsg_type == RTM_DELLINK || pNLMsg->nlmsg_type == RTM_NEWLINK)
- AddInterfaceIndexToList(changedInterfaces, ((struct ifinfomsg*) NLMSG_DATA(pNLMsg))->ifi_index);
- else if (pNLMsg->nlmsg_type == RTM_DELADDR || pNLMsg->nlmsg_type == RTM_NEWADDR)
- AddInterfaceIndexToList(changedInterfaces, ((struct ifaddrmsg*) NLMSG_DATA(pNLMsg))->ifa_index);
---
-2.17.1
-
diff --git a/meta-networking/recipes-protocols/mdns/files/0009-Fix-possible-NULL-dereference.patch b/meta-networking/recipes-protocols/mdns/files/0009-Fix-possible-NULL-dereference.patch
deleted file mode 100644
index 362d69768e..0000000000
--- a/meta-networking/recipes-protocols/mdns/files/0009-Fix-possible-NULL-dereference.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 38cff19781f81586926b02f0fd1cb36c040395e0 Mon Sep 17 00:00:00 2001
-From: Nate Karstens <nate.karstens@garmin.com>
-Date: Thu, 10 Aug 2017 08:21:53 -0500
-Subject: [PATCH 09/11] Fix possible NULL dereference
-
-Fixes a possible NULL dereference if memory for
-the PosixNetworkInterface could not be allocated.
-Other logic seems to prevent dereferencing this
-variable if NULL, but this instance seems to have
-been overlooked.
-
-Upstream-Status: Submitted [dts@apple.com]
-
-Signed-off-by: Nate Karstens <nate.karstens@garmin.com>
----
- mDNSPosix/mDNSPosix.c | 11 +++++++----
- 1 file changed, 7 insertions(+), 4 deletions(-)
-
-diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c
-index a8a57df..3243ed4 100644
---- a/mDNSPosix/mDNSPosix.c
-+++ b/mDNSPosix/mDNSPosix.c
-@@ -951,12 +951,15 @@ mDNSlocal int SetupOneInterface(mDNS *const m, struct ifi_info *const ifi)
-
- // If interface is a direct link, address record will be marked as kDNSRecordTypeKnownUnique
- // and skip the probe phase of the probe/announce packet sequence.
-- intf->coreIntf.DirectLink = mDNSfalse;
-+ if (err == 0)
-+ {
-+ intf->coreIntf.DirectLink = mDNSfalse;
- #ifdef DIRECTLINK_INTERFACE_NAME
-- if (strcmp(intfName, STRINGIFY(DIRECTLINK_INTERFACE_NAME)) == 0)
-- intf->coreIntf.DirectLink = mDNStrue;
-+ if (strcmp(intfName, STRINGIFY(DIRECTLINK_INTERFACE_NAME)) == 0)
-+ intf->coreIntf.DirectLink = mDNStrue;
- #endif
-- intf->coreIntf.SupportsUnicastMDNSResponse = mDNStrue;
-+ intf->coreIntf.SupportsUnicastMDNSResponse = mDNStrue;
-+ }
-
- // The interface is all ready to go, let's register it with the mDNS core.
- if (err == 0)
---
-2.17.1
-
diff --git a/meta-networking/recipes-protocols/mdns/files/0010-Handle-errors-from-socket-calls.patch b/meta-networking/recipes-protocols/mdns/files/0010-Handle-errors-from-socket-calls.patch
deleted file mode 100644
index b9b0157276..0000000000
--- a/meta-networking/recipes-protocols/mdns/files/0010-Handle-errors-from-socket-calls.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 382b3b924e43abd1bdc5792918161d0922666691 Mon Sep 17 00:00:00 2001
-From: Nate Karstens <nate.karstens@garmin.com>
-Date: Thu, 10 Aug 2017 08:27:32 -0500
-Subject: [PATCH 10/11] Handle errors from socket calls
-
-Adds handling for socket() or read() returning a
-negative value (indicating an error has occurred).
-
-Upstream-Status: Submitted [dts@apple.com]
-
-Signed-off-by: Nate Karstens <nate.karstens@garmin.com>
----
- mDNSPosix/mDNSPosix.c | 12 +++++++++---
- 1 file changed, 9 insertions(+), 3 deletions(-)
-
-diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c
-index 3243ed4..84af26b 100644
---- a/mDNSPosix/mDNSPosix.c
-+++ b/mDNSPosix/mDNSPosix.c
-@@ -1129,7 +1129,7 @@ mDNSlocal void ProcessRoutingNotification(int sd, GenLinkedList *change
- // Read through the messages on sd and if any indicate that any interface records should
- // be torn down and rebuilt, return affected indices as a bitmask. Otherwise return 0.
- {
-- ssize_t readCount;
-+ ssize_t readVal, readCount;
- char buff[4096];
- struct nlmsghdr *pNLMsg = (struct nlmsghdr*) buff;
-
-@@ -1138,7 +1138,10 @@ mDNSlocal void ProcessRoutingNotification(int sd, GenLinkedList *change
- // enough to hold all pending data and so avoid message fragmentation.
- // (Note that FIONREAD is not supported on AF_NETLINK.)
-
-- readCount = read(sd, buff, sizeof buff);
-+ readVal = read(sd, buff, sizeof buff);
-+ if (readVal < 0) return;
-+ readCount = readVal;
-+
- while (1)
- {
- // Make sure we've got an entire nlmsghdr in the buffer, and payload, too.
-@@ -1154,7 +1157,9 @@ mDNSlocal void ProcessRoutingNotification(int sd, GenLinkedList *change
- pNLMsg = (struct nlmsghdr*) buff;
-
- // read more data
-- readCount += read(sd, buff + readCount, sizeof buff - readCount);
-+ readVal = read(sd, buff + readCount, sizeof buff - readCount);
-+ if (readVal < 0) return;
-+ readCount += readVal;
- continue; // spin around and revalidate with new readCount
- }
- else
-@@ -1429,6 +1434,7 @@ mDNSlocal mDNSBool mDNSPlatformInit_CanReceiveUnicast(void)
- int err;
- int s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
- struct sockaddr_in s5353;
-+ if (s < 0) return mDNSfalse;
- s5353.sin_family = AF_INET;
- s5353.sin_port = MulticastDNSPort.NotAnInteger;
- s5353.sin_addr.s_addr = 0;
---
-2.17.1
-
diff --git a/meta-networking/recipes-protocols/mdns/files/0011-Change-a-dynamic-allocation-to-file-scope-variable.patch b/meta-networking/recipes-protocols/mdns/files/0011-Change-a-dynamic-allocation-to-file-scope-variable.patch
deleted file mode 100644
index d9adde04c2..0000000000
--- a/meta-networking/recipes-protocols/mdns/files/0011-Change-a-dynamic-allocation-to-file-scope-variable.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 9ff06108cd44e84ba6c68bfa6737e793f117e303 Mon Sep 17 00:00:00 2001
-From: Nate Karstens <nate.karstens@garmin.com>
-Date: Thu, 10 Aug 2017 08:46:03 -0500
-Subject: [PATCH] Change a dynamic allocation to file-scope variable
-
-Changes a variable from being dynamically-allocated to being
-statically-allocated at the file scope. Addresses a Coverity
-issue where it appeared that the memory was being leaked.
-
-Upstream-Status: Submitted [dts@apple.com]
-
-Signed-off-by: Nate Karstens <nate.karstens@garmin.com>
----
- mDNSPosix/mDNSPosix.c | 14 ++++----------
- 1 file changed, 4 insertions(+), 10 deletions(-)
-
-diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c
-index 7aeee7b..2d25016 100755
---- a/mDNSPosix/mDNSPosix.c
-+++ b/mDNSPosix/mDNSPosix.c
-@@ -81,6 +81,7 @@ static sigset_t gEventSignalSet; // Signals which event loop list
- static sigset_t gEventSignals; // Signals which were received while inside loop
-
- static PosixNetworkInterface *gRecentInterfaces;
-+static IfChangeRec gChgRec;
-
- // ***************************************************************************
- // Globals (for debugging)
-@@ -1641,18 +1642,11 @@ mDNSlocal void InterfaceChangeCallback(int fd, void *context)
- mDNSlocal mStatus WatchForInterfaceChange(mDNS *const m)
- {
- mStatus err;
-- IfChangeRec *pChgRec;
-
-- pChgRec = (IfChangeRec*) mDNSPlatformMemAllocateClear(sizeof *pChgRec);
-- if (pChgRec == NULL)
-- return mStatus_NoMemoryErr;
--
-- pChgRec->mDNS = m;
-- err = OpenIfNotifySocket(&pChgRec->NotifySD);
-+ gChgRec.mDNS = m;
-+ err = OpenIfNotifySocket(&gChgRec.NotifySD);
- if (err == 0)
-- err = mDNSPosixAddFDToEventLoop(pChgRec->NotifySD, InterfaceChangeCallback, pChgRec);
-- if (err)
-- mDNSPlatformMemFree(pChgRec);
-+ err = mDNSPosixAddFDToEventLoop(gChgRec.NotifySD, InterfaceChangeCallback, &gChgRec);
-
- return err;
- }
---
-2.20.1
-
diff --git a/meta-networking/recipes-protocols/mdns/files/mdns.service b/meta-networking/recipes-protocols/mdns/files/mdns.service
deleted file mode 100644
index 531d142dcd..0000000000
--- a/meta-networking/recipes-protocols/mdns/files/mdns.service
+++ /dev/null
@@ -1,15 +0,0 @@
-[Unit]
-Description=Zero-configuration networking
-After=network.target
-
-[Service]
-Type=forking
-ExecStartPre=/bin/rm -f /var/run/mdnsd.pid
-ExecStart=/usr/sbin/mdnsd
-ExecReload=/bin/kill -HUP $MAINPID
-PIDFile=/var/run/mdnsd.pid
-Restart=always
-RestartSec=10s
-
-[Install]
-WantedBy=multi-user.target