From 8ffef53d6a491e154d9cbc83b766e65825120c80 Mon Sep 17 00:00:00 2001 From: Alex Kiernan Date: Wed, 27 Sep 2023 13:02:18 +0100 Subject: mdns: Upgrade 1790.80.10 -> 2200.0.8 Signed-off-by: Alex Kiernan Signed-off-by: Khem Raj --- .../0001-Handle-interface-without-ifa_addr.patch | 38 ++++++ ...red-Drop-MacOS-specific-__block-qualifier.patch | 30 ----- .../0005-mDNSCore-Fix-broken-debug-parameter.patch | 17 ++- .../mdns/mdns/0015-Add-missing-limits.h.patch | 23 ++++ .../recipes-protocols/mdns/mdns_1790.80.10.bb | 133 -------------------- .../recipes-protocols/mdns/mdns_2200.0.8.bb | 134 +++++++++++++++++++++ 6 files changed, 202 insertions(+), 173 deletions(-) create mode 100644 meta-networking/recipes-protocols/mdns/mdns/0001-Handle-interface-without-ifa_addr.patch delete mode 100644 meta-networking/recipes-protocols/mdns/mdns/0003-mDNSShared-Drop-MacOS-specific-__block-qualifier.patch create mode 100644 meta-networking/recipes-protocols/mdns/mdns/0015-Add-missing-limits.h.patch delete mode 100644 meta-networking/recipes-protocols/mdns/mdns_1790.80.10.bb create mode 100644 meta-networking/recipes-protocols/mdns/mdns_2200.0.8.bb (limited to 'meta-networking') 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 new file mode 100644 index 000000000..daee318ae --- /dev/null +++ b/meta-networking/recipes-protocols/mdns/mdns/0001-Handle-interface-without-ifa_addr.patch @@ -0,0 +1,38 @@ +From 1cc54320306e07c1fc0eed98e7fbcbb07a2f3b28 Mon Sep 17 00:00:00 2001 +From: Stefan Agner +Date: Fri, 23 Jun 2023 10:10:00 +0200 +Subject: [PATCH] Handle interface without `ifa_addr` + +It seems that certain interface types may have `ifa_addr` set to null. +Handle this case gracefully. + +Upstream-Status: Submitted [https://github.com/apple-oss-distributions/mDNSResponder/pull/2/commits/11b410d4d683c90e693c40315997bb3e8ec90e9a] + +Signed-off-by: Stefan Agner +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) + continue; + + if ((ifa_loop4 == NULL) && ++ ((*ifi)->ifa_addr != NULL) && + ((*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) + continue; + } + +- if ( (((*ifi)->ifa_addr->sa_family == AF_INET) ++ if ( ((*ifi)->ifa_addr != NULL) && ++ (((*ifi)->ifa_addr->sa_family == AF_INET) + #if HAVE_IPV6 + || ((*ifi)->ifa_addr->sa_family == AF_INET6) + #endif diff --git a/meta-networking/recipes-protocols/mdns/mdns/0003-mDNSShared-Drop-MacOS-specific-__block-qualifier.patch b/meta-networking/recipes-protocols/mdns/mdns/0003-mDNSShared-Drop-MacOS-specific-__block-qualifier.patch deleted file mode 100644 index 0ac0bb6a4..000000000 --- a/meta-networking/recipes-protocols/mdns/mdns/0003-mDNSShared-Drop-MacOS-specific-__block-qualifier.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 4c0954f77ba05d77192ee1519929a39fbc978321 Mon Sep 17 00:00:00 2001 -From: Alex Kiernan -Date: Mon, 5 Dec 2022 15:14:22 +0000 -Subject: [PATCH 3/6] mDNSShared: Drop MacOS specific __block qualifier - -Support for this extension only exists in MacOS/Clang, also it's not -actually used here, so we can just drop it. - -Upstream-Status: Pending -Signed-off-by: Alex Kiernan ---- - mDNSShared/uds_daemon.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/mDNSShared/uds_daemon.c b/mDNSShared/uds_daemon.c -index 9ae5f78542d6..8c006b71a4ea 100644 ---- a/mDNSShared/uds_daemon.c -+++ b/mDNSShared/uds_daemon.c -@@ -2912,7 +2912,7 @@ exit: - mDNSlocal mStatus add_domain_to_browser(request_state *info, const domainname *d) - { - browser_t *b, *p; -- __block mStatus err; -+ mStatus err; - - for (p = info->u.browser.browsers; p; p = p->next) - { --- -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 39e67cdf4..4cda71bdb 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 @@ -1,28 +1,25 @@ -From 60533a8947af714cc593bae6b20d47f3a4828589 Mon Sep 17 00:00:00 2001 +From 764b6202402e9e5687ff873330e5ad6be6f69df7 Mon Sep 17 00:00:00 2001 From: Alex Kiernan Date: Mon, 5 Dec 2022 22:49:49 +0000 -Subject: [PATCH 5/6] mDNSCore: Fix broken debug parameter +Subject: [PATCH] mDNSCore: Fix broken debug parameter -Signed-off-by: Alex Kiernan ---- Upstream-Status: Pending +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 66979587ee82..e0a982fa1762 100644 +index eecd7daa724e..1e843c081938 100644 --- a/mDNSCore/mDNS.c +++ b/mDNSCore/mDNS.c -@@ -9831,7 +9831,7 @@ mDNSlocal void mDNSCoreReceiveNoUnicastAnswers(mDNS *const m, const DNSMessage * +@@ -10210,7 +10210,7 @@ mDNSlocal void mDNSCoreReceiveNoUnicastAnswers(mDNS *const m, const DNSMessage * #else const DNSServRef dnsserv = qptr->qDNSServer; #endif -- debugf("mDNSCoreReceiveNoUnicastAnswers making negative cache entry TTL %d for %##s (%s)", negttl, name->c, DNSTypeName(q.qtype)); +- debugf("mDNSCoreReceiveNoUnicastAnswers making negative cache entry TTL %d for %##s (%s)", negttl, currentQName, DNSTypeName(q.qtype)); + debugf("mDNSCoreReceiveNoUnicastAnswers making negative cache entry TTL %d for %##s (%s)", negttl, currentQName->c, DNSTypeName(q.qtype)); // Create a negative record for the current name in the CNAME chain. MakeNegativeCacheRecord(m, &m->rec.r, currentQName, currentQNameHash, q.qtype, q.qclass, negttl, mDNSInterface_Any, dnsserv, response->h.flags); --- -2.35.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 new file mode 100644 index 000000000..9fe721ff0 --- /dev/null +++ b/meta-networking/recipes-protocols/mdns/mdns/0015-Add-missing-limits.h.patch @@ -0,0 +1,23 @@ +From 9fc45a2cf3b78573a568abf538a6e6f4bd30b2d7 Mon Sep 17 00:00:00 2001 +From: Alex Kiernan +Date: Wed, 27 Sep 2023 11:45:26 +0100 +Subject: [PATCH] Add missing limits.h + +Upstream-Status: Pending +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 +@@ -32,6 +32,7 @@ + #include + #include // Needed for #include (). + #include ++#include + + + #include "mDNSEmbeddedAPI.h" // Defines the interface provided to the client layer above diff --git a/meta-networking/recipes-protocols/mdns/mdns_1790.80.10.bb b/meta-networking/recipes-protocols/mdns/mdns_1790.80.10.bb deleted file mode 100644 index aff7954f5..000000000 --- a/meta-networking/recipes-protocols/mdns/mdns_1790.80.10.bb +++ /dev/null @@ -1,133 +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=rel/mDNSResponder-1790 \ - file://0001-dns-sd-Include-missing-headers.patch \ - file://0002-make-Set-libdns_sd.so-soname-correctly.patch \ - file://0003-mDNSShared-Drop-MacOS-specific-__block-qualifier.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 \ - " -SRCREV = "8769ab51605e465425d33d757f602ce5905ca639" - -# 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.0.8.bb b/meta-networking/recipes-protocols/mdns/mdns_2200.0.8.bb new file mode 100644 index 000000000..8370ed50c --- /dev/null +++ b/meta-networking/recipes-protocols/mdns/mdns_2200.0.8.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=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" -- cgit v1.2.3-54-g00ecf