diff mbox series

[meta-networking] mdns: Upgrade 2600.100.147 -> 2600.120.12

Message ID 20250527132759.626007-2-alex.kiernan@gmail.com
State Under Review
Headers show
Series [meta-networking] mdns: Upgrade 2600.100.147 -> 2600.120.12 | expand

Commit Message

Alex Kiernan May 27, 2025, 1:27 p.m. UTC
Drop redundant limit declaration patch. Swap issetugid()/getenv() call for
secure_getenv() on Linux.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---
 .../0001-Use-secure_getenv-on-Linux.patch     | 30 ++++++++++++
 .../0005-Fix-missing-limit-declarations.patch | 49 -------------------
 ...ns_2600.100.147.bb => mdns_2600.120.12.bb} |  6 +--
 3 files changed, 33 insertions(+), 52 deletions(-)
 create mode 100644 meta-networking/recipes-protocols/mdns/mdns/0001-Use-secure_getenv-on-Linux.patch
 delete mode 100644 meta-networking/recipes-protocols/mdns/mdns/0005-Fix-missing-limit-declarations.patch
 rename meta-networking/recipes-protocols/mdns/{mdns_2600.100.147.bb => mdns_2600.120.12.bb} (97%)
diff mbox series

Patch

diff --git a/meta-networking/recipes-protocols/mdns/mdns/0001-Use-secure_getenv-on-Linux.patch b/meta-networking/recipes-protocols/mdns/mdns/0001-Use-secure_getenv-on-Linux.patch
new file mode 100644
index 000000000000..242aa7f7d819
--- /dev/null
+++ b/meta-networking/recipes-protocols/mdns/mdns/0001-Use-secure_getenv-on-Linux.patch
@@ -0,0 +1,30 @@ 
+From 1bf3be6cd775635aed95689f97a13fa6a037c741 Mon Sep 17 00:00:00 2001
+From: Alex Kiernan <alex.kiernan@gmail.com>
+Date: Tue, 27 May 2025 13:33:30 +0100
+Subject: [PATCH] Use secure_getenv on Linux
+
+Upstream-Status: Inactive-Upstream [Upstream does not take patches]
+Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
+---
+ mDNSShared/dnssd_clientstub.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/mDNSShared/dnssd_clientstub.c b/mDNSShared/dnssd_clientstub.c
+index 6667276ee33a..e7b51813664e 100644
+--- a/mDNSShared/dnssd_clientstub.c
++++ b/mDNSShared/dnssd_clientstub.c
+@@ -801,10 +801,14 @@ static DNSServiceErrorType ConnectToServer(DNSServiceRef *ref, DNSServiceFlags f
+         #endif
+         #ifndef USE_TCP_LOOPBACK
+         char* uds_serverpath = NULL;
++#ifdef TARGET_OS_LINUX
++        uds_serverpath = secure_getenv(MDNS_UDS_SERVERPATH_ENVVAR);
++#else
+         if (!issetugid())
+         {
+             uds_serverpath = getenv(MDNS_UDS_SERVERPATH_ENVVAR);
+         }
++#endif
+         if (uds_serverpath == NULL)
+             uds_serverpath = MDNS_UDS_SERVERPATH;
+         else if (strlen(uds_serverpath) >= MAX_CTLPATH)
diff --git a/meta-networking/recipes-protocols/mdns/mdns/0005-Fix-missing-limit-declarations.patch b/meta-networking/recipes-protocols/mdns/mdns/0005-Fix-missing-limit-declarations.patch
deleted file mode 100644
index 41b8985e27fb..000000000000
--- a/meta-networking/recipes-protocols/mdns/mdns/0005-Fix-missing-limit-declarations.patch
+++ /dev/null
@@ -1,49 +0,0 @@ 
-From 34285024531adbbc7b67506c9fc2e60f3b36b73b Mon Sep 17 00:00:00 2001
-From: Alex Kiernan <alexk@zuma.ai>
-Date: Sat, 26 Oct 2024 13:26:09 +0000
-Subject: [PATCH] Fix missing `limit` declarations
-
-`put_attribute_tlvs` needs a limit setting which is missing, add it in.
-
-Upstream-Status: Inactive-Upstream [Upstream does not take patches]
-Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
----
- mDNSShared/dnssd_clientstub.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/mDNSShared/dnssd_clientstub.c b/mDNSShared/dnssd_clientstub.c
-index 89cb90d947c7..316fc49ab078 100644
---- a/mDNSShared/dnssd_clientstub.c
-+++ b/mDNSShared/dnssd_clientstub.c
-@@ -2026,6 +2026,7 @@ DNSServiceErrorType DNSServiceRegisterInternal
-     ipc_msg_hdr *hdr;
-     DNSServiceErrorType err;
-     union { uint16_t s; u_char b[2]; } port = { portInNetworkByteOrder };
-+    const uint8_t *limit;
-     (void)attr;
- 
-     if (!sdRef || !regtype) return kDNSServiceErr_BadParam;
-@@ -2050,6 +2051,7 @@ DNSServiceErrorType DNSServiceRegisterInternal
-     if (!hdr) { DNSServiceRefDeallocate(*sdRef); *sdRef = NULL; return kDNSServiceErr_NoMemory; }
-     if (!callBack) hdr->ipc_flags |= IPC_FLAGS_NOREPLY;
- 
-+    limit = ptr + len;
-     put_flags(flags, &ptr);
-     put_uint32(interfaceIndex, &ptr);
-     put_string(name, &ptr);
-@@ -2326,6 +2328,7 @@ DNSServiceErrorType DNSServiceRegisterRecordInternal
-     ipc_msg_hdr *hdr = NULL;
-     DNSRecordRef rref = NULL;
-     DNSRecord **p;
-+    const uint8_t *limit;
-     (void)attr;
- 
-     // Verify that only one of the following flags is set.
-@@ -2375,6 +2378,7 @@ DNSServiceErrorType DNSServiceRegisterRecordInternal
-     hdr = create_hdr(reg_record_request, &len, &ptr, !(flags & kDNSServiceFlagsQueueRequest), sdRef);
-     if (!hdr) return kDNSServiceErr_NoMemory;
- 
-+    limit = ptr + len;
-     put_flags(flags, &ptr);
-     put_uint32(interfaceIndex, &ptr);
-     put_string(fullname, &ptr);
diff --git a/meta-networking/recipes-protocols/mdns/mdns_2600.100.147.bb b/meta-networking/recipes-protocols/mdns/mdns_2600.120.12.bb
similarity index 97%
rename from meta-networking/recipes-protocols/mdns/mdns_2600.100.147.bb
rename to meta-networking/recipes-protocols/mdns/mdns_2600.120.12.bb
index af1400ca6e00..b6efa528d4f6 100644
--- a/meta-networking/recipes-protocols/mdns/mdns_2600.100.147.bb
+++ b/meta-networking/recipes-protocols/mdns/mdns_2600.120.12.bb
@@ -13,12 +13,12 @@  SRC_URI = "git://github.com/apple-oss-distributions/mDNSResponder;protocol=https
            file://0005-mDNSCore-Fix-broken-debug-parameter.patch \
            file://0006-make-Add-top-level-Makefile.patch \
            file://0009-remove-unneeded-headers.patch \
-           file://0005-Fix-missing-limit-declarations.patch \
            file://0001-Fix-build-with-gcc-15.patch \
+           file://0001-Use-secure_getenv-on-Linux.patch \
            file://mdns.service \
            "
-BRANCH = "main"
-SRCREV = "d89f8d1d0e001b810d6c055aa2a57b768bcf9aa2"
+BRANCH = "rel/mDNSResponder-2600"
+SRCREV = "3a0deda2995d98243dae379bcec10e57928c15e8"
 
 # 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