From 1ae1a7cd36240b259ea56b25a7d8a86d8dcae5a0 Mon Sep 17 00:00:00 2001 From: Alex Kiernan Date: Fri, 17 Nov 2023 19:32:23 +0000 Subject: mdns: Upgrade 2200.0.8 -> 2200.40.37.0.1 Signed-off-by: Wang Mingyu Signed-off-by: Alex Kiernan Signed-off-by: Khem Raj --- ...subroutine-for-cleaning-recent-interfaces.patch | 15 +-- .../0001-Handle-interface-without-ifa_addr.patch | 12 +- .../mdns/0001-dns-sd-Include-missing-headers.patch | 11 +- ...-subroutine-for-tearing-down-an-interface.patch | 15 +-- ...02-make-Set-libdns_sd.so-soname-correctly.patch | 13 +- .../mdns/0003-Track-interface-socket-family.patch | 21 ++-- ...-Indicate-loopback-interface-to-mDNS-core.patch | 19 ++- ...-make-Separate-TLS-targets-from-libraries.patch | 11 +- .../0005-Use-list-for-changed-interfaces.patch | 27 ++--- .../0005-mDNSCore-Fix-broken-debug-parameter.patch | 10 +- .../mdns/0006-Handle-noisy-netlink-sockets.patch | 17 ++- .../mdns/0006-make-Add-top-level-Makefile.patch | 10 +- ...-Mark-deleted-interfaces-as-being-changed.patch | 13 +- .../0008-Handle-errors-from-socket-calls.patch | 19 ++- .../mdns/mdns/0009-remove-unneeded-headers.patch | 14 +-- .../mdns/mdns/0015-Add-missing-limits.h.patch | 8 +- .../recipes-protocols/mdns/mdns_2200.0.8.bb | 134 --------------------- .../recipes-protocols/mdns/mdns_2200.40.37.0.1.bb | 134 +++++++++++++++++++++ 18 files changed, 232 insertions(+), 271 deletions(-) delete mode 100644 meta-networking/recipes-protocols/mdns/mdns_2200.0.8.bb create mode 100644 meta-networking/recipes-protocols/mdns/mdns_2200.40.37.0.1.bb diff --git a/meta-networking/recipes-protocols/mdns/mdns/0001-Create-subroutine-for-cleaning-recent-interfaces.patch b/meta-networking/recipes-protocols/mdns/mdns/0001-Create-subroutine-for-cleaning-recent-interfaces.patch index 91198dea73..f5d424d58f 100644 --- a/meta-networking/recipes-protocols/mdns/mdns/0001-Create-subroutine-for-cleaning-recent-interfaces.patch +++ b/meta-networking/recipes-protocols/mdns/mdns/0001-Create-subroutine-for-cleaning-recent-interfaces.patch @@ -14,11 +14,11 @@ Signed-off-by: Alex Kiernan mDNSPosix/mDNSPosix.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) -diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c -index 0a7c3dfa2475..fe7242d83599 100644 ---- a/mDNSPosix/mDNSPosix.c -+++ b/mDNSPosix/mDNSPosix.c -@@ -1322,6 +1322,19 @@ mDNSlocal int SetupSocket(struct sockaddr *intfAddr, mDNSIPPort port, int interf +Index: mDNSResponder/mDNSPosix/mDNSPosix.c +=================================================================== +--- mDNSResponder.orig/mDNSPosix/mDNSPosix.c ++++ mDNSResponder/mDNSPosix/mDNSPosix.c +@@ -1322,6 +1322,19 @@ mDNSlocal int SetupSocket(struct sockadd return err; } @@ -38,7 +38,7 @@ index 0a7c3dfa2475..fe7242d83599 100644 // 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, -@@ -1559,16 +1572,7 @@ mDNSlocal int SetupInterfaceList(mDNS *const m) +@@ -1559,16 +1572,7 @@ mDNSlocal int SetupInterfaceList(mDNS *c // Clean up. if (intfList != NULL) freeifaddrs(intfList); @@ -56,6 +56,3 @@ index 0a7c3dfa2475..fe7242d83599 100644 return err; } --- -2.35.1 - diff --git a/meta-networking/recipes-protocols/mdns/mdns/0001-Handle-interface-without-ifa_addr.patch b/meta-networking/recipes-protocols/mdns/mdns/0001-Handle-interface-without-ifa_addr.patch index daee318ae4..7e76f07c0e 100644 --- a/meta-networking/recipes-protocols/mdns/mdns/0001-Handle-interface-without-ifa_addr.patch +++ b/meta-networking/recipes-protocols/mdns/mdns/0001-Handle-interface-without-ifa_addr.patch @@ -14,11 +14,11 @@ Signed-off-by: Alex Kiernan mDNSPosix/mDNSPosix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c -index d7f31cc4d5cf..f10301253f58 100644 ---- a/mDNSPosix/mDNSPosix.c -+++ b/mDNSPosix/mDNSPosix.c -@@ -1895,6 +1895,7 @@ mDNSlocal void InterfaceChangeCallback(int fd, void *context) +Index: mDNSResponder/mDNSPosix/mDNSPosix.c +=================================================================== +--- mDNSResponder.orig/mDNSPosix/mDNSPosix.c ++++ mDNSResponder/mDNSPosix/mDNSPosix.c +@@ -1895,6 +1895,7 @@ mDNSlocal void InterfaceChangeCallback(i continue; if ((ifa_loop4 == NULL) && @@ -26,7 +26,7 @@ index d7f31cc4d5cf..f10301253f58 100644 ((*ifi)->ifa_addr->sa_family == AF_INET) && ((*ifi)->ifa_flags & IFF_UP) && ((*ifi)->ifa_flags & IFF_LOOPBACK)) -@@ -1903,7 +1904,8 @@ mDNSlocal void InterfaceChangeCallback(int fd, void *context) +@@ -1903,7 +1904,8 @@ mDNSlocal void InterfaceChangeCallback(i continue; } diff --git a/meta-networking/recipes-protocols/mdns/mdns/0001-dns-sd-Include-missing-headers.patch b/meta-networking/recipes-protocols/mdns/mdns/0001-dns-sd-Include-missing-headers.patch index 4a60a95728..82825b294d 100644 --- a/meta-networking/recipes-protocols/mdns/mdns/0001-dns-sd-Include-missing-headers.patch +++ b/meta-networking/recipes-protocols/mdns/mdns/0001-dns-sd-Include-missing-headers.patch @@ -11,10 +11,10 @@ Signed-off-by: Khem Raj mDNSPosix/nss_mdns.c | 3 +++ 1 file changed, 3 insertions(+) -diff --git a/mDNSPosix/nss_mdns.c b/mDNSPosix/nss_mdns.c -index afadb3c6c33b..84c312759463 100644 ---- a/mDNSPosix/nss_mdns.c -+++ b/mDNSPosix/nss_mdns.c +Index: mDNSResponder/mDNSPosix/nss_mdns.c +=================================================================== +--- mDNSResponder.orig/mDNSPosix/nss_mdns.c ++++ mDNSResponder/mDNSPosix/nss_mdns.c @@ -89,6 +89,9 @@ #include @@ -25,6 +25,3 @@ index afadb3c6c33b..84c312759463 100644 //---------- // Public functions --- -2.35.1 - diff --git a/meta-networking/recipes-protocols/mdns/mdns/0002-Create-subroutine-for-tearing-down-an-interface.patch b/meta-networking/recipes-protocols/mdns/mdns/0002-Create-subroutine-for-tearing-down-an-interface.patch index aa3dda8d55..867db88a50 100644 --- a/meta-networking/recipes-protocols/mdns/mdns/0002-Create-subroutine-for-tearing-down-an-interface.patch +++ b/meta-networking/recipes-protocols/mdns/mdns/0002-Create-subroutine-for-tearing-down-an-interface.patch @@ -13,11 +13,11 @@ Signed-off-by: Alex Kiernan mDNSPosix/mDNSPosix.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) -diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c -index fe7242d83599..a32a880c0ce5 100644 ---- a/mDNSPosix/mDNSPosix.c -+++ b/mDNSPosix/mDNSPosix.c -@@ -1043,6 +1043,19 @@ mDNSlocal void FreePosixNetworkInterface(PosixNetworkInterface *intf) +Index: mDNSResponder/mDNSPosix/mDNSPosix.c +=================================================================== +--- mDNSResponder.orig/mDNSPosix/mDNSPosix.c ++++ mDNSResponder/mDNSPosix/mDNSPosix.c +@@ -1043,6 +1043,19 @@ mDNSlocal void FreePosixNetworkInterface gRecentInterfaces = intf; } @@ -37,7 +37,7 @@ index fe7242d83599..a32a880c0ce5 100644 // Grab the first interface, deregister it, free it, and repeat until done. mDNSlocal void ClearInterfaceList(mDNS *const m) { -@@ -1051,13 +1064,10 @@ mDNSlocal void ClearInterfaceList(mDNS *const m) +@@ -1051,13 +1064,10 @@ mDNSlocal void ClearInterfaceList(mDNS * while (m->HostInterfaces) { PosixNetworkInterface *intf = (PosixNetworkInterface*)(m->HostInterfaces); @@ -54,6 +54,3 @@ index fe7242d83599..a32a880c0ce5 100644 } mDNSlocal int SetupIPv6Socket(int fd) --- -2.35.1 - diff --git a/meta-networking/recipes-protocols/mdns/mdns/0002-make-Set-libdns_sd.so-soname-correctly.patch b/meta-networking/recipes-protocols/mdns/mdns/0002-make-Set-libdns_sd.so-soname-correctly.patch index 7f660396b4..03fb1bc0d7 100644 --- a/meta-networking/recipes-protocols/mdns/mdns/0002-make-Set-libdns_sd.so-soname-correctly.patch +++ b/meta-networking/recipes-protocols/mdns/mdns/0002-make-Set-libdns_sd.so-soname-correctly.patch @@ -9,11 +9,11 @@ Signed-off-by: Alex Kiernan mDNSPosix/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/mDNSPosix/Makefile b/mDNSPosix/Makefile -index 802a13dd70b6..5e74193c0e89 100755 ---- a/mDNSPosix/Makefile -+++ b/mDNSPosix/Makefile -@@ -276,7 +276,7 @@ libdns_sd: setup $(BUILDDIR)/libdns_sd.$(LDSUFFIX) +Index: mDNSResponder/mDNSPosix/Makefile +=================================================================== +--- mDNSResponder.orig/mDNSPosix/Makefile ++++ mDNSResponder/mDNSPosix/Makefile +@@ -276,7 +276,7 @@ libdns_sd: setup $(BUILDDIR)/libdns_sd.$ CLIENTLIBOBJS = $(OBJDIR)/dnssd_clientlib.c.so.o $(OBJDIR)/dnssd_clientstub.c.so.o $(OBJDIR)/dnssd_ipc.c.so.o $(OBJDIR)/dnssd_errstring.c.so.o $(BUILDDIR)/libdns_sd.$(LDSUFFIX): $(CLIENTLIBOBJS) @@ -22,6 +22,3 @@ index 802a13dd70b6..5e74193c0e89 100755 $(STRIP) $@ Clients: setup libdns_sd ../Clients/build/dns-sd --- -2.35.1 - diff --git a/meta-networking/recipes-protocols/mdns/mdns/0003-Track-interface-socket-family.patch b/meta-networking/recipes-protocols/mdns/mdns/0003-Track-interface-socket-family.patch index d2a9995ffa..f1cda2b895 100644 --- a/meta-networking/recipes-protocols/mdns/mdns/0003-Track-interface-socket-family.patch +++ b/meta-networking/recipes-protocols/mdns/mdns/0003-Track-interface-socket-family.patch @@ -14,11 +14,11 @@ Signed-off-by: Alex Kiernan mDNSPosix/mDNSPosix.h | 2 ++ 2 files changed, 3 insertions(+) -diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c -index a32a880c0ce5..9a5b4d7ea4cb 100644 ---- a/mDNSPosix/mDNSPosix.c -+++ b/mDNSPosix/mDNSPosix.c -@@ -1415,6 +1415,7 @@ mDNSlocal int SetupOneInterface(mDNS *const m, struct sockaddr *intfAddr, struct +Index: mDNSResponder/mDNSPosix/mDNSPosix.c +=================================================================== +--- mDNSResponder.orig/mDNSPosix/mDNSPosix.c ++++ mDNSResponder/mDNSPosix/mDNSPosix.c +@@ -1415,6 +1415,7 @@ mDNSlocal int SetupOneInterface(mDNS *co // Set up the extra fields in PosixNetworkInterface. assert(intf->intfName != NULL); // intf->intfName already set up above intf->index = intfIndex; @@ -26,10 +26,10 @@ index a32a880c0ce5..9a5b4d7ea4cb 100644 intf->multicastSocket4 = -1; #if HAVE_IPV6 intf->multicastSocket6 = -1; -diff --git a/mDNSPosix/mDNSPosix.h b/mDNSPosix/mDNSPosix.h -index 9675591b0434..dd7864cd0d5e 100644 ---- a/mDNSPosix/mDNSPosix.h -+++ b/mDNSPosix/mDNSPosix.h +Index: mDNSResponder/mDNSPosix/mDNSPosix.h +=================================================================== +--- mDNSResponder.orig/mDNSPosix/mDNSPosix.h ++++ mDNSResponder/mDNSPosix/mDNSPosix.h @@ -19,6 +19,7 @@ #define __mDNSPlatformPosix_h @@ -46,6 +46,3 @@ index 9675591b0434..dd7864cd0d5e 100644 int multicastSocket4; #if HAVE_IPV6 int multicastSocket6; --- -2.35.1 - diff --git a/meta-networking/recipes-protocols/mdns/mdns/0004-Indicate-loopback-interface-to-mDNS-core.patch b/meta-networking/recipes-protocols/mdns/mdns/0004-Indicate-loopback-interface-to-mDNS-core.patch index a5f7f0136b..6bc36456f6 100644 --- a/meta-networking/recipes-protocols/mdns/mdns/0004-Indicate-loopback-interface-to-mDNS-core.patch +++ b/meta-networking/recipes-protocols/mdns/mdns/0004-Indicate-loopback-interface-to-mDNS-core.patch @@ -14,11 +14,11 @@ Signed-off-by: Alex Kiernan mDNSPosix/mDNSPosix.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c -index 9a5b4d7ea4cb..02a19b438e03 100644 ---- a/mDNSPosix/mDNSPosix.c -+++ b/mDNSPosix/mDNSPosix.c -@@ -1348,7 +1348,7 @@ mDNSlocal void CleanRecentInterfaces(void) +Index: mDNSResponder/mDNSPosix/mDNSPosix.c +=================================================================== +--- mDNSResponder.orig/mDNSPosix/mDNSPosix.c ++++ mDNSResponder/mDNSPosix/mDNSPosix.c +@@ -1348,7 +1348,7 @@ mDNSlocal void CleanRecentInterfaces(voi // 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, @@ -27,7 +27,7 @@ index 9a5b4d7ea4cb..02a19b438e03 100644 { int err = 0; PosixNetworkInterface *intf; -@@ -1411,6 +1411,7 @@ mDNSlocal int SetupOneInterface(mDNS *const m, struct sockaddr *intfAddr, struct +@@ -1411,6 +1411,7 @@ mDNSlocal int SetupOneInterface(mDNS *co intf->coreIntf.Advertise = m->AdvertiseLocalAddresses; intf->coreIntf.McastTxRx = mDNStrue; @@ -35,7 +35,7 @@ index 9a5b4d7ea4cb..02a19b438e03 100644 // Set up the extra fields in PosixNetworkInterface. assert(intf->intfName != NULL); // intf->intfName already set up above -@@ -1561,7 +1562,7 @@ mDNSlocal int SetupInterfaceList(mDNS *const m) +@@ -1561,7 +1562,7 @@ mDNSlocal int SetupInterfaceList(mDNS *c } #endif if (SetupOneInterface(m, i->ifa_addr, i->ifa_netmask, @@ -44,7 +44,7 @@ index 9a5b4d7ea4cb..02a19b438e03 100644 { if (i->ifa_addr->sa_family == AF_INET) foundav4 = mDNStrue; -@@ -1578,7 +1579,7 @@ mDNSlocal int SetupInterfaceList(mDNS *const m) +@@ -1578,7 +1579,7 @@ mDNSlocal int SetupInterfaceList(mDNS *c // if ((m->HostInterfaces == NULL) && (firstLoopback != NULL)) if (!foundav4 && firstLoopback) (void) SetupOneInterface(m, firstLoopback->ifa_addr, firstLoopback->ifa_netmask, @@ -53,6 +53,3 @@ index 9a5b4d7ea4cb..02a19b438e03 100644 } // Clean up. --- -2.35.1 - diff --git a/meta-networking/recipes-protocols/mdns/mdns/0004-make-Separate-TLS-targets-from-libraries.patch b/meta-networking/recipes-protocols/mdns/mdns/0004-make-Separate-TLS-targets-from-libraries.patch index a8e8dae60a..837580ac36 100644 --- a/meta-networking/recipes-protocols/mdns/mdns/0004-make-Separate-TLS-targets-from-libraries.patch +++ b/meta-networking/recipes-protocols/mdns/mdns/0004-make-Separate-TLS-targets-from-libraries.patch @@ -12,10 +12,10 @@ Signed-off-by: Alex Kiernan mDNSPosix/Makefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) -diff --git a/mDNSPosix/Makefile b/mDNSPosix/Makefile -index 5e74193c0e89..b4313c36b035 100755 ---- a/mDNSPosix/Makefile -+++ b/mDNSPosix/Makefile +Index: mDNSResponder/mDNSPosix/Makefile +=================================================================== +--- mDNSResponder.orig/mDNSPosix/Makefile ++++ mDNSResponder/mDNSPosix/Makefile @@ -112,9 +112,11 @@ ifeq ($(findstring linux,$(os)),linux) ifeq ($(tls), no) CFLAGS_OS = -D_GNU_SOURCE -DHAVE_IPV6 -DNOT_HAVE_SA_LEN -DUSES_NETLINK -DHAVE_LINUX -DTARGET_OS_LINUX -ftabstop=4 -Wno-expansion-to-defined @@ -59,6 +59,3 @@ index 5e74193c0e89..b4313c36b035 100755 $(OBJDIR)/NetMonitor.c.o: $(COREDIR)/mDNS.c # Note: NetMonitor.c textually imports mDNS.c --- -2.35.1 - diff --git a/meta-networking/recipes-protocols/mdns/mdns/0005-Use-list-for-changed-interfaces.patch b/meta-networking/recipes-protocols/mdns/mdns/0005-Use-list-for-changed-interfaces.patch index 1aec34f243..f00116c617 100644 --- a/meta-networking/recipes-protocols/mdns/mdns/0005-Use-list-for-changed-interfaces.patch +++ b/meta-networking/recipes-protocols/mdns/mdns/0005-Use-list-for-changed-interfaces.patch @@ -15,10 +15,10 @@ Signed-off-by: Alex Kiernan mDNSPosix/mDNSPosix.c | 58 ++++++++++++++++++++++++++++++++----------- 1 file changed, 43 insertions(+), 15 deletions(-) -diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c -index 02a19b438e03..e20adda92229 100644 ---- a/mDNSPosix/mDNSPosix.c -+++ b/mDNSPosix/mDNSPosix.c +Index: mDNSResponder/mDNSPosix/mDNSPosix.c +=================================================================== +--- mDNSResponder.orig/mDNSPosix/mDNSPosix.c ++++ mDNSResponder/mDNSPosix/mDNSPosix.c @@ -74,6 +74,14 @@ struct IfChangeRec }; typedef struct IfChangeRec IfChangeRec; @@ -34,7 +34,7 @@ index 02a19b438e03..e20adda92229 100644 // 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 -@@ -1621,6 +1629,23 @@ mDNSlocal mStatus OpenIfNotifySocket(int *pFD) +@@ -1621,6 +1629,23 @@ mDNSlocal mStatus OpenIfNotifySocket(int return err; } @@ -58,7 +58,7 @@ index 02a19b438e03..e20adda92229 100644 #if MDNS_DEBUGMSGS mDNSlocal void PrintNetLinkMsg(const struct nlmsghdr *pNLMsg) { -@@ -1648,14 +1673,13 @@ mDNSlocal void PrintNetLinkMsg(const struct nlmsghdr *pNLMsg) +@@ -1648,14 +1673,13 @@ mDNSlocal void PrintNetLinkMsg(cons } #endif @@ -74,7 +74,7 @@ index 02a19b438e03..e20adda92229 100644 // 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 -@@ -1691,9 +1715,9 @@ mDNSlocal mDNSu32 ProcessRoutingNotification(int sd) +@@ -1691,9 +1715,9 @@ mDNSlocal mDNSu32 ProcessRoutingNo // Process the NetLink message if (pNLMsg->nlmsg_type == RTM_GETLINK || pNLMsg->nlmsg_type == RTM_NEWLINK) @@ -86,7 +86,7 @@ index 02a19b438e03..e20adda92229 100644 // Advance pNLMsg to the next message in the buffer if ((pNLMsg->nlmsg_flags & NLM_F_MULTI) != 0 && pNLMsg->nlmsg_type != NLMSG_DONE) -@@ -1704,8 +1728,6 @@ mDNSlocal mDNSu32 ProcessRoutingNotification(int sd) +@@ -1704,8 +1728,6 @@ mDNSlocal mDNSu32 ProcessRoutingNo else break; // all done! } @@ -95,7 +95,7 @@ index 02a19b438e03..e20adda92229 100644 } #else // USES_NETLINK -@@ -1737,14 +1759,13 @@ mDNSlocal void PrintRoutingSocketMsg(const struct ifa_msghdr *pRSMsg) +@@ -1737,14 +1759,13 @@ mDNSlocal void PrintRoutingSocketMs } #endif @@ -111,7 +111,7 @@ index 02a19b438e03..e20adda92229 100644 readCount = read(sd, buff, sizeof buff); if (readCount < (ssize_t) sizeof(struct ifa_msghdr)) -@@ -1759,12 +1780,10 @@ mDNSlocal mDNSu32 ProcessRoutingNotification(int sd) +@@ -1759,12 +1780,10 @@ mDNSlocal mDNSu32 ProcessRoutingNo pRSMsg->ifam_type == RTM_IFINFO) { if (pRSMsg->ifam_type == RTM_IFINFO) @@ -126,7 +126,7 @@ index 02a19b438e03..e20adda92229 100644 } #endif // USES_NETLINK -@@ -1774,7 +1793,8 @@ mDNSlocal void InterfaceChangeCallback(int fd, void *context) +@@ -1774,7 +1793,8 @@ mDNSlocal void InterfaceChangeCallback(i { IfChangeRec *pChgRec = (IfChangeRec*) context; fd_set readFDs; @@ -136,7 +136,7 @@ index 02a19b438e03..e20adda92229 100644 struct timeval zeroTimeout = { 0, 0 }; (void)fd; // Unused -@@ -1782,17 +1802,25 @@ mDNSlocal void InterfaceChangeCallback(int fd, void *context) +@@ -1782,17 +1802,25 @@ mDNSlocal void InterfaceChangeCallback(i FD_ZERO(&readFDs); FD_SET(pChgRec->NotifySD, &readFDs); @@ -164,6 +164,3 @@ index 02a19b438e03..e20adda92229 100644 } // Register with either a Routing Socket or RtNetLink to listen for interface changes. --- -2.35.1 - diff --git a/meta-networking/recipes-protocols/mdns/mdns/0005-mDNSCore-Fix-broken-debug-parameter.patch b/meta-networking/recipes-protocols/mdns/mdns/0005-mDNSCore-Fix-broken-debug-parameter.patch index 4cda71bdb1..fd2f2f1178 100644 --- a/meta-networking/recipes-protocols/mdns/mdns/0005-mDNSCore-Fix-broken-debug-parameter.patch +++ b/meta-networking/recipes-protocols/mdns/mdns/0005-mDNSCore-Fix-broken-debug-parameter.patch @@ -10,11 +10,11 @@ Signed-off-by: Alex Kiernan mDNSCore/mDNS.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/mDNSCore/mDNS.c b/mDNSCore/mDNS.c -index eecd7daa724e..1e843c081938 100644 ---- a/mDNSCore/mDNS.c -+++ b/mDNSCore/mDNS.c -@@ -10210,7 +10210,7 @@ mDNSlocal void mDNSCoreReceiveNoUnicastAnswers(mDNS *const m, const DNSMessage * +Index: mDNSResponder/mDNSCore/mDNS.c +=================================================================== +--- mDNSResponder.orig/mDNSCore/mDNS.c ++++ mDNSResponder/mDNSCore/mDNS.c +@@ -10231,7 +10231,7 @@ mDNSlocal void mDNSCoreReceiveNoUnicastA #else const DNSServRef dnsserv = qptr->qDNSServer; #endif diff --git a/meta-networking/recipes-protocols/mdns/mdns/0006-Handle-noisy-netlink-sockets.patch b/meta-networking/recipes-protocols/mdns/mdns/0006-Handle-noisy-netlink-sockets.patch index 882d08e6c6..80cdbca500 100644 --- a/meta-networking/recipes-protocols/mdns/mdns/0006-Handle-noisy-netlink-sockets.patch +++ b/meta-networking/recipes-protocols/mdns/mdns/0006-Handle-noisy-netlink-sockets.patch @@ -27,11 +27,11 @@ Signed-off-by: Alex Kiernan mDNSPosix/mDNSPosix.c | 182 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 172 insertions(+), 10 deletions(-) -diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c -index e20adda92229..5d52de31f79b 100644 ---- a/mDNSPosix/mDNSPosix.c -+++ b/mDNSPosix/mDNSPosix.c -@@ -1788,14 +1788,43 @@ mDNSlocal void ProcessRoutingNotification(int sd, GenLinkedList *change +Index: mDNSResponder/mDNSPosix/mDNSPosix.c +=================================================================== +--- mDNSResponder.orig/mDNSPosix/mDNSPosix.c ++++ mDNSResponder/mDNSPosix/mDNSPosix.c +@@ -1788,14 +1788,43 @@ mDNSlocal void ProcessRoutingNo #endif // USES_NETLINK @@ -75,7 +75,7 @@ index e20adda92229..5d52de31f79b 100644 (void)fd; // Unused -@@ -1810,12 +1839,149 @@ mDNSlocal void InterfaceChangeCallback(int fd, void *context) +@@ -1810,12 +1839,149 @@ mDNSlocal void InterfaceChangeCallback(i } while (0 < select(pChgRec->NotifySD + 1, &readFDs, (fd_set*) NULL, (fd_set*) NULL, &zeroTimeout)); @@ -230,7 +230,7 @@ index e20adda92229..5d52de31f79b 100644 while ((changedInterface = (NetworkInterfaceIndex*)changedInterfaces.Head) != NULL) { RemoveFromList(&changedInterfaces, changedInterface); -@@ -1947,15 +2113,11 @@ mDNSexport void mDNSPlatformClose(mDNS *const m) +@@ -1947,15 +2113,11 @@ mDNSexport void mDNSPlatformClose(mDNS * #endif } @@ -247,6 +247,3 @@ index e20adda92229..5d52de31f79b 100644 ClearInterfaceList(m); err = SetupInterfaceList(m); return PosixErrorToStatus(err); --- -2.35.1 - diff --git a/meta-networking/recipes-protocols/mdns/mdns/0006-make-Add-top-level-Makefile.patch b/meta-networking/recipes-protocols/mdns/mdns/0006-make-Add-top-level-Makefile.patch index 268e574c50..c12a02fcdd 100644 --- a/meta-networking/recipes-protocols/mdns/mdns/0006-make-Add-top-level-Makefile.patch +++ b/meta-networking/recipes-protocols/mdns/mdns/0006-make-Add-top-level-Makefile.patch @@ -12,14 +12,10 @@ Signed-off-by: Alex Kiernan 1 file changed, 2 insertions(+) create mode 100644 Makefile -diff --git a/Makefile b/Makefile -new file mode 100644 -index 000000000000..feb6ac67ef47 +Index: mDNSResponder/Makefile +=================================================================== --- /dev/null -+++ b/Makefile ++++ mDNSResponder/Makefile @@ -0,0 +1,2 @@ +all clean: + cd mDNSPosix && $(MAKE) $@ --- -2.35.1 - diff --git a/meta-networking/recipes-protocols/mdns/mdns/0007-Mark-deleted-interfaces-as-being-changed.patch b/meta-networking/recipes-protocols/mdns/mdns/0007-Mark-deleted-interfaces-as-being-changed.patch index e53b0fd3ae..dae1ac7ea0 100644 --- a/meta-networking/recipes-protocols/mdns/mdns/0007-Mark-deleted-interfaces-as-being-changed.patch +++ b/meta-networking/recipes-protocols/mdns/mdns/0007-Mark-deleted-interfaces-as-being-changed.patch @@ -22,11 +22,11 @@ Signed-off-by: Alex Kiernan mDNSPosix/mDNSPosix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c -index 5d52de31f79b..77d982f4c50b 100644 ---- a/mDNSPosix/mDNSPosix.c -+++ b/mDNSPosix/mDNSPosix.c -@@ -1714,7 +1714,7 @@ mDNSlocal void ProcessRoutingNotification(int sd, GenLinkedList *change +Index: mDNSResponder/mDNSPosix/mDNSPosix.c +=================================================================== +--- mDNSResponder.orig/mDNSPosix/mDNSPosix.c ++++ mDNSResponder/mDNSPosix/mDNSPosix.c +@@ -1714,7 +1714,7 @@ mDNSlocal void ProcessRoutingNo #endif // Process the NetLink message @@ -35,6 +35,3 @@ index 5d52de31f79b..77d982f4c50b 100644 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.35.1 - diff --git a/meta-networking/recipes-protocols/mdns/mdns/0008-Handle-errors-from-socket-calls.patch b/meta-networking/recipes-protocols/mdns/mdns/0008-Handle-errors-from-socket-calls.patch index e689f8c267..1789001e14 100644 --- a/meta-networking/recipes-protocols/mdns/mdns/0008-Handle-errors-from-socket-calls.patch +++ b/meta-networking/recipes-protocols/mdns/mdns/0008-Handle-errors-from-socket-calls.patch @@ -14,11 +14,11 @@ Signed-off-by: Alex Kiernan mDNSPosix/mDNSPosix.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) -diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c -index 77d982f4c50b..cab512160afb 100644 ---- a/mDNSPosix/mDNSPosix.c -+++ b/mDNSPosix/mDNSPosix.c -@@ -1677,7 +1677,7 @@ mDNSlocal void ProcessRoutingNotification(int sd, GenLinkedList *change +Index: mDNSResponder/mDNSPosix/mDNSPosix.c +=================================================================== +--- mDNSResponder.orig/mDNSPosix/mDNSPosix.c ++++ mDNSResponder/mDNSPosix/mDNSPosix.c +@@ -1677,7 +1677,7 @@ mDNSlocal void ProcessRoutingNo // 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. { @@ -27,7 +27,7 @@ index 77d982f4c50b..cab512160afb 100644 char buff[4096]; struct nlmsghdr *pNLMsg = (struct nlmsghdr*) buff; -@@ -1686,7 +1686,10 @@ mDNSlocal void ProcessRoutingNotification(int sd, GenLinkedList *change +@@ -1686,7 +1686,10 @@ mDNSlocal void ProcessRoutingNo // enough to hold all pending data and so avoid message fragmentation. // (Note that FIONREAD is not supported on AF_NETLINK.) @@ -39,7 +39,7 @@ index 77d982f4c50b..cab512160afb 100644 while (1) { // Make sure we've got an entire nlmsghdr in the buffer, and payload, too. -@@ -1702,7 +1705,9 @@ mDNSlocal void ProcessRoutingNotification(int sd, GenLinkedList *change +@@ -1702,7 +1705,9 @@ mDNSlocal void ProcessRoutingNo pNLMsg = (struct nlmsghdr*) buff; // read more data @@ -50,7 +50,7 @@ index 77d982f4c50b..cab512160afb 100644 continue; // spin around and revalidate with new readCount } else -@@ -2017,6 +2022,7 @@ mDNSlocal mDNSBool mDNSPlatformInit_CanReceiveUnicast(void) +@@ -2017,6 +2022,7 @@ mDNSlocal mDNSBool mDNSPlatformInit_CanR int err; int s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); struct sockaddr_in s5353; @@ -58,6 +58,3 @@ index 77d982f4c50b..cab512160afb 100644 s5353.sin_family = AF_INET; s5353.sin_port = MulticastDNSPort.NotAnInteger; s5353.sin_addr.s_addr = 0; --- -2.35.1 - diff --git a/meta-networking/recipes-protocols/mdns/mdns/0009-remove-unneeded-headers.patch b/meta-networking/recipes-protocols/mdns/mdns/0009-remove-unneeded-headers.patch index 74d387368c..d443bc97b2 100644 --- a/meta-networking/recipes-protocols/mdns/mdns/0009-remove-unneeded-headers.patch +++ b/meta-networking/recipes-protocols/mdns/mdns/0009-remove-unneeded-headers.patch @@ -14,20 +14,18 @@ Signed-off-by: Beniamin Sandu mDNSPosix/mbedtls.c | 2 -- 1 file changed, 2 deletions(-) -diff --git a/mDNSPosix/mbedtls.c b/mDNSPosix/mbedtls.c -index a73681b..ab8f8c7 100644 ---- a/mDNSPosix/mbedtls.c -+++ b/mDNSPosix/mbedtls.c +Index: mDNSResponder/mDNSPosix/mbedtls.c +=================================================================== +--- mDNSResponder.orig/mDNSPosix/mbedtls.c ++++ mDNSResponder/mDNSPosix/mbedtls.c @@ -38,10 +38,8 @@ #include #include - + -#include #include #include -#include - + // Posix TLS server context struct TLSContext_struct { --- -2.34.1 diff --git a/meta-networking/recipes-protocols/mdns/mdns/0015-Add-missing-limits.h.patch b/meta-networking/recipes-protocols/mdns/mdns/0015-Add-missing-limits.h.patch index 9fe721ff07..511a6fdc18 100644 --- a/meta-networking/recipes-protocols/mdns/mdns/0015-Add-missing-limits.h.patch +++ b/meta-networking/recipes-protocols/mdns/mdns/0015-Add-missing-limits.h.patch @@ -9,10 +9,10 @@ Signed-off-by: Alex Kiernan mDNSShared/PlatformCommon.c | 1 + 1 file changed, 1 insertion(+) -diff --git a/mDNSShared/PlatformCommon.c b/mDNSShared/PlatformCommon.c -index 9ce15468e217..c308af3e8b0e 100644 ---- a/mDNSShared/PlatformCommon.c -+++ b/mDNSShared/PlatformCommon.c +Index: mDNSResponder/mDNSShared/PlatformCommon.c +=================================================================== +--- mDNSResponder.orig/mDNSShared/PlatformCommon.c ++++ mDNSResponder/mDNSShared/PlatformCommon.c @@ -32,6 +32,7 @@ #include #include // Needed for #include (). diff --git a/meta-networking/recipes-protocols/mdns/mdns_2200.0.8.bb b/meta-networking/recipes-protocols/mdns/mdns_2200.0.8.bb deleted file mode 100644 index 8370ed50c0..0000000000 --- a/meta-networking/recipes-protocols/mdns/mdns_2200.0.8.bb +++ /dev/null @@ -1,134 +0,0 @@ -SUMMARY = "Publishes & browses available services on a link according to the Zeroconf / Bonjour protocol" -DESCRIPTION = "Bonjour, also known as zero-configuration networking, enables automatic discovery of computers, devices, and services on IP networks." -HOMEPAGE = "http://developer.apple.com/networking/bonjour/" -LICENSE = "Apache-2.0 & BSD-3-Clause" -LIC_FILES_CHKSUM = "file://LICENSE;md5=31c50371921e0fb731003bbc665f29bf" - -DEPENDS:append:libc-musl = " musl-nscd" - -SRC_URI = "git://github.com/apple-oss-distributions/mDNSResponder;protocol=https;branch=main \ - file://0001-dns-sd-Include-missing-headers.patch \ - file://0002-make-Set-libdns_sd.so-soname-correctly.patch \ - file://0004-make-Separate-TLS-targets-from-libraries.patch \ - file://0005-mDNSCore-Fix-broken-debug-parameter.patch \ - file://0006-make-Add-top-level-Makefile.patch \ - file://0001-Create-subroutine-for-cleaning-recent-interfaces.patch \ - file://0002-Create-subroutine-for-tearing-down-an-interface.patch \ - file://0003-Track-interface-socket-family.patch \ - file://0004-Indicate-loopback-interface-to-mDNS-core.patch \ - file://0005-Use-list-for-changed-interfaces.patch \ - file://0006-Handle-noisy-netlink-sockets.patch \ - file://0007-Mark-deleted-interfaces-as-being-changed.patch \ - file://0008-Handle-errors-from-socket-calls.patch \ - file://0009-remove-unneeded-headers.patch \ - file://mdns.service \ - file://0015-Add-missing-limits.h.patch \ - file://0001-Handle-interface-without-ifa_addr.patch \ - " -SRCREV = "d5029b5dff8aa59d1fc07ed796e994106ef58dee" - -# We install a stub Makefile in the top directory so that the various checks -# in base.bbclass pass their tests for a Makefile, this ensures (that amongst -# other things) the sstate checks will clean the build directory when the -# task hashes changes. -# -# We can't use the approach of setting ${S} to mDNSPosix as we need -# DEBUG_PREFIX_MAP to cover files which come from the Clients directory too. -S = "${WORKDIR}/git" - -inherit github-releases manpages systemd update-rc.d - -PACKAGECONFIG ?= "tls \ - ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}" -PACKAGECONFIG[debug] = "DEBUG=1,DEBUG=0" -PACKAGECONFIG[ipv6] = "HAVE_IPV6=1,HAVE_IPV6=0" -PACKAGECONFIG[manpages] = "" -PACKAGECONFIG[tls] = ",tls=no,mbedtls" - -CVE_PRODUCT = "apple:mdnsresponder" - -CVE_STATUS[CVE-2007-0613] = "not-applicable-platform: Issue affects Apple products \ -i.e. ichat,mdnsresponder, instant message framework and MacOS. Also, \ -https://www.exploit-db.com/exploits/3230 shows the part of code \ -affected by CVE-2007-0613 which is not preset in upstream source code. \ -Hence, CVE-2007-0613 does not affect other Yocto implementations and \ -is not reported for other distros can be marked whitelisted. \ -Links: https://vulmon.com/vulnerabilitydetails?qid=CVE-2007-0613 \ -https://www.incibe-cert.es/en/early-warning/vulnerabilities/cve-2007-0613 \ -https://security-tracker.debian.org/tracker/CVE-2007-0613 \ -https://vulmon.com/vulnerabilitydetails?qid=CVE-2007-0613" - -PARALLEL_MAKE = "" - -EXTRA_OEMAKE = "os=linux 'CC=${CCLD}' 'LD=${CCLD}' 'LINKOPTS=${LDFLAGS}' STRIP=: ${PACKAGECONFIG_CONFARGS}" - -# MDNS_VERSIONSTR_NODTS disables __DATE__ and __TIME__ in the version string, -# which are fixed anyway for build reproducibility. -TARGET_CPPFLAGS += "-DMDNS_VERSIONSTR_NODTS" - -TARGET_CC_ARCH += "${LDFLAGS}" - -MDNS_BUILDDIR = "build/${@bb.utils.contains('PACKAGECONFIG','debug','debug','prod', d)}" - -do_install () { - cd mDNSPosix - - install -d ${D}${sbindir} - install ${MDNS_BUILDDIR}/mdnsd ${D}${sbindir} - - install -d ${D}${libdir} - install -m 0644 ${MDNS_BUILDDIR}/libdns_sd.so ${D}${libdir}/libdns_sd.so.1 - ln -s libdns_sd.so.1 ${D}${libdir}/libdns_sd.so - - install -d ${D}${includedir} - install -m 0644 ../mDNSShared/dns_sd.h ${D}${includedir} - - install -d ${D}${mandir}/man8 - install -m 0644 ../mDNSShared/mDNSResponder.8 ${D}${mandir}/man8/mdnsd.8 - - install -d ${D}${bindir} - install -m 0755 ../Clients/build/dns-sd ${D}${bindir} - - install -d ${D}${libdir} - oe_libinstall -C ${MDNS_BUILDDIR} -so libnss_mdns-0.2 ${D}${libdir} - ln -s libnss_mdns-0.2.so ${D}${libdir}/libnss_mdns.so.2 - - install -d ${D}${sysconfdir} - install -m 0644 nss_mdns.conf ${D}${sysconfdir} - - install -d ${D}${mandir}/man5 - install -m 0644 nss_mdns.conf.5 ${D}${mandir}/man5 - - install -d ${D}${mandir}/man8 - install -m 0644 libnss_mdns.8 ${D}${mandir}/man8 - - install -d ${D}${systemd_system_unitdir} - install -m 0644 ${WORKDIR}/mdns.service ${D}${systemd_system_unitdir} - - install -d ${D}${INIT_D_DIR} - install mdnsd.sh ${D}${INIT_D_DIR}/mdns -} - -pkg_postinst:${PN} () { - if [ -r $D${sysconfdir}/nsswitch.conf ]; then - sed -e '/^hosts:/s/\s*\//' \ - -e 's/\(^hosts:.*\)\(\\)\(.*\)\(\\)\(.*\)/\1\2 mdns\3\4\5/' \ - -i $D${sysconfdir}/nsswitch.conf - fi -} - -pkg_prerm:${PN} () { - if [ -r $D${sysconfdir}/nsswitch.conf ]; then - sed -e '/^hosts:/s/\s*\//' \ - -e '/^hosts:/s/\s*mdns//' \ - -i $D${sysconfdir}/nsswitch.conf - fi -} - -SYSTEMD_SERVICE:${PN} = "mdns.service" -INITSCRIPT_NAME = "mdns" - -FILES_SOLIBSDEV = "${libdir}/libdns_sd.so" -FILES:${PN} += "${libdir}/libnss_mdns-0.2.so" - -RPROVIDES:${PN} += "libdns_sd.so" diff --git a/meta-networking/recipes-protocols/mdns/mdns_2200.40.37.0.1.bb b/meta-networking/recipes-protocols/mdns/mdns_2200.40.37.0.1.bb new file mode 100644 index 0000000000..af2b337172 --- /dev/null +++ b/meta-networking/recipes-protocols/mdns/mdns_2200.40.37.0.1.bb @@ -0,0 +1,134 @@ +SUMMARY = "Publishes & browses available services on a link according to the Zeroconf / Bonjour protocol" +DESCRIPTION = "Bonjour, also known as zero-configuration networking, enables automatic discovery of computers, devices, and services on IP networks." +HOMEPAGE = "http://developer.apple.com/networking/bonjour/" +LICENSE = "Apache-2.0 & BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=31c50371921e0fb731003bbc665f29bf" + +DEPENDS:append:libc-musl = " musl-nscd" + +SRC_URI = "git://github.com/apple-oss-distributions/mDNSResponder;protocol=https;branch=rel/mDNSResponder-2200 \ + file://0001-dns-sd-Include-missing-headers.patch \ + file://0002-make-Set-libdns_sd.so-soname-correctly.patch \ + file://0004-make-Separate-TLS-targets-from-libraries.patch \ + file://0005-mDNSCore-Fix-broken-debug-parameter.patch \ + file://0006-make-Add-top-level-Makefile.patch \ + file://0001-Create-subroutine-for-cleaning-recent-interfaces.patch \ + file://0002-Create-subroutine-for-tearing-down-an-interface.patch \ + file://0003-Track-interface-socket-family.patch \ + file://0004-Indicate-loopback-interface-to-mDNS-core.patch \ + file://0005-Use-list-for-changed-interfaces.patch \ + file://0006-Handle-noisy-netlink-sockets.patch \ + file://0007-Mark-deleted-interfaces-as-being-changed.patch \ + file://0008-Handle-errors-from-socket-calls.patch \ + file://0009-remove-unneeded-headers.patch \ + file://mdns.service \ + file://0015-Add-missing-limits.h.patch \ + file://0001-Handle-interface-without-ifa_addr.patch \ + " +SRCREV = "a9f4049ab772ca57b5afc9804ae5004beb711d6e" + +# We install a stub Makefile in the top directory so that the various checks +# in base.bbclass pass their tests for a Makefile, this ensures (that amongst +# other things) the sstate checks will clean the build directory when the +# task hashes changes. +# +# We can't use the approach of setting ${S} to mDNSPosix as we need +# DEBUG_PREFIX_MAP to cover files which come from the Clients directory too. +S = "${WORKDIR}/git" + +inherit github-releases manpages systemd update-rc.d + +PACKAGECONFIG ?= "tls \ + ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}" +PACKAGECONFIG[debug] = "DEBUG=1,DEBUG=0" +PACKAGECONFIG[ipv6] = "HAVE_IPV6=1,HAVE_IPV6=0" +PACKAGECONFIG[manpages] = "" +PACKAGECONFIG[tls] = ",tls=no,mbedtls" + +CVE_PRODUCT = "apple:mdnsresponder" + +CVE_STATUS[CVE-2007-0613] = "not-applicable-platform: Issue affects Apple products \ +i.e. ichat,mdnsresponder, instant message framework and MacOS. Also, \ +https://www.exploit-db.com/exploits/3230 shows the part of code \ +affected by CVE-2007-0613 which is not preset in upstream source code. \ +Hence, CVE-2007-0613 does not affect other Yocto implementations and \ +is not reported for other distros can be marked whitelisted. \ +Links: https://vulmon.com/vulnerabilitydetails?qid=CVE-2007-0613 \ +https://www.incibe-cert.es/en/early-warning/vulnerabilities/cve-2007-0613 \ +https://security-tracker.debian.org/tracker/CVE-2007-0613 \ +https://vulmon.com/vulnerabilitydetails?qid=CVE-2007-0613" + +PARALLEL_MAKE = "" + +EXTRA_OEMAKE = "os=linux 'CC=${CCLD}' 'LD=${CCLD}' 'LINKOPTS=${LDFLAGS}' STRIP=: ${PACKAGECONFIG_CONFARGS}" + +# MDNS_VERSIONSTR_NODTS disables __DATE__ and __TIME__ in the version string, +# which are fixed anyway for build reproducibility. +TARGET_CPPFLAGS += "-DMDNS_VERSIONSTR_NODTS" + +TARGET_CC_ARCH += "${LDFLAGS}" + +MDNS_BUILDDIR = "build/${@bb.utils.contains('PACKAGECONFIG','debug','debug','prod', d)}" + +do_install () { + cd mDNSPosix + + install -d ${D}${sbindir} + install ${MDNS_BUILDDIR}/mdnsd ${D}${sbindir} + + install -d ${D}${libdir} + install -m 0644 ${MDNS_BUILDDIR}/libdns_sd.so ${D}${libdir}/libdns_sd.so.1 + ln -s libdns_sd.so.1 ${D}${libdir}/libdns_sd.so + + install -d ${D}${includedir} + install -m 0644 ../mDNSShared/dns_sd.h ${D}${includedir} + + install -d ${D}${mandir}/man8 + install -m 0644 ../mDNSShared/mDNSResponder.8 ${D}${mandir}/man8/mdnsd.8 + + install -d ${D}${bindir} + install -m 0755 ../Clients/build/dns-sd ${D}${bindir} + + install -d ${D}${libdir} + oe_libinstall -C ${MDNS_BUILDDIR} -so libnss_mdns-0.2 ${D}${libdir} + ln -s libnss_mdns-0.2.so ${D}${libdir}/libnss_mdns.so.2 + + install -d ${D}${sysconfdir} + install -m 0644 nss_mdns.conf ${D}${sysconfdir} + + install -d ${D}${mandir}/man5 + install -m 0644 nss_mdns.conf.5 ${D}${mandir}/man5 + + install -d ${D}${mandir}/man8 + install -m 0644 libnss_mdns.8 ${D}${mandir}/man8 + + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${WORKDIR}/mdns.service ${D}${systemd_system_unitdir} + + install -d ${D}${INIT_D_DIR} + install mdnsd.sh ${D}${INIT_D_DIR}/mdns +} + +pkg_postinst:${PN} () { + if [ -r $D${sysconfdir}/nsswitch.conf ]; then + sed -e '/^hosts:/s/\s*\//' \ + -e 's/\(^hosts:.*\)\(\\)\(.*\)\(\\)\(.*\)/\1\2 mdns\3\4\5/' \ + -i $D${sysconfdir}/nsswitch.conf + fi +} + +pkg_prerm:${PN} () { + if [ -r $D${sysconfdir}/nsswitch.conf ]; then + sed -e '/^hosts:/s/\s*\//' \ + -e '/^hosts:/s/\s*mdns//' \ + -i $D${sysconfdir}/nsswitch.conf + fi +} + +SYSTEMD_SERVICE:${PN} = "mdns.service" +INITSCRIPT_NAME = "mdns" + +FILES_SOLIBSDEV = "${libdir}/libdns_sd.so" +FILES:${PN} += "${libdir}/libnss_mdns-0.2.so" + +RPROVIDES:${PN} += "libdns_sd.so" -- cgit v1.2.3-54-g00ecf