diff options
Diffstat (limited to 'meta-networking/recipes-protocols/mdns')
20 files changed, 117 insertions, 878 deletions
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 deleted file mode 100644 index f5d424d58f..0000000000 --- a/meta-networking/recipes-protocols/mdns/mdns/0001-Create-subroutine-for-cleaning-recent-interfaces.patch +++ /dev/null | |||
@@ -1,58 +0,0 @@ | |||
1 | From c1f3e19d3cb0aa948248616eb1684a1e80aa39b4 Mon Sep 17 00:00:00 2001 | ||
2 | From: Nate Karstens <nate.karstens@garmin.com> | ||
3 | Date: Wed, 28 Jun 2017 17:30:00 -0500 | ||
4 | Subject: [PATCH 1/8] Create subroutine for cleaning recent interfaces | ||
5 | |||
6 | Moves functionality for cleaning the list of recent | ||
7 | interfaces into its own subroutine. | ||
8 | |||
9 | Upstream-Status: Submitted [dts@apple.com] | ||
10 | |||
11 | Signed-off-by: Nate Karstens <nate.karstens@garmin.com> | ||
12 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> | ||
13 | --- | ||
14 | mDNSPosix/mDNSPosix.c | 24 ++++++++++++++---------- | ||
15 | 1 file changed, 14 insertions(+), 10 deletions(-) | ||
16 | |||
17 | Index: mDNSResponder/mDNSPosix/mDNSPosix.c | ||
18 | =================================================================== | ||
19 | --- mDNSResponder.orig/mDNSPosix/mDNSPosix.c | ||
20 | +++ mDNSResponder/mDNSPosix/mDNSPosix.c | ||
21 | @@ -1322,6 +1322,19 @@ mDNSlocal int SetupSocket(struct sockadd | ||
22 | return err; | ||
23 | } | ||
24 | |||
25 | +// Clean up any interfaces that have been hanging around on the RecentInterfaces list for more than a minute | ||
26 | +mDNSlocal void CleanRecentInterfaces(void) | ||
27 | +{ | ||
28 | + PosixNetworkInterface **ri = &gRecentInterfaces; | ||
29 | + const mDNSs32 utc = mDNSPlatformUTC(); | ||
30 | + while (*ri) | ||
31 | + { | ||
32 | + PosixNetworkInterface *pi = *ri; | ||
33 | + if (utc - pi->LastSeen < 60) ri = (PosixNetworkInterface **)&pi->coreIntf.next; | ||
34 | + else { *ri = (PosixNetworkInterface *)pi->coreIntf.next; mdns_free(pi); } | ||
35 | + } | ||
36 | +} | ||
37 | + | ||
38 | // Creates a PosixNetworkInterface for the interface whose IP address is | ||
39 | // intfAddr and whose name is intfName and registers it with mDNS core. | ||
40 | mDNSlocal int SetupOneInterface(mDNS *const m, struct sockaddr *intfAddr, struct sockaddr *intfMask, | ||
41 | @@ -1559,16 +1572,7 @@ mDNSlocal int SetupInterfaceList(mDNS *c | ||
42 | |||
43 | // Clean up. | ||
44 | if (intfList != NULL) freeifaddrs(intfList); | ||
45 | - | ||
46 | - // Clean up any interfaces that have been hanging around on the RecentInterfaces list for more than a minute | ||
47 | - PosixNetworkInterface **ri = &gRecentInterfaces; | ||
48 | - const mDNSs32 utc = mDNSPlatformUTC(); | ||
49 | - while (*ri) | ||
50 | - { | ||
51 | - PosixNetworkInterface *pi = *ri; | ||
52 | - if (utc - pi->LastSeen < 60) ri = (PosixNetworkInterface **)&pi->coreIntf.next; | ||
53 | - else { *ri = (PosixNetworkInterface *)pi->coreIntf.next; mdns_free(pi); } | ||
54 | - } | ||
55 | + CleanRecentInterfaces(); | ||
56 | |||
57 | return err; | ||
58 | } | ||
diff --git a/meta-networking/recipes-protocols/mdns/mdns/0001-Fix-SIGSEGV-during-DumpStateLog.patch b/meta-networking/recipes-protocols/mdns/mdns/0001-Fix-SIGSEGV-during-DumpStateLog.patch deleted file mode 100644 index 4b0227f1dc..0000000000 --- a/meta-networking/recipes-protocols/mdns/mdns/0001-Fix-SIGSEGV-during-DumpStateLog.patch +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | From 14cc53bb09a3d8adf301f3842c765598467e63e1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alex Kiernan <alex.kiernan@gmail.com> | ||
3 | Date: Thu, 1 Feb 2024 14:07:03 +0000 | ||
4 | Subject: [PATCH] Fix SIGSEGV during DumpStateLog() | ||
5 | |||
6 | DumpStateLog() calls LogMsgWithLevelv() with category == NULL, avoid | ||
7 | crashing in this case. | ||
8 | |||
9 | Upstream-Status: Inactive-Upstream [Upstream does not take patches] | ||
10 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> | ||
11 | --- | ||
12 | mDNSShared/mDNSDebug.c | 2 +- | ||
13 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
14 | |||
15 | diff --git a/mDNSShared/mDNSDebug.c b/mDNSShared/mDNSDebug.c | ||
16 | index 7a4ca19eff6d..d449dde320f6 100644 | ||
17 | --- a/mDNSShared/mDNSDebug.c | ||
18 | +++ b/mDNSShared/mDNSDebug.c | ||
19 | @@ -71,7 +71,7 @@ mDNSlocal void LogMsgWithLevelv(os_log_t category, os_log_type_t level, const ch | ||
20 | mDNSlocal void LogMsgWithLevelv(const char *category, mDNSLogLevel_t level, const char *format, va_list args) | ||
21 | { | ||
22 | // Do not print the logs if the log category is MDNS_LOG_CATEGORY_DISABLED. | ||
23 | - if (strcmp(category, MDNS_LOG_CATEGORY_DISABLED) == 0) | ||
24 | + if (category && strcmp(category, MDNS_LOG_CATEGORY_DISABLED) == 0) | ||
25 | { | ||
26 | return; | ||
27 | } | ||
28 | -- | ||
29 | 2.39.0 | ||
30 | |||
diff --git a/meta-networking/recipes-protocols/mdns/mdns/0001-Fix-build-with-gcc-15.patch b/meta-networking/recipes-protocols/mdns/mdns/0001-Fix-build-with-gcc-15.patch new file mode 100644 index 0000000000..af33d5444c --- /dev/null +++ b/meta-networking/recipes-protocols/mdns/mdns/0001-Fix-build-with-gcc-15.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From c84f185f29d0839b97177aecb0a78b9717947973 Mon Sep 17 00:00:00 2001 | ||
2 | From: Nguyen Dat Tho <tho3.nguyen@lge.com> | ||
3 | Date: Wed, 9 Apr 2025 13:05:24 +0900 | ||
4 | Subject: [PATCH] Fix build with gcc-15 | ||
5 | |||
6 | To fix error: | ||
7 | In file included from ../mDNSCore/mDNS.c:76: | ||
8 | ../mDNSShared/CommonServices.h:856:13: error: 'bool' cannot be defined via 'typedef' | ||
9 | 856 | typedef int bool; | ||
10 | | ^~~~ | ||
11 | ../mDNSShared/CommonServices.h:856:13: note: 'bool' is a keyword with '-std=c23' onwards | ||
12 | ../mDNSShared/CommonServices.h:856:1: warning: useless type name in empty declaration | ||
13 | |||
14 | Upstream-Status: Pending (An owner of this repository has limited the ability to open a pull request to users that are collaborators on this repository.) | ||
15 | |||
16 | Signed-off-by: Nguyen Dat Tho <tho3.nguyen@lge.com> | ||
17 | --- | ||
18 | mDNSShared/CommonServices.h | 3 +++ | ||
19 | 1 file changed, 3 insertions(+) | ||
20 | |||
21 | diff --git a/mDNSShared/CommonServices.h b/mDNSShared/CommonServices.h | ||
22 | index 7efb077f3b04..f0f3a8b3157e 100644 | ||
23 | --- a/mDNSShared/CommonServices.h | ||
24 | +++ b/mDNSShared/CommonServices.h | ||
25 | @@ -192,6 +192,9 @@ extern "C" { | ||
26 | |||
27 | #include <stdint.h> | ||
28 | #include <arpa/inet.h> | ||
29 | +#if defined __STDC__ && defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L | ||
30 | + #include <stdbool.h> | ||
31 | +#endif | ||
32 | |||
33 | #elif ( TARGET_OS_SOLARIS ) | ||
34 | |||
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 deleted file mode 100644 index 7e76f07c0e..0000000000 --- a/meta-networking/recipes-protocols/mdns/mdns/0001-Handle-interface-without-ifa_addr.patch +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | From 1cc54320306e07c1fc0eed98e7fbcbb07a2f3b28 Mon Sep 17 00:00:00 2001 | ||
2 | From: Stefan Agner <stefan@agner.ch> | ||
3 | Date: Fri, 23 Jun 2023 10:10:00 +0200 | ||
4 | Subject: [PATCH] Handle interface without `ifa_addr` | ||
5 | |||
6 | It seems that certain interface types may have `ifa_addr` set to null. | ||
7 | Handle this case gracefully. | ||
8 | |||
9 | Upstream-Status: Submitted [https://github.com/apple-oss-distributions/mDNSResponder/pull/2/commits/11b410d4d683c90e693c40315997bb3e8ec90e9a] | ||
10 | |||
11 | Signed-off-by: Stefan Agner <stefan@agner.ch> | ||
12 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> | ||
13 | --- | ||
14 | mDNSPosix/mDNSPosix.c | 4 +++- | ||
15 | 1 file changed, 3 insertions(+), 1 deletion(-) | ||
16 | |||
17 | Index: mDNSResponder/mDNSPosix/mDNSPosix.c | ||
18 | =================================================================== | ||
19 | --- mDNSResponder.orig/mDNSPosix/mDNSPosix.c | ||
20 | +++ mDNSResponder/mDNSPosix/mDNSPosix.c | ||
21 | @@ -1895,6 +1895,7 @@ mDNSlocal void InterfaceChangeCallback(i | ||
22 | continue; | ||
23 | |||
24 | if ((ifa_loop4 == NULL) && | ||
25 | + ((*ifi)->ifa_addr != NULL) && | ||
26 | ((*ifi)->ifa_addr->sa_family == AF_INET) && | ||
27 | ((*ifi)->ifa_flags & IFF_UP) && | ||
28 | ((*ifi)->ifa_flags & IFF_LOOPBACK)) | ||
29 | @@ -1903,7 +1904,8 @@ mDNSlocal void InterfaceChangeCallback(i | ||
30 | continue; | ||
31 | } | ||
32 | |||
33 | - if ( (((*ifi)->ifa_addr->sa_family == AF_INET) | ||
34 | + if ( ((*ifi)->ifa_addr != NULL) && | ||
35 | + (((*ifi)->ifa_addr->sa_family == AF_INET) | ||
36 | #if HAVE_IPV6 | ||
37 | || ((*ifi)->ifa_addr->sa_family == AF_INET6) | ||
38 | #endif | ||
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 0000000000..242aa7f7d8 --- /dev/null +++ b/meta-networking/recipes-protocols/mdns/mdns/0001-Use-secure_getenv-on-Linux.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | From 1bf3be6cd775635aed95689f97a13fa6a037c741 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alex Kiernan <alex.kiernan@gmail.com> | ||
3 | Date: Tue, 27 May 2025 13:33:30 +0100 | ||
4 | Subject: [PATCH] Use secure_getenv on Linux | ||
5 | |||
6 | Upstream-Status: Inactive-Upstream [Upstream does not take patches] | ||
7 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> | ||
8 | --- | ||
9 | mDNSShared/dnssd_clientstub.c | 4 ++++ | ||
10 | 1 file changed, 4 insertions(+) | ||
11 | |||
12 | diff --git a/mDNSShared/dnssd_clientstub.c b/mDNSShared/dnssd_clientstub.c | ||
13 | index 6667276ee33a..e7b51813664e 100644 | ||
14 | --- a/mDNSShared/dnssd_clientstub.c | ||
15 | +++ b/mDNSShared/dnssd_clientstub.c | ||
16 | @@ -801,10 +801,14 @@ static DNSServiceErrorType ConnectToServer(DNSServiceRef *ref, DNSServiceFlags f | ||
17 | #endif | ||
18 | #ifndef USE_TCP_LOOPBACK | ||
19 | char* uds_serverpath = NULL; | ||
20 | +#ifdef TARGET_OS_LINUX | ||
21 | + uds_serverpath = secure_getenv(MDNS_UDS_SERVERPATH_ENVVAR); | ||
22 | +#else | ||
23 | if (!issetugid()) | ||
24 | { | ||
25 | uds_serverpath = getenv(MDNS_UDS_SERVERPATH_ENVVAR); | ||
26 | } | ||
27 | +#endif | ||
28 | if (uds_serverpath == NULL) | ||
29 | uds_serverpath = MDNS_UDS_SERVERPATH; | ||
30 | else if (strlen(uds_serverpath) >= MAX_CTLPATH) | ||
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 82825b294d..651879ea86 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 | |||
@@ -1,7 +1,7 @@ | |||
1 | From cea342c10731cb1c8c8b52f03d55f9d15fc3b091 Mon Sep 17 00:00:00 2001 | 1 | From cdbc28c668dd627906f833f9a8e32ac53b0b0139 Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Thu, 4 Nov 2021 07:31:32 -0700 | 3 | Date: Thu, 4 Nov 2021 07:31:32 -0700 |
4 | Subject: [PATCH 1/6] dns-sd: Include missing headers | 4 | Subject: [PATCH] dns-sd: Include missing headers |
5 | 5 | ||
6 | Fixes build on Musl | 6 | Fixes build on Musl |
7 | 7 | ||
@@ -11,10 +11,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> | |||
11 | mDNSPosix/nss_mdns.c | 3 +++ | 11 | mDNSPosix/nss_mdns.c | 3 +++ |
12 | 1 file changed, 3 insertions(+) | 12 | 1 file changed, 3 insertions(+) |
13 | 13 | ||
14 | Index: mDNSResponder/mDNSPosix/nss_mdns.c | 14 | diff --git a/mDNSPosix/nss_mdns.c b/mDNSPosix/nss_mdns.c |
15 | =================================================================== | 15 | index afadb3c6c33b..84c312759463 100644 |
16 | --- mDNSResponder.orig/mDNSPosix/nss_mdns.c | 16 | --- a/mDNSPosix/nss_mdns.c |
17 | +++ mDNSResponder/mDNSPosix/nss_mdns.c | 17 | +++ b/mDNSPosix/nss_mdns.c |
18 | @@ -89,6 +89,9 @@ | 18 | @@ -89,6 +89,9 @@ |
19 | 19 | ||
20 | #include <dns_sd.h> | 20 | #include <dns_sd.h> |
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 deleted file mode 100644 index 867db88a50..0000000000 --- a/meta-networking/recipes-protocols/mdns/mdns/0002-Create-subroutine-for-tearing-down-an-interface.patch +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | From 40ef0241afbb49f84e76afd65eb3ee17466bb582 Mon Sep 17 00:00:00 2001 | ||
2 | From: Nate Karstens <nate.karstens@garmin.com> | ||
3 | Date: Wed, 28 Jun 2017 17:30:00 -0500 | ||
4 | Subject: [PATCH 2/8] Create subroutine for tearing down an interface | ||
5 | |||
6 | Creates a subroutine for tearing down an interface. | ||
7 | |||
8 | Upstream-Status: Submitted [dts@apple.com] | ||
9 | |||
10 | Signed-off-by: Nate Karstens <nate.karstens@garmin.com> | ||
11 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> | ||
12 | --- | ||
13 | mDNSPosix/mDNSPosix.c | 22 ++++++++++++++++------ | ||
14 | 1 file changed, 16 insertions(+), 6 deletions(-) | ||
15 | |||
16 | Index: mDNSResponder/mDNSPosix/mDNSPosix.c | ||
17 | =================================================================== | ||
18 | --- mDNSResponder.orig/mDNSPosix/mDNSPosix.c | ||
19 | +++ mDNSResponder/mDNSPosix/mDNSPosix.c | ||
20 | @@ -1043,6 +1043,19 @@ mDNSlocal void FreePosixNetworkInterface | ||
21 | gRecentInterfaces = intf; | ||
22 | } | ||
23 | |||
24 | +mDNSlocal void TearDownInterface(mDNS *const m, PosixNetworkInterface *intf) | ||
25 | +{ | ||
26 | + mDNS_DeregisterInterface(m, &intf->coreIntf, NormalActivation); | ||
27 | + if (gMDNSPlatformPosixVerboseLevel > 0) fprintf(stderr, "Deregistered interface %s\n", intf->intfName); | ||
28 | + FreePosixNetworkInterface(intf); | ||
29 | + | ||
30 | + num_registered_interfaces--; | ||
31 | + if (num_registered_interfaces == 0) { | ||
32 | + num_pkts_accepted = 0; | ||
33 | + num_pkts_rejected = 0; | ||
34 | + } | ||
35 | +} | ||
36 | + | ||
37 | // Grab the first interface, deregister it, free it, and repeat until done. | ||
38 | mDNSlocal void ClearInterfaceList(mDNS *const m) | ||
39 | { | ||
40 | @@ -1051,13 +1064,10 @@ mDNSlocal void ClearInterfaceList(mDNS * | ||
41 | while (m->HostInterfaces) | ||
42 | { | ||
43 | PosixNetworkInterface *intf = (PosixNetworkInterface*)(m->HostInterfaces); | ||
44 | - mDNS_DeregisterInterface(m, &intf->coreIntf, NormalActivation); | ||
45 | - if (gMDNSPlatformPosixVerboseLevel > 0) fprintf(stderr, "Deregistered interface %s\n", intf->intfName); | ||
46 | - FreePosixNetworkInterface(intf); | ||
47 | + TearDownInterface(m, intf); | ||
48 | } | ||
49 | - num_registered_interfaces = 0; | ||
50 | - num_pkts_accepted = 0; | ||
51 | - num_pkts_rejected = 0; | ||
52 | + | ||
53 | + assert(num_registered_interfaces == 0); | ||
54 | } | ||
55 | |||
56 | mDNSlocal int SetupIPv6Socket(int fd) | ||
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 03fb1bc0d7..abe8178f63 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 | |||
@@ -1,7 +1,7 @@ | |||
1 | From a198bcd457abd04f2e22812ff3a37246aa564614 Mon Sep 17 00:00:00 2001 | 1 | From dcc1f39a0918cdebf53ac7c105b3d33df960ed14 Mon Sep 17 00:00:00 2001 |
2 | From: Alex Kiernan <alex.kiernan@gmail.com> | 2 | From: Alex Kiernan <alex.kiernan@gmail.com> |
3 | Date: Mon, 5 Dec 2022 15:14:12 +0000 | 3 | Date: Mon, 5 Dec 2022 15:14:12 +0000 |
4 | Subject: [PATCH 2/6] make: Set libdns_sd.so soname correctly | 4 | Subject: [PATCH] make: Set libdns_sd.so soname correctly |
5 | 5 | ||
6 | Upstream-Status: Pending | 6 | Upstream-Status: Pending |
7 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> | 7 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> |
@@ -9,11 +9,11 @@ Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> | |||
9 | mDNSPosix/Makefile | 2 +- | 9 | mDNSPosix/Makefile | 2 +- |
10 | 1 file changed, 1 insertion(+), 1 deletion(-) | 10 | 1 file changed, 1 insertion(+), 1 deletion(-) |
11 | 11 | ||
12 | Index: mDNSResponder/mDNSPosix/Makefile | 12 | diff --git a/mDNSPosix/Makefile b/mDNSPosix/Makefile |
13 | =================================================================== | 13 | index e05ba10b4340..7c510317f1b6 100755 |
14 | --- mDNSResponder.orig/mDNSPosix/Makefile | 14 | --- a/mDNSPosix/Makefile |
15 | +++ mDNSResponder/mDNSPosix/Makefile | 15 | +++ b/mDNSPosix/Makefile |
16 | @@ -276,7 +276,7 @@ libdns_sd: setup $(BUILDDIR)/libdns_sd.$ | 16 | @@ -276,7 +276,7 @@ libdns_sd: setup $(BUILDDIR)/libdns_sd.$(LDSUFFIX) |
17 | 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 | 17 | 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 |
18 | 18 | ||
19 | $(BUILDDIR)/libdns_sd.$(LDSUFFIX): $(CLIENTLIBOBJS) | 19 | $(BUILDDIR)/libdns_sd.$(LDSUFFIX): $(CLIENTLIBOBJS) |
@@ -21,4 +21,4 @@ Index: mDNSResponder/mDNSPosix/Makefile | |||
21 | + $(LD) $(SOOPTS) $(LINKOPTS) -Wl,-soname,libdns_sd.$(LDSUFFIX).1 -o $@ $+ | 21 | + $(LD) $(SOOPTS) $(LINKOPTS) -Wl,-soname,libdns_sd.$(LDSUFFIX).1 -o $@ $+ |
22 | $(STRIP) $@ | 22 | $(STRIP) $@ |
23 | 23 | ||
24 | Clients: setup libdns_sd ../Clients/build/dns-sd | 24 | Clients: setup ../Clients/build/dns-sd |
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 deleted file mode 100644 index f1cda2b895..0000000000 --- a/meta-networking/recipes-protocols/mdns/mdns/0003-Track-interface-socket-family.patch +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | From deb3a2c51f32e0d2741be11a492e727129f770e2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Nate Karstens <nate.karstens@garmin.com> | ||
3 | Date: Wed, 28 Jun 2017 17:30:00 -0500 | ||
4 | Subject: [PATCH 3/8] Track interface socket family | ||
5 | |||
6 | Tracks the socket family associated with the interface. | ||
7 | |||
8 | Upstream-Status: Submitted [dts@apple.com] | ||
9 | |||
10 | Signed-off-by: Nate Karstens <nate.karstens@garmin.com> | ||
11 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> | ||
12 | --- | ||
13 | mDNSPosix/mDNSPosix.c | 1 + | ||
14 | mDNSPosix/mDNSPosix.h | 2 ++ | ||
15 | 2 files changed, 3 insertions(+) | ||
16 | |||
17 | Index: mDNSResponder/mDNSPosix/mDNSPosix.c | ||
18 | =================================================================== | ||
19 | --- mDNSResponder.orig/mDNSPosix/mDNSPosix.c | ||
20 | +++ mDNSResponder/mDNSPosix/mDNSPosix.c | ||
21 | @@ -1415,6 +1415,7 @@ mDNSlocal int SetupOneInterface(mDNS *co | ||
22 | // Set up the extra fields in PosixNetworkInterface. | ||
23 | assert(intf->intfName != NULL); // intf->intfName already set up above | ||
24 | intf->index = intfIndex; | ||
25 | + intf->sa_family = intfAddr->sa_family; | ||
26 | intf->multicastSocket4 = -1; | ||
27 | #if HAVE_IPV6 | ||
28 | intf->multicastSocket6 = -1; | ||
29 | Index: mDNSResponder/mDNSPosix/mDNSPosix.h | ||
30 | =================================================================== | ||
31 | --- mDNSResponder.orig/mDNSPosix/mDNSPosix.h | ||
32 | +++ mDNSResponder/mDNSPosix/mDNSPosix.h | ||
33 | @@ -19,6 +19,7 @@ | ||
34 | #define __mDNSPlatformPosix_h | ||
35 | |||
36 | #include <signal.h> | ||
37 | +#include <sys/socket.h> | ||
38 | #include <sys/time.h> | ||
39 | |||
40 | #ifdef __cplusplus | ||
41 | @@ -40,6 +41,7 @@ struct PosixNetworkInterface | ||
42 | char * intfName; | ||
43 | PosixNetworkInterface * aliasIntf; | ||
44 | int index; | ||
45 | + sa_family_t sa_family; | ||
46 | int multicastSocket4; | ||
47 | #if HAVE_IPV6 | ||
48 | int multicastSocket6; | ||
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 deleted file mode 100644 index 6bc36456f6..0000000000 --- a/meta-networking/recipes-protocols/mdns/mdns/0004-Indicate-loopback-interface-to-mDNS-core.patch +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | From beab76b5708862f44d9acbe7a92db45e2f99259f Mon Sep 17 00:00:00 2001 | ||
2 | From: Nate Karstens <nate.karstens@garmin.com> | ||
3 | Date: Tue, 1 Aug 2017 17:06:01 -0500 | ||
4 | Subject: [PATCH 4/8] Indicate loopback interface to mDNS core | ||
5 | |||
6 | Tells the mDNS core if an interface is a loopback interface, | ||
7 | similar to AddInterfaceToList() in the MacOS implementation. | ||
8 | |||
9 | Upstream-Status: Submitted [dts@apple.com] | ||
10 | |||
11 | Signed-off-by: Nate Karstens <nate.karstens@garmin.com> | ||
12 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> | ||
13 | --- | ||
14 | mDNSPosix/mDNSPosix.c | 7 ++++--- | ||
15 | 1 file changed, 4 insertions(+), 3 deletions(-) | ||
16 | |||
17 | Index: mDNSResponder/mDNSPosix/mDNSPosix.c | ||
18 | =================================================================== | ||
19 | --- mDNSResponder.orig/mDNSPosix/mDNSPosix.c | ||
20 | +++ mDNSResponder/mDNSPosix/mDNSPosix.c | ||
21 | @@ -1348,7 +1348,7 @@ mDNSlocal void CleanRecentInterfaces(voi | ||
22 | // Creates a PosixNetworkInterface for the interface whose IP address is | ||
23 | // intfAddr and whose name is intfName and registers it with mDNS core. | ||
24 | mDNSlocal int SetupOneInterface(mDNS *const m, struct sockaddr *intfAddr, struct sockaddr *intfMask, | ||
25 | - const mDNSu8 *intfHaddr, mDNSu16 intfHlen, const char *intfName, int intfIndex) | ||
26 | + const mDNSu8 *intfHaddr, mDNSu16 intfHlen, const char *intfName, int intfIndex, int intfFlags) | ||
27 | { | ||
28 | int err = 0; | ||
29 | PosixNetworkInterface *intf; | ||
30 | @@ -1411,6 +1411,7 @@ mDNSlocal int SetupOneInterface(mDNS *co | ||
31 | |||
32 | intf->coreIntf.Advertise = m->AdvertiseLocalAddresses; | ||
33 | intf->coreIntf.McastTxRx = mDNStrue; | ||
34 | + intf->coreIntf.Loopback = ((intfFlags & IFF_LOOPBACK) != 0) ? mDNStrue : mDNSfalse; | ||
35 | |||
36 | // Set up the extra fields in PosixNetworkInterface. | ||
37 | assert(intf->intfName != NULL); // intf->intfName already set up above | ||
38 | @@ -1561,7 +1562,7 @@ mDNSlocal int SetupInterfaceList(mDNS *c | ||
39 | } | ||
40 | #endif | ||
41 | if (SetupOneInterface(m, i->ifa_addr, i->ifa_netmask, | ||
42 | - hwaddr, hwaddr_len, i->ifa_name, ifIndex) == 0) | ||
43 | + hwaddr, hwaddr_len, i->ifa_name, ifIndex, i->ifa_flags) == 0) | ||
44 | { | ||
45 | if (i->ifa_addr->sa_family == AF_INET) | ||
46 | foundav4 = mDNStrue; | ||
47 | @@ -1578,7 +1579,7 @@ mDNSlocal int SetupInterfaceList(mDNS *c | ||
48 | // if ((m->HostInterfaces == NULL) && (firstLoopback != NULL)) | ||
49 | if (!foundav4 && firstLoopback) | ||
50 | (void) SetupOneInterface(m, firstLoopback->ifa_addr, firstLoopback->ifa_netmask, | ||
51 | - NULL, 0, firstLoopback->ifa_name, firstLoopbackIndex); | ||
52 | + NULL, 0, firstLoopback->ifa_name, firstLoopbackIndex, firstLoopback->ifa_flags); | ||
53 | } | ||
54 | |||
55 | // Clean up. | ||
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 837580ac36..af27a89f4c 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 | |||
@@ -1,7 +1,7 @@ | |||
1 | From 22316f200803225f2d375ae5c36ffead59e2f6b8 Mon Sep 17 00:00:00 2001 | 1 | From f7ee12c1f8e85b9d2fe4023b6539c8051dc710c3 Mon Sep 17 00:00:00 2001 |
2 | From: Alex Kiernan <alex.kiernan@gmail.com> | 2 | From: Alex Kiernan <alex.kiernan@gmail.com> |
3 | Date: Mon, 5 Dec 2022 15:14:26 +0000 | 3 | Date: Mon, 5 Dec 2022 15:14:26 +0000 |
4 | Subject: [PATCH 4/6] make: Separate TLS targets from libraries | 4 | Subject: [PATCH] make: Separate TLS targets from libraries |
5 | 5 | ||
6 | There are dependencies on TLSOBJS, which fails when `-lmbedtls` is | 6 | There are dependencies on TLSOBJS, which fails when `-lmbedtls` is |
7 | listed as a dependency, so separate it out. | 7 | listed as a dependency, so separate it out. |
@@ -12,10 +12,10 @@ Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> | |||
12 | mDNSPosix/Makefile | 14 ++++++++------ | 12 | mDNSPosix/Makefile | 14 ++++++++------ |
13 | 1 file changed, 8 insertions(+), 6 deletions(-) | 13 | 1 file changed, 8 insertions(+), 6 deletions(-) |
14 | 14 | ||
15 | Index: mDNSResponder/mDNSPosix/Makefile | 15 | diff --git a/mDNSPosix/Makefile b/mDNSPosix/Makefile |
16 | =================================================================== | 16 | index 7c510317f1b6..8dd5984020ee 100755 |
17 | --- mDNSResponder.orig/mDNSPosix/Makefile | 17 | --- a/mDNSPosix/Makefile |
18 | +++ mDNSResponder/mDNSPosix/Makefile | 18 | +++ b/mDNSPosix/Makefile |
19 | @@ -112,9 +112,11 @@ ifeq ($(findstring linux,$(os)),linux) | 19 | @@ -112,9 +112,11 @@ ifeq ($(findstring linux,$(os)),linux) |
20 | ifeq ($(tls), no) | 20 | ifeq ($(tls), no) |
21 | CFLAGS_OS = -D_GNU_SOURCE -DHAVE_IPV6 -DNOT_HAVE_SA_LEN -DUSES_NETLINK -DHAVE_LINUX -DTARGET_OS_LINUX -ftabstop=4 -Wno-expansion-to-defined | 21 | CFLAGS_OS = -D_GNU_SOURCE -DHAVE_IPV6 -DNOT_HAVE_SA_LEN -DUSES_NETLINK -DHAVE_LINUX -DTARGET_OS_LINUX -ftabstop=4 -Wno-expansion-to-defined |
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 deleted file mode 100644 index f00116c617..0000000000 --- a/meta-networking/recipes-protocols/mdns/mdns/0005-Use-list-for-changed-interfaces.patch +++ /dev/null | |||
@@ -1,166 +0,0 @@ | |||
1 | From e79f81f5cd626ad77ec64de4325f6645cf253c5e Mon Sep 17 00:00:00 2001 | ||
2 | From: Nate Karstens <nate.karstens@garmin.com> | ||
3 | Date: Thu, 13 Jul 2017 09:00:00 -0500 | ||
4 | Subject: [PATCH 5/8] Use list for changed interfaces | ||
5 | |||
6 | Uses a linked list to store the index of changed network interfaces | ||
7 | instead of a bitfield. This allows for network interfaces with an | ||
8 | index greater than 31 (an index of 36 was seen on Android). | ||
9 | |||
10 | Upstream-Status: Submitted [dts@apple.com] | ||
11 | |||
12 | Signed-off-by: Nate Karstens <nate.karstens@garmin.com> | ||
13 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> | ||
14 | --- | ||
15 | mDNSPosix/mDNSPosix.c | 58 ++++++++++++++++++++++++++++++++----------- | ||
16 | 1 file changed, 43 insertions(+), 15 deletions(-) | ||
17 | |||
18 | Index: mDNSResponder/mDNSPosix/mDNSPosix.c | ||
19 | =================================================================== | ||
20 | --- mDNSResponder.orig/mDNSPosix/mDNSPosix.c | ||
21 | +++ mDNSResponder/mDNSPosix/mDNSPosix.c | ||
22 | @@ -74,6 +74,14 @@ struct IfChangeRec | ||
23 | }; | ||
24 | typedef struct IfChangeRec IfChangeRec; | ||
25 | |||
26 | +// Used to build a list of network interface indices | ||
27 | +struct NetworkInterfaceIndex | ||
28 | +{ | ||
29 | + int if_index; | ||
30 | + struct NetworkInterfaceIndex *Next; | ||
31 | +}; | ||
32 | +typedef struct NetworkInterfaceIndex NetworkInterfaceIndex; | ||
33 | + | ||
34 | // Note that static data is initialized to zero in (modern) C. | ||
35 | static PosixEventSource *gEventSources; // linked list of PosixEventSource's | ||
36 | static sigset_t gEventSignalSet; // Signals which event loop listens for | ||
37 | @@ -1621,6 +1629,23 @@ mDNSlocal mStatus OpenIfNotifySocket(int | ||
38 | return err; | ||
39 | } | ||
40 | |||
41 | +mDNSlocal void AddInterfaceIndexToList(GenLinkedList *list, int if_index) | ||
42 | +{ | ||
43 | + NetworkInterfaceIndex *item; | ||
44 | + | ||
45 | + for (item = (NetworkInterfaceIndex*)list->Head; item != NULL; item = item->Next) | ||
46 | + { | ||
47 | + if (if_index == item->if_index) return; | ||
48 | + } | ||
49 | + | ||
50 | + item = mdns_malloc(sizeof *item); | ||
51 | + if (item == NULL) return; | ||
52 | + | ||
53 | + item->if_index = if_index; | ||
54 | + item->Next = NULL; | ||
55 | + AddToTail(list, item); | ||
56 | +} | ||
57 | + | ||
58 | #if MDNS_DEBUGMSGS | ||
59 | mDNSlocal void PrintNetLinkMsg(const struct nlmsghdr *pNLMsg) | ||
60 | { | ||
61 | @@ -1648,14 +1673,13 @@ mDNSlocal void PrintNetLinkMsg(cons | ||
62 | } | ||
63 | #endif | ||
64 | |||
65 | -mDNSlocal mDNSu32 ProcessRoutingNotification(int sd) | ||
66 | +mDNSlocal void ProcessRoutingNotification(int sd, GenLinkedList *changedInterfaces) | ||
67 | // Read through the messages on sd and if any indicate that any interface records should | ||
68 | // be torn down and rebuilt, return affected indices as a bitmask. Otherwise return 0. | ||
69 | { | ||
70 | ssize_t readCount; | ||
71 | char buff[4096]; | ||
72 | struct nlmsghdr *pNLMsg = (struct nlmsghdr*) buff; | ||
73 | - mDNSu32 result = 0; | ||
74 | |||
75 | // The structure here is more complex than it really ought to be because, | ||
76 | // unfortunately, there's no good way to size a buffer in advance large | ||
77 | @@ -1691,9 +1715,9 @@ mDNSlocal mDNSu32 ProcessRoutingNo | ||
78 | |||
79 | // Process the NetLink message | ||
80 | if (pNLMsg->nlmsg_type == RTM_GETLINK || pNLMsg->nlmsg_type == RTM_NEWLINK) | ||
81 | - result |= 1 << ((struct ifinfomsg*) NLMSG_DATA(pNLMsg))->ifi_index; | ||
82 | + AddInterfaceIndexToList(changedInterfaces, ((struct ifinfomsg*) NLMSG_DATA(pNLMsg))->ifi_index); | ||
83 | else if (pNLMsg->nlmsg_type == RTM_DELADDR || pNLMsg->nlmsg_type == RTM_NEWADDR) | ||
84 | - result |= 1 << ((struct ifaddrmsg*) NLMSG_DATA(pNLMsg))->ifa_index; | ||
85 | + AddInterfaceIndexToList(changedInterfaces, ((struct ifaddrmsg*) NLMSG_DATA(pNLMsg))->ifa_index); | ||
86 | |||
87 | // Advance pNLMsg to the next message in the buffer | ||
88 | if ((pNLMsg->nlmsg_flags & NLM_F_MULTI) != 0 && pNLMsg->nlmsg_type != NLMSG_DONE) | ||
89 | @@ -1704,8 +1728,6 @@ mDNSlocal mDNSu32 ProcessRoutingNo | ||
90 | else | ||
91 | break; // all done! | ||
92 | } | ||
93 | - | ||
94 | - return result; | ||
95 | } | ||
96 | |||
97 | #else // USES_NETLINK | ||
98 | @@ -1737,14 +1759,13 @@ mDNSlocal void PrintRoutingSocketMs | ||
99 | } | ||
100 | #endif | ||
101 | |||
102 | -mDNSlocal mDNSu32 ProcessRoutingNotification(int sd) | ||
103 | +mDNSlocal void ProcessRoutingNotification(int sd, GenLinkedList *changedInterfaces) | ||
104 | // Read through the messages on sd and if any indicate that any interface records should | ||
105 | // be torn down and rebuilt, return affected indices as a bitmask. Otherwise return 0. | ||
106 | { | ||
107 | ssize_t readCount; | ||
108 | char buff[4096]; | ||
109 | struct ifa_msghdr *pRSMsg = (struct ifa_msghdr*) buff; | ||
110 | - mDNSu32 result = 0; | ||
111 | |||
112 | readCount = read(sd, buff, sizeof buff); | ||
113 | if (readCount < (ssize_t) sizeof(struct ifa_msghdr)) | ||
114 | @@ -1759,12 +1780,10 @@ mDNSlocal mDNSu32 ProcessRoutingNo | ||
115 | pRSMsg->ifam_type == RTM_IFINFO) | ||
116 | { | ||
117 | if (pRSMsg->ifam_type == RTM_IFINFO) | ||
118 | - result |= 1 << ((struct if_msghdr*) pRSMsg)->ifm_index; | ||
119 | + AddInterfaceIndexToList(changedInterfaces, ((struct if_msghdr*) pRSMsg)->ifm_index); | ||
120 | else | ||
121 | - result |= 1 << pRSMsg->ifam_index; | ||
122 | + AddInterfaceIndexToList(changedInterfaces, pRSMsg->ifam_index); | ||
123 | } | ||
124 | - | ||
125 | - return result; | ||
126 | } | ||
127 | |||
128 | #endif // USES_NETLINK | ||
129 | @@ -1774,7 +1793,8 @@ mDNSlocal void InterfaceChangeCallback(i | ||
130 | { | ||
131 | IfChangeRec *pChgRec = (IfChangeRec*) context; | ||
132 | fd_set readFDs; | ||
133 | - mDNSu32 changedInterfaces = 0; | ||
134 | + GenLinkedList changedInterfaces; | ||
135 | + NetworkInterfaceIndex *changedInterface; | ||
136 | struct timeval zeroTimeout = { 0, 0 }; | ||
137 | |||
138 | (void)fd; // Unused | ||
139 | @@ -1782,17 +1802,25 @@ mDNSlocal void InterfaceChangeCallback(i | ||
140 | FD_ZERO(&readFDs); | ||
141 | FD_SET(pChgRec->NotifySD, &readFDs); | ||
142 | |||
143 | + InitLinkedList(&changedInterfaces, offsetof(NetworkInterfaceIndex, Next)); | ||
144 | + | ||
145 | do | ||
146 | { | ||
147 | - changedInterfaces |= ProcessRoutingNotification(pChgRec->NotifySD); | ||
148 | + ProcessRoutingNotification(pChgRec->NotifySD, &changedInterfaces); | ||
149 | } | ||
150 | while (0 < select(pChgRec->NotifySD + 1, &readFDs, (fd_set*) NULL, (fd_set*) NULL, &zeroTimeout)); | ||
151 | |||
152 | // Currently we rebuild the entire interface list whenever any interface change is | ||
153 | // detected. If this ever proves to be a performance issue in a multi-homed | ||
154 | // configuration, more care should be paid to changedInterfaces. | ||
155 | - if (changedInterfaces) | ||
156 | + if (changedInterfaces.Head != NULL) | ||
157 | mDNSPlatformPosixRefreshInterfaceList(pChgRec->mDNS); | ||
158 | + | ||
159 | + while ((changedInterface = (NetworkInterfaceIndex*)changedInterfaces.Head) != NULL) | ||
160 | + { | ||
161 | + RemoveFromList(&changedInterfaces, changedInterface); | ||
162 | + mdns_free(changedInterface); | ||
163 | + } | ||
164 | } | ||
165 | |||
166 | // Register with either a Routing Socket or RtNetLink to listen for interface changes. | ||
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 fd2f2f1178..7d8f04c902 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,20 +1,19 @@ | |||
1 | From 764b6202402e9e5687ff873330e5ad6be6f69df7 Mon Sep 17 00:00:00 2001 | 1 | From e79f75487e32f87677519ec40c021b1623395bde Mon Sep 17 00:00:00 2001 |
2 | From: Alex Kiernan <alex.kiernan@gmail.com> | 2 | From: Alex Kiernan <alex.kiernan@gmail.com> |
3 | Date: Mon, 5 Dec 2022 22:49:49 +0000 | 3 | Date: Mon, 5 Dec 2022 22:49:49 +0000 |
4 | Subject: [PATCH] mDNSCore: Fix broken debug parameter | 4 | Subject: [PATCH] mDNSCore: Fix broken debug parameter |
5 | 5 | ||
6 | Upstream-Status: Pending | 6 | Upstream-Status: Pending |
7 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> | 7 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> |
8 | |||
9 | --- | 8 | --- |
10 | mDNSCore/mDNS.c | 2 +- | 9 | mDNSCore/mDNS.c | 2 +- |
11 | 1 file changed, 1 insertion(+), 1 deletion(-) | 10 | 1 file changed, 1 insertion(+), 1 deletion(-) |
12 | 11 | ||
13 | Index: mDNSResponder/mDNSCore/mDNS.c | 12 | diff --git a/mDNSCore/mDNS.c b/mDNSCore/mDNS.c |
14 | =================================================================== | 13 | index ad9eaa37a82a..fc51e1ad9bd4 100644 |
15 | --- mDNSResponder.orig/mDNSCore/mDNS.c | 14 | --- a/mDNSCore/mDNS.c |
16 | +++ mDNSResponder/mDNSCore/mDNS.c | 15 | +++ b/mDNSCore/mDNS.c |
17 | @@ -10231,7 +10231,7 @@ mDNSlocal void mDNSCoreReceiveNoUnicastA | 16 | @@ -11046,7 +11046,7 @@ mDNSlocal void mDNSCoreReceiveNoUnicastAnswers(mDNS *const m, const DNSMessage * |
18 | #else | 17 | #else |
19 | const DNSServRef dnsserv = qptr->qDNSServer; | 18 | const DNSServRef dnsserv = qptr->qDNSServer; |
20 | #endif | 19 | #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 deleted file mode 100644 index 80cdbca500..0000000000 --- a/meta-networking/recipes-protocols/mdns/mdns/0006-Handle-noisy-netlink-sockets.patch +++ /dev/null | |||
@@ -1,249 +0,0 @@ | |||
1 | From bfa1d68bed863e22c40a6d9a19ffbcc8694bbff6 Mon Sep 17 00:00:00 2001 | ||
2 | From: Nate Karstens <nate.karstens@garmin.com> | ||
3 | Date: Mon, 24 Jul 2017 09:38:55 -0500 | ||
4 | Subject: [PATCH 6/8] Handle noisy netlink sockets | ||
5 | |||
6 | The POSIX implementation currently clears all network interfaces | ||
7 | when netlink indicates that there has been a change. This causes | ||
8 | the following problems: | ||
9 | |||
10 | 1) Applications are informed that all of the services they are | ||
11 | tracking have been removed. | ||
12 | 2) Increases network load because the client must re-query for | ||
13 | all records it is interested in. | ||
14 | |||
15 | This changes netlink notification handling by: | ||
16 | |||
17 | 1) Always comparing with the latest interface list returned | ||
18 | by the OS. | ||
19 | 2) Confirming that the interface has been changed in a way | ||
20 | that we care about. | ||
21 | |||
22 | Upstream-Status: Submitted [dts@apple.com] | ||
23 | |||
24 | Signed-off-by: Nate Karstens <nate.karstens@garmin.com> | ||
25 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> | ||
26 | --- | ||
27 | mDNSPosix/mDNSPosix.c | 182 +++++++++++++++++++++++++++++++++++++++--- | ||
28 | 1 file changed, 172 insertions(+), 10 deletions(-) | ||
29 | |||
30 | Index: mDNSResponder/mDNSPosix/mDNSPosix.c | ||
31 | =================================================================== | ||
32 | --- mDNSResponder.orig/mDNSPosix/mDNSPosix.c | ||
33 | +++ mDNSResponder/mDNSPosix/mDNSPosix.c | ||
34 | @@ -1788,14 +1788,43 @@ mDNSlocal void ProcessRoutingNo | ||
35 | |||
36 | #endif // USES_NETLINK | ||
37 | |||
38 | +// Test whether the given PosixNetworkInterface matches the given struct ifaddrs | ||
39 | +mDNSlocal mDNSBool InterfacesMatch(PosixNetworkInterface *intf, struct ifaddrs *ifi) | ||
40 | +{ | ||
41 | + mDNSBool match = mDNSfalse; | ||
42 | + mDNSAddr ip, mask; | ||
43 | + unsigned int if_index; | ||
44 | + | ||
45 | + if_index = if_nametoindex(ifi->ifa_name); | ||
46 | + if (if_index == 0) | ||
47 | + return mDNSfalse; | ||
48 | + | ||
49 | + if((intf->index == if_index) && | ||
50 | + (intf->sa_family == ifi->ifa_addr->sa_family) && | ||
51 | + (strcmp(intf->coreIntf.ifname, ifi->ifa_name) == 0)) | ||
52 | + { | ||
53 | + SockAddrTomDNSAddr(ifi->ifa_addr, &ip, NULL); | ||
54 | + SockAddrTomDNSAddr(ifi->ifa_netmask, &mask, NULL); | ||
55 | + | ||
56 | + match = mDNSSameAddress(&intf->coreIntf.ip, &ip) && | ||
57 | + mDNSSameAddress(&intf->coreIntf.mask, &mask); | ||
58 | + } | ||
59 | + | ||
60 | + return match; | ||
61 | +} | ||
62 | + | ||
63 | // Called when data appears on interface change notification socket | ||
64 | mDNSlocal void InterfaceChangeCallback(int fd, void *context) | ||
65 | { | ||
66 | IfChangeRec *pChgRec = (IfChangeRec*) context; | ||
67 | + mDNS *m = pChgRec->mDNS; | ||
68 | fd_set readFDs; | ||
69 | GenLinkedList changedInterfaces; | ||
70 | NetworkInterfaceIndex *changedInterface; | ||
71 | struct timeval zeroTimeout = { 0, 0 }; | ||
72 | + struct ifaddrs *ifa_list, **ifi, *ifa_loop4 = NULL; | ||
73 | + PosixNetworkInterface *intf, *intfNext; | ||
74 | + mDNSBool found, foundav4; | ||
75 | |||
76 | (void)fd; // Unused | ||
77 | |||
78 | @@ -1810,12 +1839,149 @@ mDNSlocal void InterfaceChangeCallback(i | ||
79 | } | ||
80 | while (0 < select(pChgRec->NotifySD + 1, &readFDs, (fd_set*) NULL, (fd_set*) NULL, &zeroTimeout)); | ||
81 | |||
82 | - // Currently we rebuild the entire interface list whenever any interface change is | ||
83 | - // detected. If this ever proves to be a performance issue in a multi-homed | ||
84 | - // configuration, more care should be paid to changedInterfaces. | ||
85 | - if (changedInterfaces.Head != NULL) | ||
86 | - mDNSPlatformPosixRefreshInterfaceList(pChgRec->mDNS); | ||
87 | + CleanRecentInterfaces(); | ||
88 | + | ||
89 | + if (changedInterfaces.Head == NULL) goto cleanup; | ||
90 | + | ||
91 | + if (getifaddrs(&ifa_list) < 0) goto cleanup; | ||
92 | + | ||
93 | + for (intf = (PosixNetworkInterface*)(m->HostInterfaces); intf != NULL; intf = intfNext) | ||
94 | + { | ||
95 | + intfNext = (PosixNetworkInterface*)(intf->coreIntf.next); | ||
96 | + | ||
97 | + // Loopback interface(s) are handled later | ||
98 | + if (intf->coreIntf.Loopback) continue; | ||
99 | + | ||
100 | + found = mDNSfalse; | ||
101 | + for (ifi = &ifa_list; *ifi != NULL; ifi = &(*ifi)->ifa_next) | ||
102 | + { | ||
103 | + if (InterfacesMatch(intf, *ifi)) | ||
104 | + { | ||
105 | + found = mDNStrue; | ||
106 | + break; | ||
107 | + } | ||
108 | + } | ||
109 | + | ||
110 | + // Removes changed and old interfaces from m->HostInterfaces | ||
111 | + if (!found) TearDownInterface(m, intf); | ||
112 | + } | ||
113 | + | ||
114 | + // Add new and changed interfaces in ifa_list | ||
115 | + // Save off loopback interface in case it is needed later | ||
116 | + for (ifi = &ifa_list; *ifi != NULL; ifi = &(*ifi)->ifa_next) | ||
117 | + { | ||
118 | + found = mDNSfalse; | ||
119 | + for (intf = (PosixNetworkInterface*)(m->HostInterfaces); intf != NULL; intf = intfNext) | ||
120 | + { | ||
121 | + intfNext = (PosixNetworkInterface*)(intf->coreIntf.next); | ||
122 | + | ||
123 | + // Loopback interface(s) are handled later | ||
124 | + if (intf->coreIntf.Loopback) continue; | ||
125 | + | ||
126 | + if (InterfacesMatch(intf, *ifi)) | ||
127 | + { | ||
128 | + found = mDNStrue; | ||
129 | + break; | ||
130 | + } | ||
131 | + | ||
132 | + // Removes changed and old interfaces from m->HostInterfaces | ||
133 | + } | ||
134 | + if (found) | ||
135 | + continue; | ||
136 | + | ||
137 | + if ((ifa_loop4 == NULL) && | ||
138 | + ((*ifi)->ifa_addr->sa_family == AF_INET) && | ||
139 | + ((*ifi)->ifa_flags & IFF_UP) && | ||
140 | + ((*ifi)->ifa_flags & IFF_LOOPBACK)) | ||
141 | + { | ||
142 | + ifa_loop4 = *ifi; | ||
143 | + continue; | ||
144 | + } | ||
145 | + | ||
146 | + if ( (((*ifi)->ifa_addr->sa_family == AF_INET) | ||
147 | +#if HAVE_IPV6 | ||
148 | + || ((*ifi)->ifa_addr->sa_family == AF_INET6) | ||
149 | +#endif | ||
150 | + ) && ((*ifi)->ifa_flags & IFF_UP) | ||
151 | + && !((*ifi)->ifa_flags & IFF_POINTOPOINT) | ||
152 | + && !((*ifi)->ifa_flags & IFF_LOOPBACK)) | ||
153 | + { | ||
154 | + struct ifaddrs *i = *ifi; | ||
155 | + | ||
156 | +#define ethernet_addr_len 6 | ||
157 | + uint8_t hwaddr[ethernet_addr_len]; | ||
158 | + int hwaddr_len = 0; | ||
159 | + | ||
160 | +#if defined(TARGET_OS_LINUX) && TARGET_OS_LINUX | ||
161 | + struct ifreq ifr; | ||
162 | + int sockfd = socket(AF_INET6, SOCK_DGRAM, 0); | ||
163 | + if (sockfd >= 0) | ||
164 | + { | ||
165 | + /* Add hardware address */ | ||
166 | + memcpy(ifr.ifr_name, i->ifa_name, IFNAMSIZ); | ||
167 | + if (ioctl(sockfd, SIOCGIFHWADDR, &ifr) != -1) | ||
168 | + { | ||
169 | + if (ifr.ifr_hwaddr.sa_family == ARPHRD_ETHER) | ||
170 | + { | ||
171 | + memcpy(hwaddr, ifr.ifr_hwaddr.sa_data, ethernet_addr_len); | ||
172 | + hwaddr_len = ethernet_addr_len; | ||
173 | + } | ||
174 | + } | ||
175 | + close(sockfd); | ||
176 | + } | ||
177 | + else | ||
178 | + { | ||
179 | + memset(hwaddr, 0, sizeof(hwaddr)); | ||
180 | + } | ||
181 | +#endif // TARGET_OS_LINUX | ||
182 | + SetupOneInterface(m, i->ifa_addr, i->ifa_netmask, | ||
183 | + hwaddr, hwaddr_len, i->ifa_name, if_nametoindex(i->ifa_name), i->ifa_flags); | ||
184 | + } | ||
185 | + } | ||
186 | + | ||
187 | + // Determine if there is at least one non-loopback IPv4 interface. This is to work around issues | ||
188 | + // with multicast loopback on IPv6 interfaces -- see corresponding logic in SetupInterfaceList(). | ||
189 | + foundav4 = mDNSfalse; | ||
190 | + for (intf = (PosixNetworkInterface*)(m->HostInterfaces); intf != NULL; intf = (PosixNetworkInterface*)(intf->coreIntf.next)) | ||
191 | + { | ||
192 | + if (intf->sa_family == AF_INET && !intf->coreIntf.Loopback) | ||
193 | + { | ||
194 | + foundav4 = mDNStrue; | ||
195 | + break; | ||
196 | + } | ||
197 | + } | ||
198 | + | ||
199 | + if (foundav4) | ||
200 | + { | ||
201 | + for (intf = (PosixNetworkInterface*)(m->HostInterfaces); intf != NULL; intf = intfNext) | ||
202 | + { | ||
203 | + intfNext = (PosixNetworkInterface*)(intf->coreIntf.next); | ||
204 | + if (intf->coreIntf.Loopback) TearDownInterface(m, intf); | ||
205 | + } | ||
206 | + } | ||
207 | + else | ||
208 | + { | ||
209 | + found = mDNSfalse; | ||
210 | + | ||
211 | + for (intf = (PosixNetworkInterface*)(m->HostInterfaces); intf != NULL; intf = (PosixNetworkInterface*)(intf->coreIntf.next)) | ||
212 | + { | ||
213 | + if (intf->coreIntf.Loopback) | ||
214 | + { | ||
215 | + found = mDNStrue; | ||
216 | + break; | ||
217 | + } | ||
218 | + } | ||
219 | + | ||
220 | + if (!found && (ifa_loop4 != NULL)) | ||
221 | + { | ||
222 | + SetupOneInterface(m, ifa_loop4->ifa_addr, ifa_loop4->ifa_netmask, | ||
223 | + NULL, 0, ifa_loop4->ifa_name, if_nametoindex(ifa_loop4->ifa_name), ifa_loop4->ifa_flags); | ||
224 | + } | ||
225 | + } | ||
226 | + | ||
227 | + if (ifa_list != NULL) freeifaddrs(ifa_list); | ||
228 | |||
229 | +cleanup: | ||
230 | while ((changedInterface = (NetworkInterfaceIndex*)changedInterfaces.Head) != NULL) | ||
231 | { | ||
232 | RemoveFromList(&changedInterfaces, changedInterface); | ||
233 | @@ -1947,15 +2113,11 @@ mDNSexport void mDNSPlatformClose(mDNS * | ||
234 | #endif | ||
235 | } | ||
236 | |||
237 | -// This is used internally by InterfaceChangeCallback. | ||
238 | -// It's also exported so that the Standalone Responder (mDNSResponderPosix) | ||
239 | +// This is exported so that the Standalone Responder (mDNSResponderPosix) | ||
240 | // can call it in response to a SIGHUP (mainly for debugging purposes). | ||
241 | mDNSexport mStatus mDNSPlatformPosixRefreshInterfaceList(mDNS *const m) | ||
242 | { | ||
243 | int err; | ||
244 | - // This is a pretty heavyweight way to process interface changes -- | ||
245 | - // destroying the entire interface list and then making fresh one from scratch. | ||
246 | - // We should make it like the OS X version, which leaves unchanged interfaces alone. | ||
247 | ClearInterfaceList(m); | ||
248 | err = SetupInterfaceList(m); | ||
249 | return PosixErrorToStatus(err); | ||
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 c12a02fcdd..5f8f428302 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 | |||
@@ -1,7 +1,7 @@ | |||
1 | From fa9ef50ab4c4225cf3ade4bafc38ddf93e6fe127 Mon Sep 17 00:00:00 2001 | 1 | From a1c982808ebfb71ba7e0f16040013b7127a6e2ab Mon Sep 17 00:00:00 2001 |
2 | From: Alex Kiernan <alex.kiernan@gmail.com> | 2 | From: Alex Kiernan <alex.kiernan@gmail.com> |
3 | Date: Tue, 6 Dec 2022 13:28:31 +0000 | 3 | Date: Tue, 6 Dec 2022 13:28:31 +0000 |
4 | Subject: [PATCH 6/6] make: Add top-level Makefile | 4 | Subject: [PATCH] make: Add top-level Makefile |
5 | 5 | ||
6 | Simple top level Makefile that just delegates to mDNSPosix. | 6 | Simple top level Makefile that just delegates to mDNSPosix. |
7 | 7 | ||
@@ -12,10 +12,11 @@ Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> | |||
12 | 1 file changed, 2 insertions(+) | 12 | 1 file changed, 2 insertions(+) |
13 | create mode 100644 Makefile | 13 | create mode 100644 Makefile |
14 | 14 | ||
15 | Index: mDNSResponder/Makefile | 15 | diff --git a/Makefile b/Makefile |
16 | =================================================================== | 16 | new file mode 100644 |
17 | index 000000000000..feb6ac67ef47 | ||
17 | --- /dev/null | 18 | --- /dev/null |
18 | +++ mDNSResponder/Makefile | 19 | +++ b/Makefile |
19 | @@ -0,0 +1,2 @@ | 20 | @@ -0,0 +1,2 @@ |
20 | +all clean: | 21 | +all clean: |
21 | + cd mDNSPosix && $(MAKE) $@ | 22 | + cd mDNSPosix && $(MAKE) $@ |
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 deleted file mode 100644 index dae1ac7ea0..0000000000 --- a/meta-networking/recipes-protocols/mdns/mdns/0007-Mark-deleted-interfaces-as-being-changed.patch +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | From a8accffb95267490b50401c8b65ec18db57b5ef5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Nate Karstens <nate.karstens@garmin.com> | ||
3 | Date: Wed, 9 Aug 2017 09:16:58 -0500 | ||
4 | Subject: [PATCH 7/8] Mark deleted interfaces as being changed | ||
5 | |||
6 | Netlink notification handling ignores messages for deleted links, | ||
7 | RTM_DELLINK. It does handle RTM_GETLINK. According to libnl docu- | ||
8 | mentation (http://www.infradead.org/~tgr/libnl/doc/route.html) | ||
9 | RTM_DELLINK can be sent by the kernel, but RTM_GETLINK cannot. | ||
10 | There was likely a mixup in the original implementation, so this | ||
11 | change replaces handling for RTM_GETLINK with RTM_DELLINK. | ||
12 | |||
13 | Testing and Verification Instructions: | ||
14 | 1. Use ip-link to add and remove a VLAN interface and verify | ||
15 | that mDNSResponder handles the deleted link. | ||
16 | |||
17 | Upstream-Status: Submitted [dts@apple.com] | ||
18 | |||
19 | Signed-off-by: Nate Karstens <nate.karstens@garmin.com> | ||
20 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> | ||
21 | --- | ||
22 | mDNSPosix/mDNSPosix.c | 2 +- | ||
23 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
24 | |||
25 | Index: mDNSResponder/mDNSPosix/mDNSPosix.c | ||
26 | =================================================================== | ||
27 | --- mDNSResponder.orig/mDNSPosix/mDNSPosix.c | ||
28 | +++ mDNSResponder/mDNSPosix/mDNSPosix.c | ||
29 | @@ -1714,7 +1714,7 @@ mDNSlocal void ProcessRoutingNo | ||
30 | #endif | ||
31 | |||
32 | // Process the NetLink message | ||
33 | - if (pNLMsg->nlmsg_type == RTM_GETLINK || pNLMsg->nlmsg_type == RTM_NEWLINK) | ||
34 | + if (pNLMsg->nlmsg_type == RTM_DELLINK || pNLMsg->nlmsg_type == RTM_NEWLINK) | ||
35 | AddInterfaceIndexToList(changedInterfaces, ((struct ifinfomsg*) NLMSG_DATA(pNLMsg))->ifi_index); | ||
36 | else if (pNLMsg->nlmsg_type == RTM_DELADDR || pNLMsg->nlmsg_type == RTM_NEWADDR) | ||
37 | AddInterfaceIndexToList(changedInterfaces, ((struct ifaddrmsg*) NLMSG_DATA(pNLMsg))->ifa_index); | ||
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 deleted file mode 100644 index 1789001e14..0000000000 --- a/meta-networking/recipes-protocols/mdns/mdns/0008-Handle-errors-from-socket-calls.patch +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | From ed58146d3aeecdb9920fdc017f85c18b5b10f2db Mon Sep 17 00:00:00 2001 | ||
2 | From: Nate Karstens <nate.karstens@garmin.com> | ||
3 | Date: Thu, 10 Aug 2017 08:27:32 -0500 | ||
4 | Subject: [PATCH 8/8] Handle errors from socket calls | ||
5 | |||
6 | Adds handling for socket() or read() returning a | ||
7 | negative value (indicating an error has occurred). | ||
8 | |||
9 | Upstream-Status: Submitted [dts@apple.com] | ||
10 | |||
11 | Signed-off-by: Nate Karstens <nate.karstens@garmin.com> | ||
12 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> | ||
13 | --- | ||
14 | mDNSPosix/mDNSPosix.c | 12 +++++++++--- | ||
15 | 1 file changed, 9 insertions(+), 3 deletions(-) | ||
16 | |||
17 | Index: mDNSResponder/mDNSPosix/mDNSPosix.c | ||
18 | =================================================================== | ||
19 | --- mDNSResponder.orig/mDNSPosix/mDNSPosix.c | ||
20 | +++ mDNSResponder/mDNSPosix/mDNSPosix.c | ||
21 | @@ -1677,7 +1677,7 @@ mDNSlocal void ProcessRoutingNo | ||
22 | // Read through the messages on sd and if any indicate that any interface records should | ||
23 | // be torn down and rebuilt, return affected indices as a bitmask. Otherwise return 0. | ||
24 | { | ||
25 | - ssize_t readCount; | ||
26 | + ssize_t readVal, readCount; | ||
27 | char buff[4096]; | ||
28 | struct nlmsghdr *pNLMsg = (struct nlmsghdr*) buff; | ||
29 | |||
30 | @@ -1686,7 +1686,10 @@ mDNSlocal void ProcessRoutingNo | ||
31 | // enough to hold all pending data and so avoid message fragmentation. | ||
32 | // (Note that FIONREAD is not supported on AF_NETLINK.) | ||
33 | |||
34 | - readCount = read(sd, buff, sizeof buff); | ||
35 | + readVal = read(sd, buff, sizeof buff); | ||
36 | + if (readVal < 0) return; | ||
37 | + readCount = readVal; | ||
38 | + | ||
39 | while (1) | ||
40 | { | ||
41 | // Make sure we've got an entire nlmsghdr in the buffer, and payload, too. | ||
42 | @@ -1702,7 +1705,9 @@ mDNSlocal void ProcessRoutingNo | ||
43 | pNLMsg = (struct nlmsghdr*) buff; | ||
44 | |||
45 | // read more data | ||
46 | - readCount += read(sd, buff + readCount, sizeof buff - readCount); | ||
47 | + readVal = read(sd, buff + readCount, sizeof buff - readCount); | ||
48 | + if (readVal < 0) return; | ||
49 | + readCount += readVal; | ||
50 | continue; // spin around and revalidate with new readCount | ||
51 | } | ||
52 | else | ||
53 | @@ -2017,6 +2022,7 @@ mDNSlocal mDNSBool mDNSPlatformInit_CanR | ||
54 | int err; | ||
55 | int s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); | ||
56 | struct sockaddr_in s5353; | ||
57 | + if (s < 0) return mDNSfalse; | ||
58 | s5353.sin_family = AF_INET; | ||
59 | s5353.sin_port = MulticastDNSPort.NotAnInteger; | ||
60 | s5353.sin_addr.s_addr = 0; | ||
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 d443bc97b2..e8785b1aa7 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 | |||
@@ -1,4 +1,4 @@ | |||
1 | From 1d7e71e72c597ffcc19c04373a477d1fbd3ad955 Mon Sep 17 00:00:00 2001 | 1 | From 8e32fb0876a073c23ab73047a2e0f6d011b3660c Mon Sep 17 00:00:00 2001 |
2 | From: Beniamin Sandu <beniaminsandu@gmail.com> | 2 | From: Beniamin Sandu <beniaminsandu@gmail.com> |
3 | Date: Thu, 15 Jun 2023 17:02:58 +0000 | 3 | Date: Thu, 15 Jun 2023 17:02:58 +0000 |
4 | Subject: [PATCH] remove unneeded headers | 4 | Subject: [PATCH] remove unneeded headers |
@@ -7,17 +7,16 @@ From a quick look, these seem to not be needed and having them | |||
7 | breaks the build with mbedtls 3.x. Without them it builds fine | 7 | breaks the build with mbedtls 3.x. Without them it builds fine |
8 | on both 2.x and 3.x versions. | 8 | on both 2.x and 3.x versions. |
9 | 9 | ||
10 | Upstream-Status: Pending | 10 | Upstream-Status: Inactive-Upstream [Upstream does not take patches] |
11 | |||
12 | Signed-off-by: Beniamin Sandu <beniaminsandu@gmail.com> | 11 | Signed-off-by: Beniamin Sandu <beniaminsandu@gmail.com> |
13 | --- | 12 | --- |
14 | mDNSPosix/mbedtls.c | 2 -- | 13 | mDNSPosix/mbedtls.c | 2 -- |
15 | 1 file changed, 2 deletions(-) | 14 | 1 file changed, 2 deletions(-) |
16 | 15 | ||
17 | Index: mDNSResponder/mDNSPosix/mbedtls.c | 16 | diff --git a/mDNSPosix/mbedtls.c b/mDNSPosix/mbedtls.c |
18 | =================================================================== | 17 | index a73681b6d528..ab8f8c772c00 100644 |
19 | --- mDNSResponder.orig/mDNSPosix/mbedtls.c | 18 | --- a/mDNSPosix/mbedtls.c |
20 | +++ mDNSResponder/mDNSPosix/mbedtls.c | 19 | +++ b/mDNSPosix/mbedtls.c |
21 | @@ -38,10 +38,8 @@ | 20 | @@ -38,10 +38,8 @@ |
22 | #include <mbedtls/sha256.h> | 21 | #include <mbedtls/sha256.h> |
23 | #include <mbedtls/base64.h> | 22 | #include <mbedtls/base64.h> |
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 deleted file mode 100644 index 511a6fdc18..0000000000 --- a/meta-networking/recipes-protocols/mdns/mdns/0015-Add-missing-limits.h.patch +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | From 9fc45a2cf3b78573a568abf538a6e6f4bd30b2d7 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alex Kiernan <alex.kiernan@gmail.com> | ||
3 | Date: Wed, 27 Sep 2023 11:45:26 +0100 | ||
4 | Subject: [PATCH] Add missing limits.h | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> | ||
8 | --- | ||
9 | mDNSShared/PlatformCommon.c | 1 + | ||
10 | 1 file changed, 1 insertion(+) | ||
11 | |||
12 | Index: mDNSResponder/mDNSShared/PlatformCommon.c | ||
13 | =================================================================== | ||
14 | --- mDNSResponder.orig/mDNSShared/PlatformCommon.c | ||
15 | +++ mDNSResponder/mDNSShared/PlatformCommon.c | ||
16 | @@ -32,6 +32,7 @@ | ||
17 | #include <time.h> | ||
18 | #include <sys/time.h> // Needed for #include <sys/time.h>(). | ||
19 | #include <assert.h> | ||
20 | +#include <limits.h> | ||
21 | |||
22 | |||
23 | #include "mDNSEmbeddedAPI.h" // Defines the interface provided to the client layer above | ||
diff --git a/meta-networking/recipes-protocols/mdns/mdns_2200.100.94.0.2.bb b/meta-networking/recipes-protocols/mdns/mdns_2600.120.12.bb index 183f05ebc3..f7c8f17800 100644 --- a/meta-networking/recipes-protocols/mdns/mdns_2200.100.94.0.2.bb +++ b/meta-networking/recipes-protocols/mdns/mdns_2600.120.12.bb | |||
@@ -6,27 +6,19 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=31c50371921e0fb731003bbc665f29bf" | |||
6 | 6 | ||
7 | DEPENDS:append:libc-musl = " musl-nscd" | 7 | DEPENDS:append:libc-musl = " musl-nscd" |
8 | 8 | ||
9 | SRC_URI = "git://github.com/apple-oss-distributions/mDNSResponder;protocol=https;branch=rel/mDNSResponder-2200 \ | 9 | SRC_URI = "git://github.com/apple-oss-distributions/mDNSResponder;protocol=https;branch=${BRANCH};tag=mDNSResponder-${PV} \ |
10 | file://0001-dns-sd-Include-missing-headers.patch \ | 10 | file://0001-dns-sd-Include-missing-headers.patch \ |
11 | file://0002-make-Set-libdns_sd.so-soname-correctly.patch \ | 11 | file://0002-make-Set-libdns_sd.so-soname-correctly.patch \ |
12 | file://0004-make-Separate-TLS-targets-from-libraries.patch \ | 12 | file://0004-make-Separate-TLS-targets-from-libraries.patch \ |
13 | file://0005-mDNSCore-Fix-broken-debug-parameter.patch \ | 13 | file://0005-mDNSCore-Fix-broken-debug-parameter.patch \ |
14 | file://0006-make-Add-top-level-Makefile.patch \ | 14 | file://0006-make-Add-top-level-Makefile.patch \ |
15 | file://0001-Create-subroutine-for-cleaning-recent-interfaces.patch \ | ||
16 | file://0002-Create-subroutine-for-tearing-down-an-interface.patch \ | ||
17 | file://0003-Track-interface-socket-family.patch \ | ||
18 | file://0004-Indicate-loopback-interface-to-mDNS-core.patch \ | ||
19 | file://0005-Use-list-for-changed-interfaces.patch \ | ||
20 | file://0006-Handle-noisy-netlink-sockets.patch \ | ||
21 | file://0007-Mark-deleted-interfaces-as-being-changed.patch \ | ||
22 | file://0008-Handle-errors-from-socket-calls.patch \ | ||
23 | file://0009-remove-unneeded-headers.patch \ | 15 | file://0009-remove-unneeded-headers.patch \ |
16 | file://0001-Fix-build-with-gcc-15.patch \ | ||
17 | file://0001-Use-secure_getenv-on-Linux.patch \ | ||
24 | file://mdns.service \ | 18 | file://mdns.service \ |
25 | file://0015-Add-missing-limits.h.patch \ | ||
26 | file://0001-Handle-interface-without-ifa_addr.patch \ | ||
27 | file://0001-Fix-SIGSEGV-during-DumpStateLog.patch \ | ||
28 | " | 19 | " |
29 | SRCREV = "8f70f98fc1d0cf439ca3a6470be6ad8ac2bcc019" | 20 | BRANCH = "rel/mDNSResponder-2600" |
21 | SRCREV = "3a0deda2995d98243dae379bcec10e57928c15e8" | ||
30 | 22 | ||
31 | # We install a stub Makefile in the top directory so that the various checks | 23 | # We install a stub Makefile in the top directory so that the various checks |
32 | # in base.bbclass pass their tests for a Makefile, this ensures (that amongst | 24 | # in base.bbclass pass their tests for a Makefile, this ensures (that amongst |
@@ -35,7 +27,6 @@ SRCREV = "8f70f98fc1d0cf439ca3a6470be6ad8ac2bcc019" | |||
35 | # | 27 | # |
36 | # We can't use the approach of setting ${S} to mDNSPosix as we need | 28 | # We can't use the approach of setting ${S} to mDNSPosix as we need |
37 | # DEBUG_PREFIX_MAP to cover files which come from the Clients directory too. | 29 | # DEBUG_PREFIX_MAP to cover files which come from the Clients directory too. |
38 | S = "${WORKDIR}/git" | ||
39 | 30 | ||
40 | inherit github-releases manpages systemd update-rc.d | 31 | inherit github-releases manpages systemd update-rc.d |
41 | 32 | ||
@@ -104,13 +95,13 @@ do_install () { | |||
104 | install -m 0644 libnss_mdns.8 ${D}${mandir}/man8 | 95 | install -m 0644 libnss_mdns.8 ${D}${mandir}/man8 |
105 | 96 | ||
106 | install -d ${D}${systemd_system_unitdir} | 97 | install -d ${D}${systemd_system_unitdir} |
107 | install -m 0644 ${WORKDIR}/mdns.service ${D}${systemd_system_unitdir} | 98 | install -m 0644 ${UNPACKDIR}/mdns.service ${D}${systemd_system_unitdir} |
108 | 99 | ||
109 | install -d ${D}${INIT_D_DIR} | 100 | install -d ${D}${INIT_D_DIR} |
110 | install mdnsd.sh ${D}${INIT_D_DIR}/mdns | 101 | install mdnsd.sh ${D}${INIT_D_DIR}/mdns |
111 | } | 102 | } |
112 | 103 | ||
113 | pkg_postinst:${PN} () { | 104 | pkg_postinst:${PN}-libnss-mdns () { |
114 | if [ -r $D${sysconfdir}/nsswitch.conf ]; then | 105 | if [ -r $D${sysconfdir}/nsswitch.conf ]; then |
115 | sed -e '/^hosts:/s/\s*\<mdns\>//' \ | 106 | sed -e '/^hosts:/s/\s*\<mdns\>//' \ |
116 | -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 mdns\3\4\5/' \ | 107 | -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 mdns\3\4\5/' \ |
@@ -118,7 +109,7 @@ pkg_postinst:${PN} () { | |||
118 | fi | 109 | fi |
119 | } | 110 | } |
120 | 111 | ||
121 | pkg_prerm:${PN} () { | 112 | pkg_prerm:${PN}-libnss-mdns () { |
122 | if [ -r $D${sysconfdir}/nsswitch.conf ]; then | 113 | if [ -r $D${sysconfdir}/nsswitch.conf ]; then |
123 | sed -e '/^hosts:/s/\s*\<mdns\>//' \ | 114 | sed -e '/^hosts:/s/\s*\<mdns\>//' \ |
124 | -e '/^hosts:/s/\s*mdns//' \ | 115 | -e '/^hosts:/s/\s*mdns//' \ |
@@ -129,7 +120,12 @@ pkg_prerm:${PN} () { | |||
129 | SYSTEMD_SERVICE:${PN} = "mdns.service" | 120 | SYSTEMD_SERVICE:${PN} = "mdns.service" |
130 | INITSCRIPT_NAME = "mdns" | 121 | INITSCRIPT_NAME = "mdns" |
131 | 122 | ||
123 | PACKAGE_BEFORE_PN = "${PN}-libnss-mdns" | ||
124 | |||
125 | RRECOMMENDS:${PN}:append:libc-glibc = " ${PN}-libnss-mdns" | ||
126 | |||
132 | FILES_SOLIBSDEV = "${libdir}/libdns_sd.so" | 127 | FILES_SOLIBSDEV = "${libdir}/libdns_sd.so" |
133 | FILES:${PN} += "${libdir}/libnss_mdns-0.2.so" | 128 | FILES:${PN}-libnss-mdns = "${sysconfdir}/nss_mdns.conf ${libdir}/libnss_mdns*.so*" |
129 | RPROVIDES:${PN}-libnss-mdns = "libnss-mdns" | ||
134 | 130 | ||
135 | RPROVIDES:${PN} += "libdns_sd.so" | 131 | RPROVIDES:${PN} += "libdns-sd" |