diff options
Diffstat (limited to 'meta-openembedded/meta-networking/recipes-protocols')
38 files changed, 1178 insertions, 849 deletions
diff --git a/meta-openembedded/meta-networking/recipes-protocols/babeld/babeld_1.9.1.bb b/meta-openembedded/meta-networking/recipes-protocols/babeld/babeld_1.9.2.bb index 6dd15ad9f..a7d7fc81f 100644 --- a/meta-openembedded/meta-networking/recipes-protocols/babeld/babeld_1.9.1.bb +++ b/meta-openembedded/meta-networking/recipes-protocols/babeld/babeld_1.9.2.bb @@ -13,7 +13,7 @@ LICENSE = "MIT" LIC_FILES_CHKSUM = "file://LICENCE;md5=411a48ac3c2e9e0911b8dd9aed26f754" SRC_URI = "git://github.com/jech/babeld.git;protocol=git" -SRCREV = "0835d5d894ea016ab7b81562466cade2c51a12d4" +SRCREV = "a1043879225ac205614259b480d7f577025d8bb0" UPSTREAM_CHECK_GITTAGREGEX = "babeld-(?P<pver>\d+(\.\d+)+)" diff --git a/meta-openembedded/meta-networking/recipes-protocols/freediameter/files/freediameter.service b/meta-openembedded/meta-networking/recipes-protocols/freediameter/files/freediameter.service index 514481b43..70ed3803c 100644 --- a/meta-openembedded/meta-networking/recipes-protocols/freediameter/files/freediameter.service +++ b/meta-openembedded/meta-networking/recipes-protocols/freediameter/files/freediameter.service @@ -4,7 +4,7 @@ After=network.target [Service] Type=simple -PIDFile=/var/run/freediameter.pid +PIDFile=/run/freediameter.pid ExecStart=@BINDIR@/freeDiameterd [Install] diff --git a/meta-openembedded/meta-networking/recipes-protocols/freediameter/freediameter_1.3.2.bb b/meta-openembedded/meta-networking/recipes-protocols/freediameter/freediameter_1.4.0.bb index 385b8b373..15ee56196 100644 --- a/meta-openembedded/meta-networking/recipes-protocols/freediameter/freediameter_1.3.2.bb +++ b/meta-openembedded/meta-networking/recipes-protocols/freediameter/freediameter_1.4.0.bb @@ -23,8 +23,7 @@ SRC_URI = "\ file://0001-libfdcore-sctp.c-update-the-old-sctp-api-check.patch \ " -SRC_URI[md5sum] = "73ce230b4789f9f28fff77cbc83c65af" -SRC_URI[sha256sum] = "ce05b4bf2a04cd2f472e77ba4b86fbfca690bfc83e51da8ce0e575804b763eda" +SRC_URI[sha256sum] = "7a537401bd110c606594b7c6be71b993f0ccc73ae151ad68040979286ba4e50e" S = "${WORKDIR}/${fd_pkgname}-${PV}" diff --git a/meta-openembedded/meta-networking/recipes-protocols/mdns/files/0001-Create-subroutine-for-cleaning-recent-interfaces.patch b/meta-openembedded/meta-networking/recipes-protocols/mdns/files/0001-Create-subroutine-for-cleaning-recent-interfaces.patch index 692c344db..f8efc1044 100644 --- a/meta-openembedded/meta-networking/recipes-protocols/mdns/files/0001-Create-subroutine-for-cleaning-recent-interfaces.patch +++ b/meta-openembedded/meta-networking/recipes-protocols/mdns/files/0001-Create-subroutine-for-cleaning-recent-interfaces.patch @@ -1,7 +1,7 @@ -From 89ea6ac4a8840e8c2be0140a9805c6522c6c5280 Mon Sep 17 00:00:00 2001 +From 6d90f9fdaf008f5c3b8fd8d91594fa1461437888 Mon Sep 17 00:00:00 2001 From: Nate Karstens <nate.karstens@garmin.com> Date: Wed, 28 Jun 2017 17:30:00 -0500 -Subject: [PATCH 01/11] Create subroutine for cleaning recent interfaces +Subject: [PATCH] Create subroutine for cleaning recent interfaces Moves functionality for cleaning the list of recent interfaces into its own subroutine. @@ -10,14 +10,14 @@ Upstream-Status: Submitted [dts@apple.com] Signed-off-by: Nate Karstens <nate.karstens@garmin.com> --- - mDNSPosix/mDNSPosix.c | 24 ++++++++++++++---------- - 1 file changed, 14 insertions(+), 10 deletions(-) + mDNSPosix/mDNSPosix.c | 23 ++++++++++++++--------- + 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c -index 0e10bd5..ffc9696 100644 +index a63cd19..7aeee7b 100755 --- a/mDNSPosix/mDNSPosix.c +++ b/mDNSPosix/mDNSPosix.c -@@ -856,6 +856,19 @@ mDNSlocal int SetupSocket(struct sockaddr *intfAddr, mDNSIPPort port, int interf +@@ -1199,6 +1199,19 @@ mDNSlocal int SetupSocket(struct sockaddr *intfAddr, mDNSIPPort port, int interf return err; } @@ -37,11 +37,10 @@ index 0e10bd5..ffc9696 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, const char *intfName, int intfIndex) -@@ -1010,16 +1023,7 @@ mDNSlocal int SetupInterfaceList(mDNS *const m) - +@@ -1388,15 +1401,7 @@ mDNSlocal int SetupInterfaceList(mDNS *const m) // Clean up. - if (intfList != NULL) free_ifi_info(intfList); -- + if (intfList != NULL) freeifaddrs(intfList); + - // Clean up any interfaces that have been hanging around on the RecentInterfaces list for more than a minute - PosixNetworkInterface **ri = &gRecentInterfaces; - const mDNSs32 utc = mDNSPlatformUTC(); @@ -56,5 +55,5 @@ index 0e10bd5..ffc9696 100644 return err; } -- -2.17.1 +2.20.1 diff --git a/meta-openembedded/meta-networking/recipes-protocols/mdns/files/0001-mdns-include-stddef.h-for-NULL.patch b/meta-openembedded/meta-networking/recipes-protocols/mdns/files/0001-mdns-include-stddef.h-for-NULL.patch new file mode 100644 index 000000000..3e9be7d6a --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-protocols/mdns/files/0001-mdns-include-stddef.h-for-NULL.patch @@ -0,0 +1,40 @@ +From d744609c56f9872e5aa71707f1f71feec9867f51 Mon Sep 17 00:00:00 2001 +From: Mikko Rapeli <mikko.rapeli@bmw.de> +Date: Tue, 14 Jul 2020 16:36:29 +0000 +Subject: [PATCH 1/2] mdns: include <stddef.h> for NULL + +Fixes build error with version 1096.40.7: + +../mDNSCore/mDNS.c:11385:26: error: 'NULL' undeclared (first use in this function) +11385 | const char *reason = NULL; + | ^~~~ +../mDNSCore/mDNS.c:56:1: note: 'NULL' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'? + 55 | #include "dns_sd_internal.h" + +++ |+#include <stddef.h> + 56 | +../mDNSCore/mDNS.c:11385:26: note: each undeclared identifier is reported only once for each function it appears in +11385 | const char *reason = NULL; + | ^~~~ + +Upstream-Status: Pending + +Signed-off-by: Mikko Rapeli <mikko.rapeli@bmw.de> +--- + mDNSCore/mDNS.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/mDNSCore/mDNS.c b/mDNSCore/mDNS.c +index 2fbea04..d4b9af5 100755 +--- a/mDNSCore/mDNS.c ++++ b/mDNSCore/mDNS.c +@@ -23,6 +23,7 @@ + * routines, or types (which may or may not be present on any given platform). + */ + ++#include <stddef.h> /* for NULL */ + #include "DNSCommon.h" // Defines general DNS utility routines + #include "uDNS.h" // Defines entry points into unicast-specific routines + #include "nsec.h" +-- +2.20.1 + diff --git a/meta-openembedded/meta-networking/recipes-protocols/mdns/files/0002-mdns-cross-compilation-fixes-for-bitbake.patch b/meta-openembedded/meta-networking/recipes-protocols/mdns/files/0002-mdns-cross-compilation-fixes-for-bitbake.patch new file mode 100644 index 000000000..33590ffc5 --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-protocols/mdns/files/0002-mdns-cross-compilation-fixes-for-bitbake.patch @@ -0,0 +1,145 @@ +From 72405143f9d16514e70b88bc4843c9634b88036a Mon Sep 17 00:00:00 2001 +From: Brendan Le Foll <brendan.le.foll@intel.com> +Date: Tue, 3 Mar 2015 11:42:57 +0000 +Subject: [PATCH 2/2] mdns: cross compilation fixes for bitbake + +Fixes several build errors when incorrect compiler or +compiler flags are used. + +Upstream-Status: Inappropriate [OE-specific] + +Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> +Signed-off-by: Mikko Rapeli <mikko.rapeli@bmw.de> +--- + mDNSPosix/Makefile | 44 ++++++++++++++++++++------------------------ + 1 file changed, 20 insertions(+), 24 deletions(-) + +diff --git a/mDNSPosix/Makefile b/mDNSPosix/Makefile +index 78222e0..18a3af5 100755 +--- a/mDNSPosix/Makefile ++++ b/mDNSPosix/Makefile +@@ -50,6 +50,7 @@ + + LIBVERS = 1 + ++POSIXDIR = ../mDNSPosix + COREDIR = ../mDNSCore + SHAREDDIR ?= ../mDNSShared + DSODIR ?= ../DSO +@@ -62,16 +63,16 @@ else ifeq ($(SYSTEM), Linux) + os=linux + endif + +-CC = cc +-BISON = bison +-FLEX = flex +-ST = strip +-LD = ld ++CC ?= cc ++BISON ?= bison ++FLEX ?= flex ++ST ?= strip ++LD ?= ld + SOOPTS = -shared + CP = cp + RM = rm + LN = ln -s -f +-CFLAGS_COMMON = -I$(COREDIR) -I$(SHAREDDIR) -I$(DSODIR) -I$(PROXYDIR) -I$(OBJDIR) -fwrapv -W -Wall -DPID_FILE=\"/var/run/mdnsd.pid\" -DMDNS_UDS_SERVERPATH=\"/var/run/mdnsd\" ++CFLAGS_COMMON = -I$(POSIXDIR) -I$(COREDIR) -I$(SHAREDDIR) -I$(DSODIR) -I$(PROXYDIR) -I$(OBJDIR) -fwrapv -W -Wall -DPID_FILE=\"/var/run/mdnsd.pid\" -DMDNS_UDS_SERVERPATH=\"/var/run/mdnsd\" + CFLAGS_PTHREAD = + LINKOPTS = + LINKOPTS_PTHREAD = -lpthread +@@ -85,6 +86,7 @@ CFLAGS_OPEN_SOURCE= + endif + + # Set up diverging paths for debug vs. prod builds ++DEBUG ?= 1 + ifeq "$(DEBUG)" "1" + CFLAGS_DEBUGGING = -g -DMDNS_DEBUGMSGS=2 + OBJDIR = objects/debug +@@ -101,8 +103,8 @@ else + # 1. We want to make small binaries, suitable for putting into hardware devices + # 2. Some of the code analysis warnings only work when some form of optimization is enabled + CFLAGS_DEBUGGING = -g -DMDNS_DEBUGMSGS=0 +-OBJDIR ?= objects/prod +-BUILDDIR ?= build/prod ++OBJDIR = objects/prod ++BUILDDIR = build/prod + STRIP = $(ST) -S + endif + endif +@@ -125,7 +127,7 @@ else + # any target that contains the string "linux" + ifeq ($(findstring linux,$(os)),linux) + CFLAGS_OS = -D_GNU_SOURCE -DHAVE_IPV6 -DNOT_HAVE_SA_LEN -DUSES_NETLINK -DHAVE_LINUX -DTARGET_OS_LINUX -ftabstop=4 +-LD = $(CC) ++LD ?= $(CC) + SOOPTS = -shared + FLEXFLAGS_OS = -l + JAVACFLAGS_OS += -I$(JDK)/include/linux +@@ -276,8 +278,7 @@ Daemon: setup $(BUILDDIR)/mdnsd + @echo "Responder daemon done" + + $(BUILDDIR)/mdnsd: $(DAEMONOBJS) +- $(CC) -o $@ $+ $(LINKOPTS) +- $(STRIP) $@ ++ $(LD) -o $@ $+ + + # libdns_sd target builds the client library + libdns_sd: setup $(BUILDDIR)/libdns_sd.$(LDSUFFIX) +@@ -286,13 +287,9 @@ libdns_sd: setup $(BUILDDIR)/libdns_sd.$(LDSUFFIX) + CLIENTLIBOBJS = $(OBJDIR)/dnssd_clientlib.c.so.o $(OBJDIR)/dnssd_clientstub.c.so.o $(OBJDIR)/dnssd_ipc.c.so.o + + $(BUILDDIR)/libdns_sd.$(LDSUFFIX): $(CLIENTLIBOBJS) +- $(LD) $(SOOPTS) $(LINKOPTS) -o $@ $+ +- $(STRIP) $@ +- +-Clients: setup libdns_sd ../Clients/build/dns-sd +- @echo "Clients done" ++ $(LD) -shared $(LINKOPTS) -Wl,-soname,libdns_sd.$(LDSUFFIX).1 -o $@ $+ + +-../Clients/build/dns-sd: ../Clients/dns-sd.c ++Clients: setup libdns_sd + $(MAKE) -C ../Clients DEBUG=$(DEBUG) SUPMAKE_CFLAGS="$(MDNSCFLAGS)" + + # nss_mdns target builds the Name Service Switch module +@@ -300,8 +297,7 @@ nss_mdns: setup $(BUILDDIR)/$(NSSLIBFILE) + @echo "Name Service Switch module done" + + $(BUILDDIR)/$(NSSLIBFILE): $(CLIENTLIBOBJS) $(OBJDIR)/nss_mdns.c.so.o +- $(LD) $(SOOPTS) $(LINKOPTS) -o $@ $+ +- $(STRIP) $@ ++ $(LD) -shared $(LINKOPTS) -o $@ $+ + + ############################################################################# + +@@ -494,21 +490,21 @@ dnsextd: setup $(BUILDDIR)/dnsextd + @echo "dnsextd done" + + $(BUILDDIR)/mDNSClientPosix: $(APPOBJ) $(OBJDIR)/Client.c.o +- $(CC) $+ -o $@ $(LINKOPTS) ++ $(CC) $+ -o $@ + + $(BUILDDIR)/mDNSResponderPosix: $(COMMONOBJ) $(OBJDIR)/Responder.c.o +- $(CC) $+ -o $@ $(LINKOPTS) ++ $(CC) $+ -o $@ + + $(BUILDDIR)/mDNSProxyResponderPosix: $(COMMONOBJ) $(OBJDIR)/ProxyResponder.c.o +- $(CC) $+ -o $@ $(LINKOPTS) ++ $(CC) $+ -o $@ + + $(BUILDDIR)/mDNSNetMonitor: $(SPECIALOBJ) $(OBJDIR)/NetMonitor.c.o +- $(CC) $+ -o $@ $(LINKOPTS) ++ $(CC) $+ -o $@ + + $(OBJDIR)/NetMonitor.c.o: $(COREDIR)/mDNS.c # Note: NetMonitor.c textually imports mDNS.c + + $(BUILDDIR)/dnsextd: $(DNSEXTDOBJ) $(OBJDIR)/dnsextd.c.threadsafe.o +- $(CC) $+ -o $@ $(LINKOPTS) $(LINKOPTS_PTHREAD) ++ $(CC) $+ -o $@ $(LINKOPTS_PTHREAD) + + ############################################################################# + +-- +2.20.1 + diff --git a/meta-openembedded/meta-networking/recipes-protocols/mdns/files/0004-Use-list-for-changed-interfaces.patch b/meta-openembedded/meta-networking/recipes-protocols/mdns/files/0004-Use-list-for-changed-interfaces.patch index 05ad49b9f..db3a63ea4 100644 --- a/meta-openembedded/meta-networking/recipes-protocols/mdns/files/0004-Use-list-for-changed-interfaces.patch +++ b/meta-openembedded/meta-networking/recipes-protocols/mdns/files/0004-Use-list-for-changed-interfaces.patch @@ -1,4 +1,4 @@ -From e1f483510a1011e37540fdee8f3bc36111fa45a0 Mon Sep 17 00:00:00 2001 +From 798bfb5e984845a27874d1a244686db6e384d7b8 Mon Sep 17 00:00:00 2001 From: Nate Karstens <nate.karstens@garmin.com> Date: Thu, 13 Jul 2017 09:00:00 -0500 Subject: [PATCH 04/11] Use list for changed interfaces @@ -15,10 +15,10 @@ Signed-off-by: Nate Karstens <nate.karstens@garmin.com> 1 file changed, 52 insertions(+), 15 deletions(-) diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c -index 8fe22be..699855a 100644 +index 195d04b..bb883c1 100755 --- a/mDNSPosix/mDNSPosix.c +++ b/mDNSPosix/mDNSPosix.c -@@ -75,6 +75,14 @@ struct IfChangeRec +@@ -67,6 +67,14 @@ struct IfChangeRec }; typedef struct IfChangeRec IfChangeRec; @@ -31,9 +31,9 @@ index 8fe22be..699855a 100644 +typedef struct NetworkInterfaceIndex NetworkInterfaceIndex; + // Note that static data is initialized to zero in (modern) C. - static fd_set gEventFDs; - static int gMaxFD; // largest fd in gEventFDs -@@ -1071,6 +1079,32 @@ mDNSlocal mStatus OpenIfNotifySocket(int *pFD) + static PosixEventSource *gEventSources; // linked list of PosixEventSource's + static sigset_t gEventSignalSet; // Signals which event loop listens for +@@ -1458,6 +1466,32 @@ mDNSlocal mStatus OpenIfNotifySocket(int *pFD) return err; } @@ -66,7 +66,7 @@ index 8fe22be..699855a 100644 #if MDNS_DEBUGMSGS mDNSlocal void PrintNetLinkMsg(const struct nlmsghdr *pNLMsg) { -@@ -1098,14 +1132,13 @@ mDNSlocal void PrintNetLinkMsg(const struct nlmsghdr *pNLMsg) +@@ -1485,14 +1519,13 @@ mDNSlocal void PrintNetLinkMsg(const struct nlmsghdr *pNLMsg) } #endif @@ -82,7 +82,7 @@ index 8fe22be..699855a 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 -@@ -1141,9 +1174,9 @@ mDNSlocal mDNSu32 ProcessRoutingNotification(int sd) +@@ -1528,9 +1561,9 @@ mDNSlocal mDNSu32 ProcessRoutingNotification(int sd) // Process the NetLink message if (pNLMsg->nlmsg_type == RTM_GETLINK || pNLMsg->nlmsg_type == RTM_NEWLINK) @@ -94,7 +94,7 @@ index 8fe22be..699855a 100644 // Advance pNLMsg to the next message in the buffer if ((pNLMsg->nlmsg_flags & NLM_F_MULTI) != 0 && pNLMsg->nlmsg_type != NLMSG_DONE) -@@ -1154,8 +1187,6 @@ mDNSlocal mDNSu32 ProcessRoutingNotification(int sd) +@@ -1541,8 +1574,6 @@ mDNSlocal mDNSu32 ProcessRoutingNotification(int sd) else break; // all done! } @@ -103,7 +103,7 @@ index 8fe22be..699855a 100644 } #else // USES_NETLINK -@@ -1187,14 +1218,13 @@ mDNSlocal void PrintRoutingSocketMsg(const struct ifa_msghdr *pRSMsg) +@@ -1574,14 +1605,13 @@ mDNSlocal void PrintRoutingSocketMsg(const struct ifa_msghdr *pRSMsg) } #endif @@ -119,7 +119,7 @@ index 8fe22be..699855a 100644 readCount = read(sd, buff, sizeof buff); if (readCount < (ssize_t) sizeof(struct ifa_msghdr)) -@@ -1209,12 +1239,10 @@ mDNSlocal mDNSu32 ProcessRoutingNotification(int sd) +@@ -1596,12 +1626,10 @@ mDNSlocal mDNSu32 ProcessRoutingNotification(int sd) pRSMsg->ifam_type == RTM_IFINFO) { if (pRSMsg->ifam_type == RTM_IFINFO) @@ -134,7 +134,7 @@ index 8fe22be..699855a 100644 } #endif // USES_NETLINK -@@ -1224,7 +1252,8 @@ mDNSlocal void InterfaceChangeCallback(int fd, short filter, void *context) +@@ -1611,7 +1639,8 @@ mDNSlocal void InterfaceChangeCallback(int fd, void *context) { IfChangeRec *pChgRec = (IfChangeRec*) context; fd_set readFDs; @@ -144,7 +144,7 @@ index 8fe22be..699855a 100644 struct timeval zeroTimeout = { 0, 0 }; (void)fd; // Unused -@@ -1233,17 +1262,25 @@ mDNSlocal void InterfaceChangeCallback(int fd, short filter, void *context) +@@ -1619,17 +1648,25 @@ mDNSlocal void InterfaceChangeCallback(int fd, void *context) FD_ZERO(&readFDs); FD_SET(pChgRec->NotifySD, &readFDs); @@ -173,5 +173,5 @@ index 8fe22be..699855a 100644 // Register with either a Routing Socket or RtNetLink to listen for interface changes. -- -2.17.1 +2.20.1 diff --git a/meta-openembedded/meta-networking/recipes-protocols/mdns/files/0005-Handle-noisy-netlink-sockets.patch b/meta-openembedded/meta-networking/recipes-protocols/mdns/files/0005-Handle-noisy-netlink-sockets.patch deleted file mode 100644 index f2b171e55..000000000 --- a/meta-openembedded/meta-networking/recipes-protocols/mdns/files/0005-Handle-noisy-netlink-sockets.patch +++ /dev/null @@ -1,212 +0,0 @@ -From 92025cab86619f548bf3eb816a1804ef40507ca7 Mon Sep 17 00:00:00 2001 -From: Nate Karstens <nate.karstens@garmin.com> -Date: Mon, 24 Jul 2017 09:38:55 -0500 -Subject: [PATCH 05/11] Handle noisy netlink sockets - -The POSIX implementation currently clears all network interfaces -when netlink indicates that there has been a change. This causes -the following problems: - - 1) Applications are informed that all of the services they are - tracking have been removed. - 2) Increases network load because the client must re-query for - all records it is interested in. - -This changes netlink notification handling by: - - 1) Always comparing with the latest interface list returned - by the OS. - 2) Confirming that the interface has been changed in a way - that we care about. - -Upstream-Status: Submitted [dts@apple.com] - -Signed-off-by: Nate Karstens <nate.karstens@garmin.com> ---- - mDNSPosix/mDNSPosix.c | 143 +++++++++++++++++++++++++++++++++++++++--- - 1 file changed, 133 insertions(+), 10 deletions(-) - -diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c -index 699855a..59a8b8c 100644 ---- a/mDNSPosix/mDNSPosix.c -+++ b/mDNSPosix/mDNSPosix.c -@@ -1247,14 +1247,38 @@ mDNSlocal void ProcessRoutingNotification(int sd, GenLinkedList *change - - #endif // USES_NETLINK - -+// Test whether the given PosixNetworkInterface matches the given struct ifi_info -+mDNSlocal mDNSBool InterfacesMatch(PosixNetworkInterface *intf, struct ifi_info *ifi) -+{ -+ mDNSBool match = mDNSfalse; -+ mDNSAddr ip, mask; -+ -+ if((intf->index == ifi->ifi_index) && -+ (intf->sa_family == ifi->ifi_addr->sa_family) && -+ (strcmp(intf->coreIntf.ifname, ifi->ifi_name) == 0)) -+ { -+ SockAddrTomDNSAddr(ifi->ifi_addr, &ip, NULL); -+ SockAddrTomDNSAddr(ifi->ifi_netmask, &mask, NULL); -+ -+ match = mDNSSameAddress(&intf->coreIntf.ip, &ip) && -+ mDNSSameAddress(&intf->coreIntf.mask, &mask); -+ } -+ -+ return match; -+} -+ - // Called when data appears on interface change notification socket - mDNSlocal void InterfaceChangeCallback(int fd, short filter, void *context) - { - IfChangeRec *pChgRec = (IfChangeRec*) context; -+ mDNS *m = pChgRec->mDNS; - fd_set readFDs; - GenLinkedList changedInterfaces; - NetworkInterfaceIndex *changedInterface; - struct timeval zeroTimeout = { 0, 0 }; -+ struct ifi_info *ifi_list, **ifi, *ifi_free, *ifi_loop4 = NULL; -+ PosixNetworkInterface *intf, *intfNext; -+ mDNSBool found, foundav4; - - (void)fd; // Unused - (void)filter; // Unused -@@ -1270,12 +1294,115 @@ mDNSlocal void InterfaceChangeCallback(int fd, short filter, void *context) - } - while (0 < select(pChgRec->NotifySD + 1, &readFDs, (fd_set*) NULL, (fd_set*) NULL, &zeroTimeout)); - -- // Currently we rebuild the entire interface list whenever any interface change is -- // detected. If this ever proves to be a performance issue in a multi-homed -- // configuration, more care should be paid to changedInterfaces. -- if (changedInterfaces.Head != NULL) -- mDNSPlatformPosixRefreshInterfaceList(pChgRec->mDNS); -+ CleanRecentInterfaces(); -+ -+ if (changedInterfaces.Head == NULL) goto cleanup; -+ -+ ifi_list = get_ifi_info(AF_INET, mDNStrue); -+ if (ifi_list == NULL) goto cleanup; -+ -+#if HAVE_IPV6 -+ /* Link the IPv6 list to the end of the IPv4 list */ -+ ifi = &ifi_list; -+ while (*ifi != NULL) ifi = &(*ifi)->ifi_next; -+ *ifi = get_ifi_info(AF_INET6, mDNStrue); -+#endif -+ -+ for (intf = (PosixNetworkInterface*)(m->HostInterfaces); intf != NULL; intf = intfNext) -+ { -+ intfNext = (PosixNetworkInterface*)(intf->coreIntf.next); -+ -+ // Loopback interface(s) are handled later -+ if (intf->coreIntf.Loopback) continue; -+ -+ found = mDNSfalse; -+ for (ifi = &ifi_list; *ifi != NULL; ifi = &(*ifi)->ifi_next) -+ { -+ if (InterfacesMatch(intf, *ifi)) -+ { -+ found = mDNStrue; -+ -+ // Removes unchanged from ifi_list -+ ifi_free = *ifi; -+ *ifi = (*ifi)->ifi_next; -+ ifi_free->ifi_next = NULL; -+ free_ifi_info(ifi_free); -+ -+ break; -+ } -+ } -+ -+ // Removes changed and old interfaces from m->HostInterfaces -+ if (!found) TearDownInterface(m, intf); -+ } -+ -+ // Add new and changed interfaces in ifi_list -+ // Save off loopback interface in case it is needed later -+ for (ifi = &ifi_list; *ifi != NULL; ifi = &(*ifi)->ifi_next) -+ { -+ if ((ifi_loop4 == NULL) && -+ ((*ifi)->ifi_addr->sa_family == AF_INET) && -+ ((*ifi)->ifi_flags & IFF_UP) && -+ ((*ifi)->ifi_flags & IFF_LOOPBACK)) -+ { -+ ifi_loop4 = *ifi; -+ continue; -+ } -+ -+ if ( (((*ifi)->ifi_addr->sa_family == AF_INET) -+#if HAVE_IPV6 -+ || ((*ifi)->ifi_addr->sa_family == AF_INET6) -+#endif -+ ) && ((*ifi)->ifi_flags & IFF_UP) -+ && !((*ifi)->ifi_flags & IFF_POINTOPOINT) -+ && !((*ifi)->ifi_flags & IFF_LOOPBACK)) -+ { -+ SetupOneInterface(m, *ifi); -+ } -+ } -+ -+ // Determine if there is at least one non-loopback IPv4 interface. This is to work around issues -+ // with multicast loopback on IPv6 interfaces -- see corresponding logic in SetupInterfaceList(). -+ foundav4 = mDNSfalse; -+ for (intf = (PosixNetworkInterface*)(m->HostInterfaces); intf != NULL; intf = (PosixNetworkInterface*)(intf->coreIntf.next)) -+ { -+ if (intf->sa_family == AF_INET && !intf->coreIntf.Loopback) -+ { -+ foundav4 = mDNStrue; -+ break; -+ } -+ } -+ -+ if (foundav4) -+ { -+ for (intf = (PosixNetworkInterface*)(m->HostInterfaces); intf != NULL; intf = intfNext) -+ { -+ intfNext = (PosixNetworkInterface*)(intf->coreIntf.next); -+ if (intf->coreIntf.Loopback) TearDownInterface(m, intf); -+ } -+ } -+ else -+ { -+ found = mDNSfalse; -+ -+ for (intf = (PosixNetworkInterface*)(m->HostInterfaces); intf != NULL; intf = (PosixNetworkInterface*)(intf->coreIntf.next)) -+ { -+ if (intf->coreIntf.Loopback) -+ { -+ found = mDNStrue; -+ break; -+ } -+ } -+ -+ if (!found && (ifi_loop4 != NULL)) -+ { -+ SetupOneInterface(m, ifi_loop4); -+ } -+ } -+ -+ if (ifi_list != NULL) free_ifi_info(ifi_list); - -+cleanup: - while ((changedInterface = (NetworkInterfaceIndex*)changedInterfaces.Head) != NULL) - { - RemoveFromList(&changedInterfaces, changedInterface); -@@ -1400,15 +1527,11 @@ mDNSexport void mDNSPlatformClose(mDNS *const m) - #endif - } - --// This is used internally by InterfaceChangeCallback. --// It's also exported so that the Standalone Responder (mDNSResponderPosix) -+// This is exported so that the Standalone Responder (mDNSResponderPosix) - // can call it in response to a SIGHUP (mainly for debugging purposes). - mDNSexport mStatus mDNSPlatformPosixRefreshInterfaceList(mDNS *const m) - { - int err; -- // This is a pretty heavyweight way to process interface changes -- -- // destroying the entire interface list and then making fresh one from scratch. -- // We should make it like the OS X version, which leaves unchanged interfaces alone. - ClearInterfaceList(m); - err = SetupInterfaceList(m); - return PosixErrorToStatus(err); --- -2.17.1 - diff --git a/meta-openembedded/meta-networking/recipes-protocols/mdns/files/0007-Indicate-loopback-interface-to-mDNS-core.patch b/meta-openembedded/meta-networking/recipes-protocols/mdns/files/0007-Indicate-loopback-interface-to-mDNS-core.patch deleted file mode 100644 index 86201c650..000000000 --- a/meta-openembedded/meta-networking/recipes-protocols/mdns/files/0007-Indicate-loopback-interface-to-mDNS-core.patch +++ /dev/null @@ -1,129 +0,0 @@ -From 07a9401d84804d7f0181aa4fb0f13a54b2a1c9a8 Mon Sep 17 00:00:00 2001 -From: Nate Karstens <nate.karstens@garmin.com> -Date: Tue, 1 Aug 2017 17:06:01 -0500 -Subject: [PATCH 07/11] Indicate loopback interface to mDNS core - -Tells the mDNS core if an interface is a loopback interface, -similar to AddInterfaceToList() in the MacOS implementation. -Also reorganizes SetupOneInterface() to use a const struct -rather than growing its parameter list again. - -Upstream-Status: Submitted [dts@apple.com] - -Signed-off-by: Nate Karstens <nate.karstens@garmin.com> ---- - mDNSPosix/mDNSPosix.c | 37 ++++++++++++++++++------------------- - 1 file changed, 18 insertions(+), 19 deletions(-) - -diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c -index 3fc5451..798ab10 100644 ---- a/mDNSPosix/mDNSPosix.c -+++ b/mDNSPosix/mDNSPosix.c -@@ -889,16 +889,14 @@ mDNSlocal void CleanRecentInterfaces(void) - - // Creates a PosixNetworkInterface for the interface whose IP address is - // intfAddr and whose name is intfName and registers it with mDNS core. --mDNSlocal int SetupOneInterface(mDNS *const m, struct sockaddr *intfAddr, struct sockaddr *intfMask, const char *intfName, int intfIndex) -+mDNSlocal int SetupOneInterface(mDNS *const m, struct ifi_info *const ifi) - { - int err = 0; - PosixNetworkInterface *intf; - PosixNetworkInterface *alias = NULL; - - assert(m != NULL); -- assert(intfAddr != NULL); -- assert(intfName != NULL); -- assert(intfMask != NULL); -+ assert(ifi != NULL); - - // Allocate the interface structure itself. - intf = (PosixNetworkInterface*)calloc(1, sizeof(*intf)); -@@ -907,26 +905,27 @@ mDNSlocal int SetupOneInterface(mDNS *const m, struct sockaddr *intfAddr, struct - // And make a copy of the intfName. - if (err == 0) - { -- intf->intfName = strdup(intfName); -+ intf->intfName = strdup(ifi->ifi_name); - if (intf->intfName == NULL) { assert(0); err = ENOMEM; } - } - - if (err == 0) - { - // Set up the fields required by the mDNS core. -- SockAddrTomDNSAddr(intfAddr, &intf->coreIntf.ip, NULL); -- SockAddrTomDNSAddr(intfMask, &intf->coreIntf.mask, NULL); -+ SockAddrTomDNSAddr(ifi->ifi_addr, &intf->coreIntf.ip, NULL); -+ SockAddrTomDNSAddr(ifi->ifi_netmask, &intf->coreIntf.mask, NULL); - - //LogMsg("SetupOneInterface: %#a %#a", &intf->coreIntf.ip, &intf->coreIntf.mask); -- strncpy(intf->coreIntf.ifname, intfName, sizeof(intf->coreIntf.ifname)); -+ strncpy(intf->coreIntf.ifname, ifi->ifi_name, sizeof(intf->coreIntf.ifname)); - intf->coreIntf.ifname[sizeof(intf->coreIntf.ifname)-1] = 0; - intf->coreIntf.Advertise = m->AdvertiseLocalAddresses; - intf->coreIntf.McastTxRx = mDNStrue; -+ intf->coreIntf.Loopback = ((ifi->ifi_flags & IFF_LOOPBACK) != 0) ? mDNStrue : mDNSfalse; - - // Set up the extra fields in PosixNetworkInterface. - assert(intf->intfName != NULL); // intf->intfName already set up above -- intf->index = intfIndex; -- intf->sa_family = intfAddr->sa_family; -+ intf->index = ifi->ifi_index; -+ intf->sa_family = ifi->ifi_addr->sa_family; - intf->multicastSocket4 = -1; - #if HAVE_IPV6 - intf->multicastSocket6 = -1; -@@ -936,17 +935,17 @@ mDNSlocal int SetupOneInterface(mDNS *const m, struct sockaddr *intfAddr, struct - intf->coreIntf.InterfaceID = (mDNSInterfaceID)alias; - - if (alias != intf) -- debugf("SetupOneInterface: %s %#a is an alias of %#a", intfName, &intf->coreIntf.ip, &alias->coreIntf.ip); -+ debugf("SetupOneInterface: %s %#a is an alias of %#a", ifi->ifi_name, &intf->coreIntf.ip, &alias->coreIntf.ip); - } - - // Set up the multicast socket - if (err == 0) - { -- if (alias->multicastSocket4 == -1 && intfAddr->sa_family == AF_INET) -- err = SetupSocket(intfAddr, MulticastDNSPort, intf->index, &alias->multicastSocket4); -+ if (alias->multicastSocket4 == -1 && ifi->ifi_addr->sa_family == AF_INET) -+ err = SetupSocket(ifi->ifi_addr, MulticastDNSPort, intf->index, &alias->multicastSocket4); - #if HAVE_IPV6 -- else if (alias->multicastSocket6 == -1 && intfAddr->sa_family == AF_INET6) -- err = SetupSocket(intfAddr, MulticastDNSPort, intf->index, &alias->multicastSocket6); -+ else if (alias->multicastSocket6 == -1 && ifi->ifi_addr->sa_family == AF_INET6) -+ err = SetupSocket(ifi->ifi_addr, MulticastDNSPort, intf->index, &alias->multicastSocket6); - #endif - } - -@@ -973,8 +972,8 @@ mDNSlocal int SetupOneInterface(mDNS *const m, struct sockaddr *intfAddr, struct - } - else - { -- // Use intfName instead of intf->intfName in the next line to avoid dereferencing NULL. -- debugf("SetupOneInterface: %s %#a failed to register %d", intfName, &intf->coreIntf.ip, err); -+ // Use ifi->ifi_name instead of intf->intfName in the next line to avoid dereferencing NULL. -+ debugf("SetupOneInterface: %s %#a failed to register %d", ifi->ifi_name, &intf->coreIntf.ip, err); - if (intf) { FreePosixNetworkInterface(intf); intf = NULL; } - } - -@@ -1023,7 +1022,7 @@ mDNSlocal int SetupInterfaceList(mDNS *const m) - } - else - { -- if (SetupOneInterface(m, i->ifi_addr, i->ifi_netmask, i->ifi_name, i->ifi_index) == 0) -+ if (SetupOneInterface(m, i) == 0) - if (i->ifi_addr->sa_family == AF_INET) - foundav4 = mDNStrue; - } -@@ -1037,7 +1036,7 @@ mDNSlocal int SetupInterfaceList(mDNS *const m) - // In the interim, we skip loopback interface only if we found at least one v4 interface to use - // if ((m->HostInterfaces == NULL) && (firstLoopback != NULL)) - if (!foundav4 && firstLoopback) -- (void) SetupOneInterface(m, firstLoopback->ifi_addr, firstLoopback->ifi_netmask, firstLoopback->ifi_name, firstLoopback->ifi_index); -+ (void) SetupOneInterface(m, firstLoopback); - } - - // Clean up. --- -2.17.1 - diff --git a/meta-openembedded/meta-networking/recipes-protocols/mdns/files/0011-Change-a-dynamic-allocation-to-file-scope-variable.patch b/meta-openembedded/meta-networking/recipes-protocols/mdns/files/0011-Change-a-dynamic-allocation-to-file-scope-variable.patch index d64fb35db..d9adde04c 100644 --- a/meta-openembedded/meta-networking/recipes-protocols/mdns/files/0011-Change-a-dynamic-allocation-to-file-scope-variable.patch +++ b/meta-openembedded/meta-networking/recipes-protocols/mdns/files/0011-Change-a-dynamic-allocation-to-file-scope-variable.patch @@ -1,7 +1,7 @@ -From 19de26db69408f02241e232b39224589a0f630df Mon Sep 17 00:00:00 2001 +From 9ff06108cd44e84ba6c68bfa6737e793f117e303 Mon Sep 17 00:00:00 2001 From: Nate Karstens <nate.karstens@garmin.com> Date: Thu, 10 Aug 2017 08:46:03 -0500 -Subject: [PATCH 11/11] Change a dynamic allocation to file-scope variable +Subject: [PATCH] Change a dynamic allocation to file-scope variable Changes a variable from being dynamically-allocated to being statically-allocated at the file scope. Addresses a Coverity @@ -11,14 +11,14 @@ Upstream-Status: Submitted [dts@apple.com] Signed-off-by: Nate Karstens <nate.karstens@garmin.com> --- - mDNSPosix/mDNSPosix.c | 12 ++++-------- - 1 file changed, 4 insertions(+), 8 deletions(-) + mDNSPosix/mDNSPosix.c | 14 ++++---------- + 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c -index 84af26b..b7795ed 100644 +index 7aeee7b..2d25016 100755 --- a/mDNSPosix/mDNSPosix.c +++ b/mDNSPosix/mDNSPosix.c -@@ -91,6 +91,7 @@ static sigset_t gEventSignalSet; // Signals which event loop list +@@ -81,6 +81,7 @@ static sigset_t gEventSignalSet; // Signals which event loop list static sigset_t gEventSignals; // Signals which were received while inside loop static PosixNetworkInterface *gRecentInterfaces; @@ -26,13 +26,13 @@ index 84af26b..b7795ed 100644 // *************************************************************************** // Globals (for debugging) -@@ -1412,16 +1413,11 @@ cleanup: +@@ -1641,18 +1642,11 @@ mDNSlocal void InterfaceChangeCallback(int fd, void *context) mDNSlocal mStatus WatchForInterfaceChange(mDNS *const m) { mStatus err; - IfChangeRec *pChgRec; -- pChgRec = (IfChangeRec*) mDNSPlatformMemAllocate(sizeof *pChgRec); +- pChgRec = (IfChangeRec*) mDNSPlatformMemAllocateClear(sizeof *pChgRec); - if (pChgRec == NULL) - return mStatus_NoMemoryErr; - @@ -42,10 +42,12 @@ index 84af26b..b7795ed 100644 + err = OpenIfNotifySocket(&gChgRec.NotifySD); if (err == 0) - err = mDNSPosixAddFDToEventLoop(pChgRec->NotifySD, InterfaceChangeCallback, pChgRec); +- if (err) +- mDNSPlatformMemFree(pChgRec); + err = mDNSPosixAddFDToEventLoop(gChgRec.NotifySD, InterfaceChangeCallback, &gChgRec); return err; } -- -2.17.1 +2.20.1 diff --git a/meta-openembedded/meta-networking/recipes-protocols/mdns/files/build.patch b/meta-openembedded/meta-networking/recipes-protocols/mdns/files/build.patch deleted file mode 100644 index 4ab9d23bf..000000000 --- a/meta-openembedded/meta-networking/recipes-protocols/mdns/files/build.patch +++ /dev/null @@ -1,167 +0,0 @@ -From 43b6e98c9c37afd0d914949dcff4eab81f5a995f Mon Sep 17 00:00:00 2001 -From: Brendan Le Foll <brendan.le.foll@intel.com> -Date: Tue, 3 Mar 2015 11:42:57 +0000 - -Upstream-Status: Inappropriate [OE-specific] - -Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> - ---- - mDNSPosix/Makefile | 54 +++++++++++++++++++++++++----------------------------- - 1 file changed, 25 insertions(+), 29 deletions(-) - -diff --git a/mDNSPosix/Makefile b/mDNSPosix/Makefile -index 4f98e90..8ac97ad 100755 ---- a/mDNSPosix/Makefile -+++ b/mDNSPosix/Makefile -@@ -50,6 +50,7 @@ - - LIBVERS = 1 - -+POSIXDIR = ../mDNSPosix - COREDIR = ../mDNSCore - SHAREDDIR ?= ../mDNSShared - JDK = /usr/jdk -@@ -58,11 +59,11 @@ CC = @cc - BISON = @bison - FLEX = @flex - ST = @strip --LD = ld -shared -+LD =@LD - CP = cp - RM = rm - LN = ln -s -f --CFLAGS_COMMON = -I$(COREDIR) -I$(SHAREDDIR) -I$(OBJDIR) -fwrapv -W -Wall -DPID_FILE=\"/var/run/mdnsd.pid\" -DMDNS_UDS_SERVERPATH=\"/var/run/mdnsd\" -+CFLAGS_COMMON = -I$(POSIXDIR) -I$(COREDIR) -I$(SHAREDDIR) -I$(OBJDIR) -fwrapv -W -Wall -DPID_FILE=\"/var/run/mdnsd.pid\" -DMDNS_UDS_SERVERPATH=\"/var/run/mdnsd\" - CFLAGS_PTHREAD = - LINKOPTS = - LINKOPTS_PTHREAD = -lpthread -@@ -70,7 +71,7 @@ LDSUFFIX = so - JAVACFLAGS_OS = -fPIC -shared -ldns_sd - - # Set up diverging paths for debug vs. prod builds --DEBUG=0 -+DEBUG?=1 - ifeq ($(DEBUG),1) - CFLAGS_DEBUG = -g -DMDNS_DEBUGMSGS=2 - OBJDIR = objects/debug -@@ -213,7 +214,7 @@ endif - endif - endif - --CFLAGS = $(CFLAGS_COMMON) $(CFLAGS_OS) $(CFLAGS_DEBUG) -+CFLAGS_BUILD = $(CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_OS) $(CFLAGS_DEBUG) - - ############################################################################# - -@@ -249,8 +250,7 @@ Daemon: setup $(BUILDDIR)/mdnsd - @echo "Responder daemon done" - - $(BUILDDIR)/mdnsd: $(DAEMONOBJS) -- $(CC) -o $@ $+ $(LINKOPTS) -- @$(STRIP) $@ -+ $(CC) -o $@ $+ - - # libdns_sd target builds the client library - libdns_sd: setup $(BUILDDIR)/libdns_sd.$(LDSUFFIX) -@@ -259,22 +259,18 @@ libdns_sd: setup $(BUILDDIR)/libdns_sd.$(LDSUFFIX) - CLIENTLIBOBJS = $(OBJDIR)/dnssd_clientlib.c.so.o $(OBJDIR)/dnssd_clientstub.c.so.o $(OBJDIR)/dnssd_ipc.c.so.o - - $(BUILDDIR)/libdns_sd.$(LDSUFFIX): $(CLIENTLIBOBJS) -- @$(LD) $(LINKOPTS) -o $@ $+ -- @$(STRIP) $@ -+ $(LD) -shared $(LINKOPTS) -Wl,-soname,libdns_sd.$(LDSUFFIX).1 -o $@ $+ - --Clients: setup libdns_sd ../Clients/build/dns-sd -+Clients: setup libdns_sd -+ @$(MAKE) -C ../Clients DEBUG=${DEBUG} - @echo "Clients done" - --../Clients/build/dns-sd: -- @$(MAKE) -C ../Clients -- - # nss_mdns target builds the Name Service Switch module - nss_mdns: setup $(BUILDDIR)/$(NSSLIBFILE) - @echo "Name Service Switch module done" - - $(BUILDDIR)/$(NSSLIBFILE): $(CLIENTLIBOBJS) $(OBJDIR)/nss_mdns.c.so.o -- @$(LD) $(LINKOPTS) -o $@ $+ -- @$(STRIP) $@ -+ $(LD) -shared $(LINKOPTS) -o $@ $+ - - ############################################################################# - -@@ -470,55 +466,55 @@ dnsextd: setup $(BUILDDIR)/dnsextd - @echo "dnsextd done" - - $(BUILDDIR)/mDNSClientPosix: $(APPOBJ) $(OBJDIR)/Client.c.o -- $(CC) $+ -o $@ $(LINKOPTS) -+ $(CC) $+ -o $@ - - $(BUILDDIR)/mDNSResponderPosix: $(COMMONOBJ) $(OBJDIR)/Responder.c.o -- $(CC) $+ -o $@ $(LINKOPTS) -+ $(CC) $+ -o $@ - - $(BUILDDIR)/mDNSProxyResponderPosix: $(COMMONOBJ) $(OBJDIR)/ProxyResponder.c.o -- $(CC) $+ -o $@ $(LINKOPTS) -+ $(CC) $+ -o $@ - - $(BUILDDIR)/mDNSIdentify: $(SPECIALOBJ) $(OBJDIR)/Identify.c.o -- $(CC) $+ -o $@ $(LINKOPTS) -+ $(CC) $+ -o $@ - - $(OBJDIR)/Identify.c.o: $(COREDIR)/mDNS.c # Note: Identify.c textually imports mDNS.c - - $(BUILDDIR)/mDNSNetMonitor: $(SPECIALOBJ) $(OBJDIR)/NetMonitor.c.o -- $(CC) $+ -o $@ $(LINKOPTS) -+ $(CC) $+ -o $@ - - $(OBJDIR)/NetMonitor.c.o: $(COREDIR)/mDNS.c # Note: NetMonitor.c textually imports mDNS.c - - $(BUILDDIR)/dnsextd: $(DNSEXTDOBJ) $(OBJDIR)/dnsextd.c.threadsafe.o -- $(CC) $+ -o $@ $(LINKOPTS) $(LINKOPTS_PTHREAD) -+ $(CC) $+ -o $@ $(LINKOPTS_PTHREAD) - - ############################################################################# - - # Implicit rules - $(OBJDIR)/%.c.o: %.c -- $(CC) $(CFLAGS) -c -o $@ $< -+ $(CC) $(CFLAGS_BUILD) -c -o $@ $< - - $(OBJDIR)/%.c.o: $(COREDIR)/%.c -- $(CC) $(CFLAGS) -c -o $@ $< -+ $(CC) $(CFLAGS_BUILD) -c -o $@ $< - - $(OBJDIR)/%.c.o: $(SHAREDDIR)/%.c -- $(CC) $(CFLAGS) -c -o $@ $< -+ $(CC) $(CFLAGS_BUILD) -c -o $@ $< - - $(OBJDIR)/%.c.threadsafe.o: %.c -- $(CC) $(CFLAGS) $(CFLAGS_PTHREAD) -D_REENTRANT -c -o $@ $< -+ $(CC) $(CFLAGS_BUILD) $(CFLAGS_PTHREAD) -D_REENTRANT -c -o $@ $< - - $(OBJDIR)/%.c.threadsafe.o: $(SHAREDDIR)/%.c -- $(CC) $(CFLAGS) $(CFLAGS_PTHREAD) -D_REENTRANT -c -o $@ $< -+ $(CC) $(CFLAGS_BUILD) $(CFLAGS_PTHREAD) -D_REENTRANT -c -o $@ $< - - $(OBJDIR)/%.c.so.o: %.c -- $(CC) $(CFLAGS) -c -fPIC -o $@ $< -+ $(CC) $(CFLAGS_BUILD) -c -fPIC -o $@ $< - - $(OBJDIR)/%.c.so.o: $(SHAREDDIR)/%.c -- $(CC) $(CFLAGS) -c -fPIC -o $@ $< -+ $(CC) $(CFLAGS_BUILD) -c -fPIC -o $@ $< - - $(OBJDIR)/%.y.o: $(SHAREDDIR)/%.y - $(BISON) -o $(OBJDIR)/$*.c -d $< -- $(CC) $(CFLAGS) -c -o $@ $(OBJDIR)/$*.c -+ $(CC) $(CFLAGS_BUILD) -c -o $@ $(OBJDIR)/$*.c - - $(OBJDIR)/%.l.o: $(SHAREDDIR)/%.l - $(FLEX) $(FLEXFLAGS_OS) -i -o$(OBJDIR)/$*.l.c $< -- $(CC) $(CFLAGS) -Wno-error -c -o $@ $(OBJDIR)/$*.l.c -+ $(CC) $(CFLAGS_BUILD) -Wno-error -c -o $@ $(OBJDIR)/$*.l.c --- -2.9.5 - diff --git a/meta-openembedded/meta-networking/recipes-protocols/mdns/mdns_878.270.2.bb b/meta-openembedded/meta-networking/recipes-protocols/mdns/mdns_1096.40.7.bb index 0f8dc92df..086b40869 100644 --- a/meta-openembedded/meta-networking/recipes-protocols/mdns/mdns_878.270.2.bb +++ b/meta-openembedded/meta-networking/recipes-protocols/mdns/mdns_1096.40.7.bb @@ -1,7 +1,7 @@ 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" +LICENSE = "Apache-2.0 & BSD-3-Clause" LIC_FILES_CHKSUM = "file://../LICENSE;md5=31c50371921e0fb731003bbc665f29bf" COMPATIBLE_HOST_libc-musl = 'null' @@ -9,22 +9,23 @@ COMPATIBLE_HOST_libc-musl = 'null' RPROVIDES_${PN} += "libdns_sd.so" SRC_URI = "https://opensource.apple.com/tarballs/mDNSResponder/mDNSResponder-${PV}.tar.gz \ - file://build.patch;patchdir=.. \ file://mdns.service \ + file://0001-mdns-include-stddef.h-for-NULL.patch;patchdir=.. \ + file://0002-mdns-cross-compilation-fixes-for-bitbake.patch;patchdir=.. \ file://0001-Create-subroutine-for-cleaning-recent-interfaces.patch;patchdir=.. \ file://0002-Create-subroutine-for-tearing-down-an-interface.patch;patchdir=.. \ file://0003-Track-interface-socket-family.patch;patchdir=.. \ file://0004-Use-list-for-changed-interfaces.patch;patchdir=.. \ - file://0005-Handle-noisy-netlink-sockets.patch;patchdir=.. \ file://0006-Remove-unneeded-function.patch;patchdir=.. \ - file://0007-Indicate-loopback-interface-to-mDNS-core.patch;patchdir=.. \ file://0008-Mark-deleted-interfaces-as-being-changed.patch;patchdir=.. \ file://0009-Fix-possible-NULL-dereference.patch;patchdir=.. \ file://0010-Handle-errors-from-socket-calls.patch;patchdir=.. \ file://0011-Change-a-dynamic-allocation-to-file-scope-variable.patch;patchdir=.. \ " -SRC_URI[md5sum] = "4e139a8e1133349006b0436291c9e29b" -SRC_URI[sha256sum] = "2cef0ee9900504c5277fb81de0a28e6c0835fe482ebecf1067c6864f5c4eda74" +SRC_URI[md5sum] = "ac766013bbcb323e9db4c80805b2552a" +SRC_URI[sha256sum] = "b86f4816b4145915198e7c5bf0bc56dbbfd960e9a4518bb6486baa40cdcca7e6" + +CVE_PRODUCT = "apple:mdnsresponder" PARALLEL_MAKE = "" diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-Add-pkg-config-support-for-building-applications-and.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-Add-pkg-config-support-for-building-applications-and.patch deleted file mode 100644 index 6cb9588eb..000000000 --- a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-Add-pkg-config-support-for-building-applications-and.patch +++ /dev/null @@ -1,170 +0,0 @@ -From aea8c2f0bf8004c8da8ca9acb04ab07798cd8068 Mon Sep 17 00:00:00 2001 -From: Hugh McMaster <hugh.mcmaster@outlook.com> -Date: Wed, 3 Apr 2019 21:36:03 +1100 -Subject: [PATCH] Add pkg-config support for building applications and - sub-agents - -The netsnmp package should be used when building Net-SNMP applications. -The netsnmp-agent package should be used when building Net-SNMP subagents. - -Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com> -[ bvanassche: edited makefile code and .pc files; added ./configure changes ] - - -Upstream-Status: Backport -https://sourceforge.net/p/net-snmp/patches/_discuss/thread/a0d66e91dd/f940/attachment/0001-Add-pkg-config-support-for-building-applications-and.patch - ---- - Makefile.in | 2 ++ - Makefile.rules | 30 ++++++++++++++++++++++++++---- - configure | 4 ++++ - configure.ac | 1 + - netsnmp-agent.pc.in | 12 ++++++++++++ - netsnmp.pc.in | 12 ++++++++++++ - 6 files changed, 57 insertions(+), 4 deletions(-) - create mode 100644 netsnmp-agent.pc.in - create mode 100644 netsnmp.pc.in - -diff --git a/Makefile.in b/Makefile.in -index 9dbdde1353b1..ec972636c279 100644 ---- a/Makefile.in -+++ b/Makefile.in -@@ -35,6 +35,7 @@ INSTALLBUILTHEADERS=include/net-snmp/net-snmp-config.h - INSTALLBUILTINCLUDEHEADERS=@FEATUREHEADERS@ - INSTALLBINSCRIPTS=net-snmp-config net-snmp-create-v3-user - INSTALLUCDHEADERS=ucd-snmp-config.h version.h mib_module_config.h -+INSTALL_PKGCONFIG=netsnmp.pc netsnmp-agent.pc - - # - # other install rules. -@@ -275,6 +276,7 @@ configclean: makefileclean - libtool include/net-snmp/net-snmp-config.h \ - net-snmp-config net-snmp-config-x configure-summary \ - net-snmp-create-v3-user net-snmp-create-v3-user-x -+ rm -f *.pc - rm -f mibs/.index - rm -f include/net-snmp/agent/mib_module_config.h \ - include/net-snmp/agent/agent_module_config.h \ -diff --git a/Makefile.rules b/Makefile.rules -index 9e9e9009e5d2..e714f91e725e 100644 ---- a/Makefile.rules -+++ b/Makefile.rules -@@ -85,12 +85,14 @@ subdirs: - # installlibs handles local, ucd and subdir libs. need to do subdir libs - # before bins, sinze those libs may be needed for successful linking - install: installlocalheaders @installucdheaders@ \ -- installlibs \ -- installlocalbin installlocalsbin \ -+ installlibs install_pkgconfig \ -+ installlocalbin installlocalsbin \ - installsubdirs $(OTHERINSTALL) - --uninstall: uninstalllibs uninstallbin uninstallsbin uninstallheaders \ -- uninstallsubdirs $(OTHERUNINSTALL) -+uninstall: uninstalllibs uninstall_pkgconfig \ -+ uninstallbin uninstallsbin \ -+ uninstallheaders \ -+ uninstallsubdirs $(OTHERUNINSTALL) - - installprogs: installbin installsbin - -@@ -287,6 +289,26 @@ uninstalllibs: - done \ - fi - -+# -+# pkg-config files -+# -+install_pkgconfig: $(INSTALL_PKGCONFIG) -+ @if test "x$(INSTALL_PKGCONFIG)" != x; then \ -+ $(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(libdir)/pkgconfig; \ -+ for i in $(INSTALL_PKGCONFIG); do \ -+ echo "installing $$i in $(INSTALL_PREFIX)$(libdir)/pkgconfig"; \ -+ done; \ -+ $(INSTALL) $(INSTALL_PKGCONFIG) $(INSTALL_PREFIX)$(libdir)/pkgconfig; \ -+ fi -+ -+uninstall_pkgconfig: -+ @if test "x$(INSTALL_PKGCONFIG)" != x; then \ -+ for i in $(INSTALL_PKGCONFIG); do \ -+ echo "removing $$i from $(INSTALL_PREFIX)$(libdir)/pkgconfig"; \ -+ $(UNINSTALL) $(INSTALL_PREFIX)$(libdir)/pkgconfig/$$i;\ -+ done; \ -+ fi -+ - # - # normal bin binaries - # -diff --git a/configure b/configure -index 5ec44f5ce082..5103a4dc9d88 100755 ---- a/configure -+++ b/configure -@@ -30422,6 +30422,8 @@ ac_config_files="$ac_config_files net-snmp-config:net-snmp-config.in" - - ac_config_files="$ac_config_files net-snmp-create-v3-user:net-snmp-create-v3-user.in" - -+ac_config_files="$ac_config_files netsnmp.pc:netsnmp.pc.in netsnmp-agent.pc:netsnmp-agent.pc.in" -+ - ac_config_files="$ac_config_files dist/generation-scripts/gen-variables:dist/generation-scripts/gen-variables.in" - - ac_config_files="$ac_config_files local/snmpconf" -@@ -31445,6 +31447,8 @@ do - "mibs/Makefile") CONFIG_FILES="$CONFIG_FILES mibs/Makefile:Makefile.top:mibs/Makefile.in:Makefile.rules" ;; - "net-snmp-config") CONFIG_FILES="$CONFIG_FILES net-snmp-config:net-snmp-config.in" ;; - "net-snmp-create-v3-user") CONFIG_FILES="$CONFIG_FILES net-snmp-create-v3-user:net-snmp-create-v3-user.in" ;; -+ "netsnmp.pc") CONFIG_FILES="$CONFIG_FILES netsnmp.pc:netsnmp.pc.in" ;; -+ "netsnmp-agent.pc") CONFIG_FILES="$CONFIG_FILES netsnmp-agent.pc:netsnmp-agent.pc.in" ;; - "dist/generation-scripts/gen-variables") CONFIG_FILES="$CONFIG_FILES dist/generation-scripts/gen-variables:dist/generation-scripts/gen-variables.in" ;; - "local/snmpconf") CONFIG_FILES="$CONFIG_FILES local/snmpconf" ;; - "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; -diff --git a/configure.ac b/configure.ac -index 4c4dce09d488..d62a02da5d88 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -136,6 +136,7 @@ AC_CONFIG_FILES([net-snmp-config:net-snmp-config.in], - [chmod +x net-snmp-config]) - AC_CONFIG_FILES([net-snmp-create-v3-user:net-snmp-create-v3-user.in], - [chmod +x net-snmp-create-v3-user]) -+AC_CONFIG_FILES([netsnmp.pc:netsnmp.pc.in netsnmp-agent.pc:netsnmp-agent.pc.in]) - AC_CONFIG_FILES([dist/generation-scripts/gen-variables:dist/generation-scripts/gen-variables.in]) - AC_CONFIG_FILES([local/snmpconf]) - -diff --git a/netsnmp-agent.pc.in b/netsnmp-agent.pc.in -new file mode 100644 -index 000000000000..3a1c77bbf814 ---- /dev/null -+++ b/netsnmp-agent.pc.in -@@ -0,0 +1,12 @@ -+prefix=@prefix@ -+exec_prefix=@exec_prefix@ -+includedir=@includedir@ -+libdir=@libdir@ -+ -+Name: netsnmp-agent (@PACKAGE_NAME@) -+Description: SNMP (Simple Network Management Protocol) sub-agent SDK. -+URL: http://www.net-snmp.org -+Version: @PACKAGE_VERSION@ -+Cflags: -I${includedir} -+Libs: -L${libdir} -lnetsnmpmibs -lnetsnmpagent -lnetsnmp -+Libs.private: @LDFLAGS@ @LMIBLIBS@ @LAGENTLIBS@ @PERLLDOPTS_FOR_APPS@ @LNETSNMPLIBS@ @LIBS@ -diff --git a/netsnmp.pc.in b/netsnmp.pc.in -new file mode 100644 -index 000000000000..0a1f5785a4f4 ---- /dev/null -+++ b/netsnmp.pc.in -@@ -0,0 +1,12 @@ -+prefix=@prefix@ -+exec_prefix=@exec_prefix@ -+includedir=@includedir@ -+libdir=@libdir@ -+ -+Name: netsnmp (@PACKAGE_NAME@) -+Description: SNMP (Simple Network Management Protocol) daemon and applications. -+URL: http://www.net-snmp.org -+Version: @PACKAGE_VERSION@ -+Cflags: -I${includedir} -+Libs: -L${libdir} -lnetsnmp -+Libs.private: @LDFLAGS@ @LNETSNMPLIBS@ @LIBS@ @PERLLDOPTS_FOR_APPS@ --- -2.21.0.196.g041f5ea1cf98 - diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-config_os_headers-Error-Fix.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-config_os_headers-Error-Fix.patch index bfc55a08a..05a47f61c 100644 --- a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-config_os_headers-Error-Fix.patch +++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-config_os_headers-Error-Fix.patch @@ -1,4 +1,4 @@ -From 7ae2ce8dbf1c54d4e2db4a5f49397a239baadc49 Mon Sep 17 00:00:00 2001 +From 69d4c517c07f55c505090e48d96ace8cd599fb26 Mon Sep 17 00:00:00 2001 From: Li xin <lixin.fnst@cn.fujitsu.com> Date: Fri, 21 Aug 2015 18:23:13 +0900 Subject: [PATCH] config_os_headers: Error Fix @@ -19,10 +19,10 @@ Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com> 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.d/config_os_headers b/configure.d/config_os_headers -index af99746..83b2e31 100644 +index f07d512..2363b42 100644 --- a/configure.d/config_os_headers +++ b/configure.d/config_os_headers -@@ -489,8 +489,8 @@ then +@@ -395,8 +395,8 @@ then unset ac_cv_header_pkg_h netsnmp_save_CPPFLAGS="$CPPFLAGS" netsnmp_save_LDFLAGS="$LDFLAGS" diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-get_pid_from_inode-Include-limit.h.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-get_pid_from_inode-Include-limit.h.patch index bf133b3e3..22e591556 100644 --- a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-get_pid_from_inode-Include-limit.h.patch +++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-get_pid_from_inode-Include-limit.h.patch @@ -1,4 +1,4 @@ -From 98c6edba4835b515d933542411d80879327eee16 Mon Sep 17 00:00:00 2001 +From 2bf1bbe1d428ed06d57aa76b03e394b72ff2216d Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Fri, 22 Jul 2016 18:34:39 +0000 Subject: [PATCH] get_pid_from_inode: Include limit.h diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-net-snmp-fix-compile-error-disable-des.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-net-snmp-fix-compile-error-disable-des.patch deleted file mode 100644 index 7e686ce7f..000000000 --- a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-net-snmp-fix-compile-error-disable-des.patch +++ /dev/null @@ -1,62 +0,0 @@ -From e38c508ef401593b1d4fe42b62e42a49cfec82af Mon Sep 17 00:00:00 2001 -From: Changqing Li <changqing.li@windriver.com> -Date: Tue, 26 Feb 2019 14:26:07 +0800 -Subject: [PATCH] net-snmp: fix compile error with --disable-des - -| scapi.c: In function 'sc_encrypt': -| scapi.c:1256:5: error: 'pad_size' undeclared (first use in this function); did you mean 'dysize'? -| pad_size = pai->pad_size; -| ^~~~~~~~ -| dysize - -pad_size is defined only without --disable-des -[snip] -#ifndef NETSNMP_DISABLE_DES - int pad, plast, pad_size = 0; - -but used when disable-des, -[snip] - QUITFUN(SNMPERR_GENERR, sc_encrypt_quit); - } - pad_size = pai->pad_size; - - memset(my_iv, 0, sizeof(my_iv)); - -#ifndef NETSNMP_DISABLE_DES - if (USM_CREATE_USER_PRIV_DES == (pai->type & USM_PRIV_MASK_ALG)) { - - /* - -fix by move it into #ifndef NETSNMP_DISABLE_DES - -Upstream-Status: Submitted [https://sourceforge.net/p/net-snmp/bugs/2927/] - -Signed-off-by: Changqing Li <changqing.li@windriver.com> ---- - snmplib/scapi.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/snmplib/scapi.c b/snmplib/scapi.c -index 43caddf..c09deb0 100644 ---- a/snmplib/scapi.c -+++ b/snmplib/scapi.c -@@ -1253,7 +1253,6 @@ sc_encrypt(const oid * privtype, size_t privtypelen, - - QUITFUN(SNMPERR_GENERR, sc_encrypt_quit); - } -- pad_size = pai->pad_size; - - memset(my_iv, 0, sizeof(my_iv)); - -@@ -1263,6 +1262,8 @@ sc_encrypt(const oid * privtype, size_t privtypelen, - /* - * now calculate the padding needed - */ -+ -+ pad_size = pai->pad_size; - pad = pad_size - (ptlen % pad_size); - plast = (int) ptlen - (pad_size - pad); - if (pad == pad_size) --- -2.7.4 - diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-snmplib-keytools.c-Don-t-check-for-return-from-EVP_M.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-snmplib-keytools.c-Don-t-check-for-return-from-EVP_M.patch index 778b40188..42352a6b0 100644 --- a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-snmplib-keytools.c-Don-t-check-for-return-from-EVP_M.patch +++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-snmplib-keytools.c-Don-t-check-for-return-from-EVP_M.patch @@ -1,4 +1,4 @@ -From 89538a973119f1bf976b3a6df157ea940cf32eb5 Mon Sep 17 00:00:00 2001 +From f3ff99736b8cccbba77349b0d10a3cee366a4c87 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Fri, 18 Sep 2015 00:28:45 -0400 Subject: [PATCH] snmplib/keytools.c: Don't check for return from @@ -10,22 +10,25 @@ EVP_MD_CTX_init() API returns void, it fixes errors with new compilers snmplib/keytools.c: In function 'generate_Ku': error: invalid use of void expression Signed-off-by: Khem Raj <raj.khem@gmail.com> +Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> --- - snmplib/keytools.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) + snmplib/keytools.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/snmplib/keytools.c b/snmplib/keytools.c -index 2cf0240..50fd3ea 100644 +index 129a7c0..2fc1efc 100644 --- a/snmplib/keytools.c +++ b/snmplib/keytools.c -@@ -186,8 +186,7 @@ generate_Ku(const oid * hashtype, u_int hashtype_len, +@@ -183,10 +183,7 @@ generate_Ku(const oid * hashtype, u_int hashtype_len, ctx = EVP_MD_CTX_create(); #else ctx = malloc(sizeof(*ctx)); -- if (!EVP_MD_CTX_init(ctx)) -- return SNMPERR_GENERR; +- if (!EVP_MD_CTX_init(ctx)) { +- rval = SNMPERR_GENERR; +- goto generate_Ku_quit; +- } + EVP_MD_CTX_init(ctx); #endif - if (!EVP_DigestInit(ctx, hashfn)) - return SNMPERR_GENERR; + if (!EVP_DigestInit(ctx, hashfn)) { + rval = SNMPERR_GENERR; diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0002-configure-fix-a-cc-check-issue.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0002-configure-fix-a-cc-check-issue.patch index 4782714d5..c973bde72 100644 --- a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0002-configure-fix-a-cc-check-issue.patch +++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0002-configure-fix-a-cc-check-issue.patch @@ -1,7 +1,7 @@ -From a3631df3d6743113e1cd63579925e15bcce85868 Mon Sep 17 00:00:00 2001 +From 0a02ac779c51a2b4af3b58cb96967bf3eff80367 Mon Sep 17 00:00:00 2001 From: Wenlin Kang <wenlin.kang@windriver.com> Date: Wed, 24 May 2017 16:45:34 +0800 -Subject: [PATCH 2/4] configure: fix a cc check issue. +Subject: [PATCH] configure: fix a cc check issue. When has "." in cc value, the expression $myperl -V:cc | $myperl -n -e 'print if (s/^\s*cc=.([-=\w\s\/]+).;\s*/$1/);' diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0004-configure-fix-incorrect-variable.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0004-configure-fix-incorrect-variable.patch index a3d84b291..bfddc63dd 100644 --- a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0004-configure-fix-incorrect-variable.patch +++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0004-configure-fix-incorrect-variable.patch @@ -1,7 +1,7 @@ -From f3c5cd4df7ce8e5639c99b7b918e41fb89e969e3 Mon Sep 17 00:00:00 2001 +From 011bdcd07f2a289d0cfc1b411c03c0cc7c42dad1 Mon Sep 17 00:00:00 2001 From: Wenlin Kang <wenlin.kang@windriver.com> Date: Wed, 24 May 2017 17:10:20 +0800 -Subject: [PATCH 4/4] configure: fix incorrect variable +Subject: [PATCH] configure: fix incorrect variable For cross compile platform, this variable will not be correct, so fix it. @@ -14,10 +14,10 @@ Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com> 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in -index 9dbdde1..5fdc760 100644 +index 912f6b2..a53d1b2 100644 --- a/Makefile.in +++ b/Makefile.in -@@ -173,7 +173,7 @@ OTHERCLEANTODOS=perlclean @PYTHONCLEANTARGS@ cleanfeatures perlcleanfeatures pyt +@@ -174,7 +174,7 @@ OTHERCLEANTODOS=perlclean @PYTHONCLEANTARGS@ cleanfeatures perlcleanfeatures pyt # # override LD_RUN_PATH to avoid dependencies on the build directory perlmodules: perlmakefiles subdirs diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/fix-libtool-finish.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/fix-libtool-finish.patch index fc3ac2a4b..26dd014ce 100644 --- a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/fix-libtool-finish.patch +++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/fix-libtool-finish.patch @@ -1,4 +1,4 @@ -From 0becb4843a40910d5ec9aa11969d4905a22037cf Mon Sep 17 00:00:00 2001 +From 27444fbf8323679ea0551a3bd5f04c365143d8c0 Mon Sep 17 00:00:00 2001 From: "Roy.Li" <rongqing.li@windriver.com> Date: Fri, 16 Jan 2015 14:14:01 +0800 Subject: [PATCH] net-snmp: fix "libtool --finish" @@ -20,7 +20,7 @@ Signed-off-by: Roy.Li <rongqing.li@windriver.com> 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.top b/Makefile.top -index 5d4f9bc..d0ed31c 100644 +index 6315401..fc0ee06 100644 --- a/Makefile.top +++ b/Makefile.top @@ -89,7 +89,7 @@ LIBREVISION = 0 diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch index 5cbb60d8e..da6d80ef4 100644 --- a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch +++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch @@ -1,4 +1,4 @@ -From d619cd9fc01f336ff0ff55b18f9112789eb4d84c Mon Sep 17 00:00:00 2001 +From b6a3d6c8af35f1ef27b80b0516742fce89f4eb29 Mon Sep 17 00:00:00 2001 From: Marian Florea <marian.florea@windriver.com> Date: Thu, 20 Jul 2017 16:55:24 +0800 Subject: [PATCH] net snmp: fix engineBoots value on SIGHUP @@ -14,10 +14,10 @@ Signed-off-by: Li Zhou <li.zhou@windriver.com> 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/agent/snmpd.c b/agent/snmpd.c -index 6566354..eb0d4b4 100644 +index ae73eda..66b4560 100644 --- a/agent/snmpd.c +++ b/agent/snmpd.c -@@ -1239,6 +1239,7 @@ receive(void) +@@ -1207,6 +1207,7 @@ receive(void) snmp_log(LOG_INFO, "NET-SNMP version %s restarted\n", netsnmp_get_version()); update_config(); @@ -26,10 +26,10 @@ index 6566354..eb0d4b4 100644 #if HAVE_SIGHOLD sigrelse(SIGHUP); diff --git a/snmplib/snmpv3.c b/snmplib/snmpv3.c -index 771ba3b..5de05e7 100644 +index 29c2a0f..ada961c 100644 --- a/snmplib/snmpv3.c +++ b/snmplib/snmpv3.c -@@ -1060,9 +1060,9 @@ init_snmpv3_post_config(int majorid, int minorid, void *serverarg, +@@ -1059,9 +1059,9 @@ init_snmpv3_post_config(int majorid, int minorid, void *serverarg, /* * if our engineID has changed at all, the boots record must be set to 1 */ diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-add-knob-whether-nlist.h-are-checked.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-add-knob-whether-nlist.h-are-checked.patch index 74b0c12e0..f1ebe2bb6 100644 --- a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-add-knob-whether-nlist.h-are-checked.patch +++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-add-knob-whether-nlist.h-are-checked.patch @@ -1,4 +1,7 @@ -net-snmp: add knob whether nlist.h are checked +From e507dcf8b29c55011f85d88bf05400d4717e4074 Mon Sep 17 00:00:00 2001 +From: Chong Lu <Chong.Lu@windriver.com> +Date: Thu, 28 May 2020 09:46:34 -0500 +Subject: [PATCH] net-snmp: add knob whether nlist.h are checked Previously, it still was checked when there was no nlish.h in sysroots directory. Add knob to decide whether nlist.h are checked or not. @@ -6,30 +9,28 @@ Add knob to decide whether nlist.h are checked or not. Upstream-status: Pending Signed-off-by: Chong Lu <Chong.Lu@windriver.com> + --- - configure.d/config_os_headers | 2 ++ + configure.d/config_os_headers | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.d/config_os_headers b/configure.d/config_os_headers -index d903f58..a05d30e 100644 +index 76ef58a..f07d512 100644 --- a/configure.d/config_os_headers +++ b/configure.d/config_os_headers -@@ -31,6 +31,7 @@ AC_CHECK_HEADERS([getopt.h pthread.h regex.h ] dnl - [sys/un.h ]) +@@ -37,6 +37,7 @@ AC_CHECK_HEADERS([getopt.h pthread.h regex.h ] dnl + [sys/timeb.h ]) # Library and Agent: +if test "x$with_elf" != "xno"; then AC_CHECK_HEADERS([nlist.h],,,[ AC_INCLUDES_DEFAULT [ -@@ -38,6 +39,7 @@ AC_INCLUDES_DEFAULT +@@ -44,6 +45,7 @@ AC_INCLUDES_DEFAULT #define LIBBSD_DISABLE_DEPRECATED 1 #endif ]]) +fi # Library: - AC_CHECK_HEADERS([fcntl.h io.h kstat.h ] dnl --- -1.7.9.5 - + AC_CHECK_HEADERS([crt_externs.h ] dnl diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-fix-for-disable-des.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-fix-for-disable-des.patch index 4cd8fd1e4..2941a3609 100644 --- a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-fix-for-disable-des.patch +++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-fix-for-disable-des.patch @@ -1,4 +1,4 @@ -From 068952c0e0cdda5a91250b91c5fcc9b85b43daab Mon Sep 17 00:00:00 2001 +From 3ca4335ec1d6b7b384c134fc85d7a9e513c68376 Mon Sep 17 00:00:00 2001 From: Jackie Huang <jackie.huang@windriver.com> Date: Thu, 22 Jun 2017 10:25:08 +0800 Subject: [PATCH] net-snmp: fix for --disable-des @@ -15,10 +15,10 @@ Signed-off-by: Jackie Huang <jackie.huang@windriver.com> 1 file changed, 2 insertions(+) diff --git a/snmplib/scapi.c b/snmplib/scapi.c -index 8ad1d70..43caddf 100644 +index 00c9174..c6875e1 100644 --- a/snmplib/scapi.c +++ b/snmplib/scapi.c -@@ -84,7 +84,9 @@ netsnmp_feature_child_of(usm_scapi, usm_support) +@@ -85,7 +85,9 @@ netsnmp_feature_child_of(usm_scapi, usm_support); #include <openssl/hmac.h> #include <openssl/evp.h> #include <openssl/rand.h> diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-testing-add-the-output-format-for-ptest.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-testing-add-the-output-format-for-ptest.patch index 7cbaf0bc5..807983f61 100644 --- a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-testing-add-the-output-format-for-ptest.patch +++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-testing-add-the-output-format-for-ptest.patch @@ -1,4 +1,4 @@ -From 827fe3b0253aab33472828f40ad05934cc0261b8 Mon Sep 17 00:00:00 2001 +From 972df16e9599dffddf5d714a4cbf43008c771122 Mon Sep 17 00:00:00 2001 From: Jackie Huang <jackie.huang@windriver.com> Date: Wed, 14 Jan 2015 15:10:06 +0800 Subject: [PATCH] testing: add the output format for ptest diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/reproducibility-accept-configure-options-from-env.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/reproducibility-accept-configure-options-from-env.patch deleted file mode 100644 index b0dbf5ad3..000000000 --- a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/reproducibility-accept-configure-options-from-env.patch +++ /dev/null @@ -1,15 +0,0 @@ -Reproducible build: To avoid build host paths being written into binaries, -accept NETSNMP_CONFIGURE_OPTIONS from the environment. -NETSNMP_CONFIGURE_OPTIONS can be set either null or to a fixed value. - ---- net-snmp-5.8.original/configure.ac 2018-11-20 17:41:39.926529072 +1300 -+++ net-snmp-5.8/configure.ac 2018-11-20 17:54:44.488180224 +1300 -@@ -28,7 +28,7 @@ - # - # save the configure arguments - # --AC_DEFINE_UNQUOTED(NETSNMP_CONFIGURE_OPTIONS,"$ac_configure_args", -+AC_DEFINE_UNQUOTED(NETSNMP_CONFIGURE_OPTIONS,"${NETSNMP_CONFIGURE_OPTIONS-$ac_configure_args}", - [configure options specified]) - CONFIGURE_OPTIONS="\"$ac_configure_args\"" - AC_SUBST(CONFIGURE_OPTIONS) diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/reproducibility-have-printcap.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/reproducibility-have-printcap.patch index 4316c7a71..bf1e7bedf 100644 --- a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/reproducibility-have-printcap.patch +++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/reproducibility-have-printcap.patch @@ -1,11 +1,22 @@ +From 84e362fe97f50fbad69f083bc2d8fe18f83eb2f7 Mon Sep 17 00:00:00 2001 +From: "douglas.royds" <douglas.royds@taitradio.com> +Date: Wed, 21 Nov 2018 13:52:18 +1300 +Subject: [PATCH] net-snmp: Reproducibility: Don't check build host for + Reproducible build: Don't check for /etc/printcap on the build machine when cross-compiling. Use AC_CHECK_FILE to set the cached variable ac_cv_file__etc_printcap instead. When cross-compiling, this variable should be set in the environment to "yes" or "no" as appropriate for the target platform. ---- net-snmp-5.8.original/configure.d/config_os_misc4 2018-11-20 17:05:03.986274522 +1300 -+++ net-snmp-5.8/configure.d/config_os_misc4 2018-11-20 17:08:32.250700448 +1300 -@@ -116,9 +116,9 @@ +--- + configure.d/config_os_misc4 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/configure.d/config_os_misc4 b/configure.d/config_os_misc4 +index 6f23c8e..8cea75a 100644 +--- a/configure.d/config_os_misc4 ++++ b/configure.d/config_os_misc4 +@@ -99,9 +99,9 @@ if test x$LPSTAT_PATH != x; then [Path to the lpstat command]) AC_DEFINE(HAVE_LPSTAT, 1, [Set if the lpstat command is available]) fi diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp_5.8.bb b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.bb index 5466649a8..5df1f9340 100644 --- a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp_5.8.bb +++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.bb @@ -25,12 +25,8 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.tar.gz \ file://net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch \ file://net-snmp-fix-for-disable-des.patch \ file://reproducibility-have-printcap.patch \ - file://reproducibility-accept-configure-options-from-env.patch \ - file://0001-net-snmp-fix-compile-error-disable-des.patch \ - file://0001-Add-pkg-config-support-for-building-applications-and.patch \ " -SRC_URI[md5sum] = "63bfc65fbb86cdb616598df1aff6458a" -SRC_URI[sha256sum] = "b2fc3500840ebe532734c4786b0da4ef0a5f67e51ef4c86b3345d697e4976adf" +SRC_URI[sha256sum] = "04303a66f85d6d8b16d3cc53bde50428877c82ab524e17591dfceaeb94df6071" UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/net-snmp/files/net-snmp/" UPSTREAM_CHECK_REGEX = "/net-snmp/(?P<pver>\d+(\.\d+)+)/" diff --git a/meta-openembedded/meta-networking/recipes-protocols/openlldp/files/0001-cmds-fix-enum-conversion.patch b/meta-openembedded/meta-networking/recipes-protocols/openlldp/files/0001-cmds-fix-enum-conversion.patch new file mode 100644 index 000000000..680f6b67d --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-protocols/openlldp/files/0001-cmds-fix-enum-conversion.patch @@ -0,0 +1,91 @@ +From 090854e09fe18ebf1ba428864895a690086f78ee Mon Sep 17 00:00:00 2001 +From: Aaron Conole <aconole@redhat.com> +Date: Mon, 19 Aug 2019 11:41:13 -0400 +Subject: [PATCH 1/9] cmds: fix enum conversion + +Multiple modules use implicit conversion between enum types, but +this triggers warnings with some compilers. ex: + + qbg/vdp_cmds.c:110:39: error: implicit conversion from enumeration type + 'lldp_cmd' to different enumeration type 'cmd_status' + [-Werror,-Wenum-conversion] + cmd_status good_cmd = vdp_cmdok(cmd, cmd_gettlv); + +Reported-at: https://github.com/intel/openlldp/issues/53 +Signed-off-by: Aaron Conole <aconole@redhat.com> +--- + lldp_evb22_cmds.c | 2 +- + lldp_evb_cmds.c | 2 +- + qbg/vdp22_cmds.c | 2 +- + qbg/vdp_cmds.c | 2 +- + vdptool.c | 2 +- + 5 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/lldp_evb22_cmds.c b/lldp_evb22_cmds.c +index cebfeb2..51810bc 100644 +--- a/lldp_evb22_cmds.c ++++ b/lldp_evb22_cmds.c +@@ -225,7 +225,7 @@ int evb22_conf_enabletx(char *ifname, enum agent_type type) + TLVID(OUI_IEEE_8021Qbg22, LLDP_EVB22_SUBTYPE)); + } + +-static int evb22_cmdok(struct cmd *cmd, cmd_status expected) ++static int evb22_cmdok(struct cmd *cmd, int expected) + { + if (cmd->cmd != expected) + return cmd_invalid; +diff --git a/lldp_evb_cmds.c b/lldp_evb_cmds.c +index eec4f33..e6af03b 100644 +--- a/lldp_evb_cmds.c ++++ b/lldp_evb_cmds.c +@@ -163,7 +163,7 @@ int evb_conf_enabletx(char *ifname, enum agent_type type) + return is_tlv_txenabled(ifname, type, TLVID_8021Qbg(LLDP_EVB_SUBTYPE)); + } + +-static int evb_cmdok(struct cmd *cmd, cmd_status expected) ++static int evb_cmdok(struct cmd *cmd, int expected) + { + if (cmd->cmd != expected) + return cmd_invalid; +diff --git a/qbg/vdp22_cmds.c b/qbg/vdp22_cmds.c +index 479b1b0..2e1bbbd 100644 +--- a/qbg/vdp22_cmds.c ++++ b/qbg/vdp22_cmds.c +@@ -296,7 +296,7 @@ int vdp22_sendevent(struct vdpnl_vsi *p) + return 0; + } + +-static int vdp22_cmdok(struct cmd *cmd, cmd_status expected) ++static int vdp22_cmdok(struct cmd *cmd, int expected) + { + if (cmd->cmd != expected) + return cmd_invalid; +diff --git a/qbg/vdp_cmds.c b/qbg/vdp_cmds.c +index 95bcfb1..50f2781 100644 +--- a/qbg/vdp_cmds.c ++++ b/qbg/vdp_cmds.c +@@ -85,7 +85,7 @@ static char *print_mode(char *s, size_t length, struct vsi_profile *p) + return s; + } + +-static int vdp_cmdok(struct cmd *cmd, cmd_status expected) ++static int vdp_cmdok(struct cmd *cmd, int expected) + { + if (cmd->cmd != expected) + return cmd_invalid; +diff --git a/vdptool.c b/vdptool.c +index 9872348..8f36277 100644 +--- a/vdptool.c ++++ b/vdptool.c +@@ -141,7 +141,7 @@ static char *print_status(cmd_status status) + str = "TLV does not support agent type"; + break; + default: +- str = print_vdp_status(status); ++ str = print_vdp_status((enum vdp22_cmd_status)status); + break; + } + return str; +-- +2.28.0 + diff --git a/meta-openembedded/meta-networking/recipes-protocols/openlldp/files/0002-lldp_head-rename-and-make-extern.patch b/meta-openembedded/meta-networking/recipes-protocols/openlldp/files/0002-lldp_head-rename-and-make-extern.patch new file mode 100644 index 000000000..8f65b799f --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-protocols/openlldp/files/0002-lldp_head-rename-and-make-extern.patch @@ -0,0 +1,500 @@ +From 07a83c583b9d508c7040dc6254a6a7113b2ce55f Mon Sep 17 00:00:00 2001 +From: Aaron Conole <aconole@redhat.com> +Date: Mon, 3 Aug 2020 15:05:42 -0400 +Subject: [PATCH 2/9] lldp_head: rename and make extern + +Try to resolve this silly mod issue + +Signed-off-by: Aaron Conole <aconole@redhat.com> +--- + config.c | 4 ++-- + event_iface.c | 4 ++-- + include/lldp_mod.h | 2 +- + lldp/agent.c | 2 +- + lldp/rx.c | 4 ++-- + lldp/tx.c | 4 ++-- + lldp_dcbx.c | 8 ++++---- + lldp_mand_cmds.c | 8 ++++---- + lldpad.c | 12 +++++++----- + lldptool.c | 14 ++++++++------ + lldptool_cmds.c | 2 +- + qbg/ecp22.c | 8 ++++---- + qbg/vdp.c | 4 ++-- + qbg/vdp22.c | 6 +++--- + qbg/vdp22_cmds.c | 2 +- + vdptool.c | 16 +++++++++------- + 16 files changed, 53 insertions(+), 47 deletions(-) + +diff --git a/config.c b/config.c +index be458fd..bc3fbae 100644 +--- a/config.c ++++ b/config.c +@@ -185,7 +185,7 @@ void scan_port(UNUSED void *eloop_data, UNUSED void *user_ctx) + LIST_FOREACH(agent, &port->agent_head, entry) { + LLDPAD_DBG("%s: calling ifdown for agent %p.\n", + __func__, agent); +- LIST_FOREACH(np, &lldp_head, lldp) { ++ LIST_FOREACH(np, &lldp_mod_head, lldp) { + ops = np->ops; + if (ops->lldp_mod_ifdown) + ops->lldp_mod_ifdown(ifname, agent); +@@ -394,7 +394,7 @@ void init_ports(void) + LIST_FOREACH(agent, &port->agent_head, entry) { + LLDPAD_DBG("%s: calling ifup for agent %p.\n", + __func__, agent); +- LIST_FOREACH(np, &lldp_head, lldp) { ++ LIST_FOREACH(np, &lldp_mod_head, lldp) { + if (np->ops->lldp_mod_ifup) + np->ops->lldp_mod_ifup(p->if_name, agent); + } +diff --git a/event_iface.c b/event_iface.c +index 43a95c7..1be2963 100644 +--- a/event_iface.c ++++ b/event_iface.c +@@ -216,7 +216,7 @@ int oper_add_device(char *device_name) + LIST_FOREACH(agent, &port->agent_head, entry) { + LLDPAD_DBG("%s: calling ifup for agent %p.\n", + __func__, agent); +- LIST_FOREACH(np, &lldp_head, lldp) { ++ LIST_FOREACH(np, &lldp_mod_head, lldp) { + if (np->ops->lldp_mod_ifup) + np->ops->lldp_mod_ifup(device_name, agent); + } +@@ -283,7 +283,7 @@ static void event_if_decode_nlmsg(int route_type, void *data, int len) + LIST_FOREACH(agent, &port->agent_head, entry) { + LLDPAD_DBG("%s: calling ifdown for agent %p.\n", + __func__, agent); +- LIST_FOREACH(np, &lldp_head, lldp) { ++ LIST_FOREACH(np, &lldp_mod_head, lldp) { + ops = np->ops; + if (ops->lldp_mod_ifdown) + ops->lldp_mod_ifdown(device_name, +diff --git a/include/lldp_mod.h b/include/lldp_mod.h +index 49a50e4..9733595 100644 +--- a/include/lldp_mod.h ++++ b/include/lldp_mod.h +@@ -96,7 +96,7 @@ struct lldp_module { + }; + + LIST_HEAD(lldp_head, lldp_module); +-struct lldp_head lldp_head; ++extern struct lldp_head lldp_mod_head; + + static inline struct lldp_module *find_module_by_id(struct lldp_head *head, int id) + { +diff --git a/lldp/agent.c b/lldp/agent.c +index 333929a..aa4a8d1 100644 +--- a/lldp/agent.c ++++ b/lldp/agent.c +@@ -163,7 +163,7 @@ static void timer(UNUSED void *eloop_data, UNUSED void *user_ctx) + run_rx_sm(port, agent); + update_rx_timers(agent); + +- LIST_FOREACH(n, &lldp_head, lldp) { ++ LIST_FOREACH(n, &lldp_mod_head, lldp) { + if (n->ops && n->ops->timer) + n->ops->timer(port, agent); + } +diff --git a/lldp/rx.c b/lldp/rx.c +index 12d07bc..43aeeba 100644 +--- a/lldp/rx.c ++++ b/lldp/rx.c +@@ -359,7 +359,7 @@ void rxProcessFrame(struct port *port, struct lldp_agent *agent) + } + + /* rx per lldp module */ +- LIST_FOREACH(np, &lldp_head, lldp) { ++ LIST_FOREACH(np, &lldp_mod_head, lldp) { + if (!np->ops || !np->ops->lldp_mod_rchange) + continue; + +@@ -402,7 +402,7 @@ u8 mibDeleteObjects(struct port *port, struct lldp_agent *agent) + { + struct lldp_module *np; + +- LIST_FOREACH(np, &lldp_head, lldp) { ++ LIST_FOREACH(np, &lldp_mod_head, lldp) { + if (!np->ops || !np->ops->lldp_mod_mibdelete) + continue; + np->ops->lldp_mod_mibdelete(port, agent); +diff --git a/lldp/tx.c b/lldp/tx.c +index c3a5c62..0746e34 100644 +--- a/lldp/tx.c ++++ b/lldp/tx.c +@@ -71,7 +71,7 @@ bool mibConstrInfoLLDPDU(struct port *port, struct lldp_agent *agent) + fb_offset += sizeof(struct l2_ethhdr); + + /* Generic TLV Pack */ +- LIST_FOREACH(np, &lldp_head, lldp) { ++ LIST_FOREACH(np, &lldp_mod_head, lldp) { + if (!np->ops || !np->ops->lldp_mod_gettlv) + continue; + +@@ -206,7 +206,7 @@ bool mibConstrShutdownLLDPDU(struct port *port, struct lldp_agent *agent) + memcpy(agent->tx.frameout, (void *)ð, sizeof(struct l2_ethhdr)); + fb_offset += sizeof(struct l2_ethhdr); + +- np = find_module_by_id(&lldp_head, LLDP_MOD_MAND); ++ np = find_module_by_id(&lldp_mod_head, LLDP_MOD_MAND); + if (!np) + goto error; + if (!np->ops || !np->ops->lldp_mod_gettlv) +diff --git a/lldp_dcbx.c b/lldp_dcbx.c +index 7e53c0f..809086f 100644 +--- a/lldp_dcbx.c ++++ b/lldp_dcbx.c +@@ -129,7 +129,7 @@ struct dcbx_tlvs *dcbx_data(const char *ifname) + struct dcbd_user_data *dud; + struct dcbx_tlvs *tlv = NULL; + +- dud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_DCBX); ++ dud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_DCBX); + if (dud) { + LIST_FOREACH(tlv, &dud->head, entry) { + if (!strncmp(tlv->ifname, ifname, IFNAMSIZ)) +@@ -148,7 +148,7 @@ int dcbx_tlvs_rxed(const char *ifname, struct lldp_agent *agent) + if (agent->type != NEAREST_BRIDGE) + return 0; + +- dud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_DCBX); ++ dud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_DCBX); + if (dud) { + LIST_FOREACH(tlv, &dud->head, entry) { + if (!strncmp(tlv->ifname, ifname, IFNAMSIZ)) +@@ -172,7 +172,7 @@ int dcbx_check_active(const char *ifname) + struct dcbd_user_data *dud; + struct dcbx_tlvs *tlv = NULL; + +- dud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_DCBX); ++ dud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_DCBX); + if (dud) { + LIST_FOREACH(tlv, &dud->head, entry) { + if (!strncmp(tlv->ifname, ifname, IFNAMSIZ)) +@@ -507,7 +507,7 @@ void dcbx_ifup(char *ifname, struct lldp_agent *agent) + ifindex = get_ifidx(ifname); + port = port_find_by_ifindex(ifindex); + +- dud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_DCBX); ++ dud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_DCBX); + tlvs = dcbx_data(ifname); + + if (!port) +diff --git a/lldp_mand_cmds.c b/lldp_mand_cmds.c +index 8a88177..1c43bf4 100644 +--- a/lldp_mand_cmds.c ++++ b/lldp_mand_cmds.c +@@ -466,7 +466,7 @@ int handle_get_args(struct cmd *cmd, UNUSED char *arg, char *argvalue, + nbuf = obuf; + nbuf_len = obuf_len; + +- LIST_FOREACH(np, &lldp_head, lldp) { ++ LIST_FOREACH(np, &lldp_mod_head, lldp) { + if (!np->ops->get_arg_handler) + continue; + if (!(ah = np->ops->get_arg_handler())) +@@ -496,7 +496,7 @@ int handle_get_arg(struct cmd *cmd, char *arg, char *argvalue, + struct arg_handlers *ah; + int rval, status = cmd_not_applicable; + +- LIST_FOREACH(np, &lldp_head, lldp) { ++ LIST_FOREACH(np, &lldp_mod_head, lldp) { + if (!np->ops->get_arg_handler) + continue; + if (!(ah = np->ops->get_arg_handler())) +@@ -593,7 +593,7 @@ int handle_test_arg(struct cmd *cmd, char *arg, char *argvalue, + struct arg_handlers *ah; + int rval, status = cmd_not_applicable; + +- LIST_FOREACH(np, &lldp_head, lldp) { ++ LIST_FOREACH(np, &lldp_mod_head, lldp) { + if (!np->ops->get_arg_handler) + continue; + if (!(ah = np->ops->get_arg_handler())) +@@ -626,7 +626,7 @@ int handle_set_arg(struct cmd *cmd, char *arg, char *argvalue, + struct arg_handlers *ah; + int rval, status = cmd_not_applicable; + +- LIST_FOREACH(np, &lldp_head, lldp) { ++ LIST_FOREACH(np, &lldp_mod_head, lldp) { + if (!np->ops->get_arg_handler) + continue; + if (!(ah = np->ops->get_arg_handler())) +diff --git a/lldpad.c b/lldpad.c +index 01fb588..65e92c7 100644 +--- a/lldpad.c ++++ b/lldpad.c +@@ -80,6 +80,8 @@ struct lldp_module *(*register_tlv_table[])(void) = { + NULL, + }; + ++struct lldp_head lldp_mod_head; ++ + char *cfg_file_name = NULL; + bool daemonize = 0; + int loglvl = LOG_WARNING; +@@ -98,7 +100,7 @@ static void init_modules(void) + struct lldp_module *premod = NULL; + int i = 0; + +- LIST_INIT(&lldp_head); ++ LIST_INIT(&lldp_mod_head); + for (i = 0; register_tlv_table[i]; i++) { + module = register_tlv_table[i](); + if (!module) +@@ -106,7 +108,7 @@ static void init_modules(void) + if (premod) + LIST_INSERT_AFTER(premod, module, lldp); + else +- LIST_INSERT_HEAD(&lldp_head, module, lldp); ++ LIST_INSERT_HEAD(&lldp_mod_head, module, lldp); + premod = module; + } + } +@@ -115,9 +117,9 @@ void deinit_modules(void) + { + struct lldp_module *module; + +- while (lldp_head.lh_first != NULL) { +- module = lldp_head.lh_first; +- LIST_REMOVE(lldp_head.lh_first, lldp); ++ while (lldp_mod_head.lh_first != NULL) { ++ module = lldp_mod_head.lh_first; ++ LIST_REMOVE(lldp_mod_head.lh_first, lldp); + module->ops->lldp_mod_unregister(module); + } + } +diff --git a/lldptool.c b/lldptool.c +index 2b14f61..664a248 100644 +--- a/lldptool.c ++++ b/lldptool.c +@@ -64,6 +64,8 @@ + #include "lldp_util.h" + #include "lldpad_status.h" + ++struct lldp_head lldp_mod_head; ++ + static int show_raw; + + static const char *cli_version = +@@ -199,7 +201,7 @@ static void init_modules(void) + if (premod) + LIST_INSERT_AFTER(premod, module, lldp); + else +- LIST_INSERT_HEAD(&lldp_head, module, lldp); ++ LIST_INSERT_HEAD(&lldp_mod_head, module, lldp); + premod = module; + } + } +@@ -208,9 +210,9 @@ void deinit_modules(void) + { + struct lldp_module *module; + +- while (lldp_head.lh_first != NULL) { +- module = lldp_head.lh_first; +- LIST_REMOVE(lldp_head.lh_first, lldp); ++ while (lldp_mod_head.lh_first != NULL) { ++ module = lldp_mod_head.lh_first; ++ LIST_REMOVE(lldp_mod_head.lh_first, lldp); + module->ops->lldp_mod_unregister(module); + } + } +@@ -346,7 +348,7 @@ cli_cmd_help(UNUSED struct clif *clif, UNUSED int argc, UNUSED char *argv[], + printf("%s\n%s\n%s", commands_usage, commands_options, commands_help); + + printf("\nTLV identifiers:\n"); +- LIST_FOREACH(np, &lldp_head, lldp) ++ LIST_FOREACH(np, &lldp_mod_head, lldp) + if (np->ops->print_help) + np->ops->print_help(); + return 0; +@@ -406,7 +408,7 @@ u32 lookup_tlvid(char *tlvid_str) + struct lldp_module *np; + u32 tlvid = INVALID_TLVID; + +- LIST_FOREACH(np, &lldp_head, lldp) { ++ LIST_FOREACH(np, &lldp_mod_head, lldp) { + if (np->ops->lookup_tlv_name) { + tlvid = np->ops->lookup_tlv_name(tlvid_str); + if (tlvid != INVALID_TLVID) +diff --git a/lldptool_cmds.c b/lldptool_cmds.c +index daef8c8..70b7b0d 100644 +--- a/lldptool_cmds.c ++++ b/lldptool_cmds.c +@@ -464,7 +464,7 @@ static void print_tlvs(struct cmd *cmd, char *ibuf) + offset += 8; + + printed = 0; +- LIST_FOREACH(np, &lldp_head, lldp) { ++ LIST_FOREACH(np, &lldp_mod_head, lldp) { + if (np->ops->print_tlv(tlvid, tlv_len, ibuf+offset)) { + printed = 1; + break; +diff --git a/qbg/ecp22.c b/qbg/ecp22.c +index 6561d14..825392b 100644 +--- a/qbg/ecp22.c ++++ b/qbg/ecp22.c +@@ -774,7 +774,7 @@ void ecp22_start(char *ifname) + struct ecp22 *ecp; + + LLDPAD_DBG("%s:%s start ecp\n", __func__, ifname); +- eud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_ECP22); ++ eud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_ECP22); + if (!eud) { + LLDPAD_DBG("%s:%s no ECP module\n", __func__, ifname); + return; +@@ -837,7 +837,7 @@ void ecp22_stop(char *ifname) + struct ecp22 *ecp; + + LLDPAD_DBG("%s:%s stop ecp\n", __func__, ifname); +- eud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_ECP22); ++ eud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_ECP22); + ecp = find_ecpdata(ifname, eud); + if (ecp) + ecp22_remove(ecp); +@@ -852,7 +852,7 @@ static int ecp22_data_from_evb(char *ifname, struct evb22_to_ecp22 *ptr) + struct ecp22_user_data *eud; + struct ecp22 *ecp; + +- eud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_ECP22); ++ eud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_ECP22); + ecp = find_ecpdata(ifname, eud); + if (ecp) { + ecp->max_rte = ptr->max_rte; +@@ -930,7 +930,7 @@ static int ecp22_req2send(char *ifname, unsigned short subtype, + + LLDPAD_DBG("%s:%s subtype:%d\n", __func__, ifname, subtype); + +- eud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_ECP22); ++ eud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_ECP22); + ecp = find_ecpdata(ifname, eud); + if (!ecp) { + rc = -ENODEV; +diff --git a/qbg/vdp.c b/qbg/vdp.c +index d131560..c26bbd6 100644 +--- a/qbg/vdp.c ++++ b/qbg/vdp.c +@@ -188,7 +188,7 @@ struct vdp_data *vdp_data(char *ifname) + struct vdp_user_data *ud; + struct vdp_data *vd = NULL; + +- ud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_VDP02); ++ ud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_VDP02); + if (ud) { + LIST_FOREACH(vd, &ud->head, entry) { + if (!strncmp(ifname, vd->ifname, IFNAMSIZ)) +@@ -1624,7 +1624,7 @@ void vdp_ifup(char *ifname, struct lldp_agent *agent) + + LIST_INIT(&vd->profile_head); + +- ud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_VDP02); ++ ud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_VDP02); + LIST_INSERT_HEAD(&ud->head, vd, entry); + + out_start_again: +diff --git a/qbg/vdp22.c b/qbg/vdp22.c +index cf02310..81ea3a8 100644 +--- a/qbg/vdp22.c ++++ b/qbg/vdp22.c +@@ -694,7 +694,7 @@ static struct vdp22 *vdp22_findif(const char *ifname, + struct vdp22 *vdp = 0; + + if (!ud) { +- ud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_VDP22); ++ ud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_VDP22); + if (!ud) + LLDPAD_DBG("%s:%s no VDP22 module\n", __func__, + ifname); +@@ -794,7 +794,7 @@ void vdp22_stop(char *ifname) + struct vsi22 *vsi; + + LLDPAD_DBG("%s:%s stop vdp\n", __func__, ifname); +- vud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_VDP22); ++ vud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_VDP22); + if (!vud) { + LLDPAD_ERR("%s:%s no VDP22 module\n", __func__, ifname); + return; +@@ -874,7 +874,7 @@ void vdp22_start(const char *ifname, int role) + struct vsi22 *vsi; + + LLDPAD_DBG("%s:%s start vdp\n", __func__, ifname); +- vud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_VDP22); ++ vud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_VDP22); + if (!vud) { + LLDPAD_ERR("%s:%s no VDP22 module\n", __func__, ifname); + return; +diff --git a/qbg/vdp22_cmds.c b/qbg/vdp22_cmds.c +index 2e1bbbd..a8025ee 100644 +--- a/qbg/vdp22_cmds.c ++++ b/qbg/vdp22_cmds.c +@@ -57,7 +57,7 @@ static struct lldp_module *get_my_module(int thisid) + { + struct lldp_module *np = NULL; + +- LIST_FOREACH(np, &lldp_head, lldp) ++ LIST_FOREACH(np, &lldp_mod_head, lldp) + if (thisid == np->id) + break; + return np; +diff --git a/vdptool.c b/vdptool.c +index 8f36277..f1d946c 100644 +--- a/vdptool.c ++++ b/vdptool.c +@@ -61,6 +61,8 @@ + #define OUI_ENCODE_HNDLR(name) name##_oui_encode_hndlr + #define OUI_PRNT_DECODE_HNDLR(name) name##_oui_print_decode_hndlr + ++struct lldp_head lldp_mod_head; ++ + #define EXTERN_OUI_FN(name) \ + extern bool name##_oui_encode_hndlr(char *, char *, size_t); \ + extern void name##_oui_print_decode_hndlr(char *) +@@ -796,13 +798,13 @@ static void init_modules(void) + struct lldp_module *premod = NULL; + int i = 0; + +- LIST_INIT(&lldp_head); ++ LIST_INIT(&lldp_mod_head); + for (i = 0; register_tlv_table[i]; i++) { + module = register_tlv_table[i](); + if (premod) + LIST_INSERT_AFTER(premod, module, lldp); + else +- LIST_INSERT_HEAD(&lldp_head, module, lldp); ++ LIST_INSERT_HEAD(&lldp_mod_head, module, lldp); + premod = module; + } + } +@@ -811,9 +813,9 @@ void deinit_modules(void) + { + struct lldp_module *module; + +- while (lldp_head.lh_first != NULL) { +- module = lldp_head.lh_first; +- LIST_REMOVE(lldp_head.lh_first, lldp); ++ while (lldp_mod_head.lh_first != NULL) { ++ module = lldp_mod_head.lh_first; ++ LIST_REMOVE(lldp_mod_head.lh_first, lldp); + module->ops->lldp_mod_unregister(module); + } + } +@@ -953,7 +955,7 @@ cli_cmd_help(UNUSED struct clif *clif, UNUSED int argc, UNUSED char *argv[], + printf("%s\n%s\n%s", commands_usage, commands_options, commands_help); + + printf("\nTLV identifiers:\n"); +- LIST_FOREACH(np, &lldp_head, lldp) ++ LIST_FOREACH(np, &lldp_mod_head, lldp) + if (np->ops->print_help) + np->ops->print_help(); + return 0; +@@ -1006,7 +1008,7 @@ u32 lookup_tlvid(char *tlvid_str) + struct lldp_module *np; + u32 tlvid = INVALID_TLVID; + +- LIST_FOREACH(np, &lldp_head, lldp) { ++ LIST_FOREACH(np, &lldp_mod_head, lldp) { + if (np->ops->lookup_tlv_name) { + tlvid = np->ops->lookup_tlv_name(tlvid_str); + if (tlvid != INVALID_TLVID) +-- +2.28.0 + diff --git a/meta-openembedded/meta-networking/recipes-protocols/openlldp/files/0003-lldp-add-packed-struct-definition.patch b/meta-openembedded/meta-networking/recipes-protocols/openlldp/files/0003-lldp-add-packed-struct-definition.patch new file mode 100644 index 000000000..4d0594cb6 --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-protocols/openlldp/files/0003-lldp-add-packed-struct-definition.patch @@ -0,0 +1,49 @@ +From 702dd20f43d9ca7e0bcb917e8acfec3f1acdcb5c Mon Sep 17 00:00:00 2001 +From: Aaron Conole <aconole@redhat.com> +Date: Mon, 3 Aug 2020 15:14:50 -0400 +Subject: [PATCH 3/9] lldp: add packed struct definition + +Signed-off-by: Aaron Conole <aconole@redhat.com> +--- + include/lldp.h | 6 ++++++ + lldp/l2_packet.h | 5 ++--- + 2 files changed, 8 insertions(+), 3 deletions(-) + +diff --git a/include/lldp.h b/include/lldp.h +index fb5ee93..de6a4ad 100644 +--- a/include/lldp.h ++++ b/include/lldp.h +@@ -255,5 +255,11 @@ enum { + #define LLDP_EVB_DEFAULT_RTE 15 + #define LLDP_EVB_DEFAULT_MAX_RTE 31 + ++#ifndef _MSC_VER ++#define STRUCT_PACKED(STRUCT) STRUCT __attribute__((__packed__)) ++#else ++#define STRUCT_PACKED(STRUCT) __pragma(pack(push, 1)) STRUCT __pragma(pack(pop)) ++#endif ++ + void somethingChangedLocal(const char *ifname, int type); + #endif /* _LLDP_H */ +diff --git a/lldp/l2_packet.h b/lldp/l2_packet.h +index 607b8a3..831958c 100644 +--- a/lldp/l2_packet.h ++++ b/lldp/l2_packet.h +@@ -58,12 +58,11 @@ + */ + struct l2_packet_data; + +- +-struct l2_ethhdr { ++STRUCT_PACKED(struct l2_ethhdr { + u8 h_dest[ETH_ALEN]; + u8 h_source[ETH_ALEN]; + u16 h_proto; +-} STRUCT_PACKED; ++}); + + /** + * l2_packet_init - Initialize l2_packet interface +-- +2.28.0 + diff --git a/meta-openembedded/meta-networking/recipes-protocols/openlldp/files/0004-lldptool-make-extern.patch b/meta-openembedded/meta-networking/recipes-protocols/openlldp/files/0004-lldptool-make-extern.patch new file mode 100644 index 000000000..16b7def68 --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-protocols/openlldp/files/0004-lldptool-make-extern.patch @@ -0,0 +1,41 @@ +From 8229f4fb700ba4fcb2ec3e9956491bf5ee8c0ae2 Mon Sep 17 00:00:00 2001 +From: Aaron Conole <aconole@redhat.com> +Date: Mon, 3 Aug 2020 15:17:31 -0400 +Subject: [PATCH 4/9] lldptool: make extern + +This should only exist per final linked object. + +Signed-off-by: Aaron Conole <aconole@redhat.com> +--- + include/lldptool.h | 2 +- + lldptool.c | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/include/lldptool.h b/include/lldptool.h +index c919873..a190009 100644 +--- a/include/lldptool.h ++++ b/include/lldptool.h +@@ -29,7 +29,7 @@ + + #include "clif.h" + +-struct lldp_head lldp_cli_head; ++extern struct lldp_head lldp_cli_head; + + int clif_command(struct clif *clif, char *cmd, int raw); + void print_raw_message(char *msg, int print); +diff --git a/lldptool.c b/lldptool.c +index 664a248..d76cc48 100644 +--- a/lldptool.c ++++ b/lldptool.c +@@ -64,6 +64,7 @@ + #include "lldp_util.h" + #include "lldpad_status.h" + ++struct lldp_head lldp_cli_head; + struct lldp_head lldp_mod_head; + + static int show_raw; +-- +2.28.0 + diff --git a/meta-openembedded/meta-networking/recipes-protocols/openlldp/files/0005-cisco_oui-match-encode-handler-prototypes.patch b/meta-openembedded/meta-networking/recipes-protocols/openlldp/files/0005-cisco_oui-match-encode-handler-prototypes.patch new file mode 100644 index 000000000..4bdc5f2f6 --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-protocols/openlldp/files/0005-cisco_oui-match-encode-handler-prototypes.patch @@ -0,0 +1,28 @@ +From 9203dec731e53fb72e1c0d62639e6e54378f66cc Mon Sep 17 00:00:00 2001 +From: Aaron Conole <aconole@redhat.com> +Date: Mon, 3 Aug 2020 15:20:59 -0400 +Subject: [PATCH 5/9] cisco_oui: match encode handler prototypes + +The EXTERN_FN prototype generated requires size_t be the third parameter. + +Signed-off-by: Aaron Conole <aconole@redhat.com> +--- + vdptool_cisco_oui.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/vdptool_cisco_oui.c b/vdptool_cisco_oui.c +index 7003521..3f88c76 100644 +--- a/vdptool_cisco_oui.c ++++ b/vdptool_cisco_oui.c +@@ -28,7 +28,7 @@ + #include "lldp_util.h" + #include "vdp_cisco.h" + +-bool cisco_oui_encode_hndlr(char *dst, char *src, int len) ++bool cisco_oui_encode_hndlr(char *dst, char *src, size_t len) + { + char *src_temp = strdup(src); + char *key, *data; +-- +2.28.0 + diff --git a/meta-openembedded/meta-networking/recipes-protocols/openlldp/files/0006-ecp22-make-enum-a-type-rather-than-instance.patch b/meta-openembedded/meta-networking/recipes-protocols/openlldp/files/0006-ecp22-make-enum-a-type-rather-than-instance.patch new file mode 100644 index 000000000..2b0289df2 --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-protocols/openlldp/files/0006-ecp22-make-enum-a-type-rather-than-instance.patch @@ -0,0 +1,33 @@ +From 2723219c08726efa08a6bad04ffb775f850a96bc Mon Sep 17 00:00:00 2001 +From: Aaron Conole <aconole@redhat.com> +Date: Mon, 3 Aug 2020 15:23:28 -0400 +Subject: [PATCH 6/9] ecp22: make enum a type rather than instance + +The enum defined in the qbg header is setup as a discreet instance +rather than a type. Fix this. + +Signed-off-by: Aaron Conole <aconole@redhat.com> +--- + include/qbg_ecp22.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/include/qbg_ecp22.h b/include/qbg_ecp22.h +index 567f6df..fe66bb3 100644 +--- a/include/qbg_ecp22.h ++++ b/include/qbg_ecp22.h +@@ -49,10 +49,10 @@ enum { /* ECP Transmit states */ + ECP22_TX_ERROR + }; + +-enum { ++enum ecp22_mode { + ECP22_REQUEST = 0, + ECP22_ACK +-} ecp22_mode; ++}; + + struct ecp22_hdr { /* ECP22 header */ + u16 ver_op_sub; /* ECP22 version, operation, subtype */ +-- +2.28.0 + diff --git a/meta-openembedded/meta-networking/recipes-protocols/openlldp/files/0007-lldp_8021qaz-extern-config-object.patch b/meta-openembedded/meta-networking/recipes-protocols/openlldp/files/0007-lldp_8021qaz-extern-config-object.patch new file mode 100644 index 000000000..36b575c56 --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-protocols/openlldp/files/0007-lldp_8021qaz-extern-config-object.patch @@ -0,0 +1,29 @@ +From 275fe9da663193a843de450f03e810daedc06955 Mon Sep 17 00:00:00 2001 +From: Aaron Conole <aconole@redhat.com> +Date: Mon, 3 Aug 2020 15:25:38 -0400 +Subject: [PATCH 7/9] lldp_8021qaz: extern config object + +The config object only exists as part of the config translation unit +so remove the extra config object in the 8021qaz module. + +Signed-off-by: Aaron Conole <aconole@redhat.com> +--- + lldp_8021qaz.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lldp_8021qaz.c b/lldp_8021qaz.c +index a42fd11..673d758 100644 +--- a/lldp_8021qaz.c ++++ b/lldp_8021qaz.c +@@ -49,7 +49,7 @@ + + + struct lldp_head lldp_head; +-struct config_t lldpad_cfg; ++extern config_t lldpad_cfg; + extern bool read_only_8021qaz; + + static int ieee8021qaz_check_pending(struct port *port, struct lldp_agent *); +-- +2.28.0 + diff --git a/meta-openembedded/meta-networking/recipes-protocols/openlldp/files/0008-stringops-fix-some-string-copy-errors.patch b/meta-openembedded/meta-networking/recipes-protocols/openlldp/files/0008-stringops-fix-some-string-copy-errors.patch new file mode 100644 index 000000000..501b66699 --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-protocols/openlldp/files/0008-stringops-fix-some-string-copy-errors.patch @@ -0,0 +1,61 @@ +From 61291de03cb6dd1aea2a633eb72951f3fe453e7f Mon Sep 17 00:00:00 2001 +From: Aaron Conole <aconole@redhat.com> +Date: Mon, 3 Aug 2020 15:33:08 -0400 +Subject: [PATCH 8/9] stringops: fix some string copy errors + +Reported when using gcc-10. + +Signed-off-by: Aaron Conole <aconole@redhat.com> +--- + dcb_protocol.c | 13 ++++--------- + lldp/ports.c | 2 +- + 2 files changed, 5 insertions(+), 10 deletions(-) + +diff --git a/dcb_protocol.c b/dcb_protocol.c +index 75ca139..930251b 100644 +--- a/dcb_protocol.c ++++ b/dcb_protocol.c +@@ -2257,13 +2257,8 @@ cmd_status get_bwg_descrpt(char *device_name, u8 bwgid, char **name) + + if ((it != NULL) && + (bwgid < it->second->max_pgid_desc)) { +- size = (int)strlen(it->second->pgid_desc[bwgid]) + +- sizeof(char); /* Localization OK */ +- *name = (char*)malloc(size); +- if (*name != NULL) { +- strncpy(*name, it->second->pgid_desc[bwgid], +- size); /* Localization OK */ +- } else { ++ *name = strdup(it->second->pgid_desc[bwgid]); ++ if (*name == NULL) { + goto Error; + } + } else { +@@ -2272,9 +2267,9 @@ cmd_status get_bwg_descrpt(char *device_name, u8 bwgid, char **name) + size = (int)strlen( + attribs.descript.pgid_desc[bwgid]) + + sizeof(char); +- *name = (char*)malloc(size); ++ *name = (char*)calloc(size, sizeof(char)); + if (*name != NULL) { +- memcpy(*name, attribs.descript.pgid_desc[bwgid], size); /* Localization OK */ ++ memcpy(*name, attribs.descript.pgid_desc[bwgid], size - 1); /* Localization OK */ + } else { + goto Error; + } +diff --git a/lldp/ports.c b/lldp/ports.c +index 6384f14..9b681f7 100644 +--- a/lldp/ports.c ++++ b/lldp/ports.c +@@ -264,7 +264,7 @@ struct port *add_port(int ifindex, const char *ifname) + memset(newport, 0, sizeof(*newport)); + newport->ifindex = ifindex; + newport->next = NULL; +- strncpy(newport->ifname, ifname, IFNAMSIZ); ++ strncpy(newport->ifname, ifname, IFNAMSIZ - 1); + + newport->bond_master = is_bond(ifname); + /* Initialize relevant port variables */ +-- +2.28.0 + diff --git a/meta-openembedded/meta-networking/recipes-protocols/openlldp/files/0009-8021qaz-mark-prio-map-functions-static.patch b/meta-openembedded/meta-networking/recipes-protocols/openlldp/files/0009-8021qaz-mark-prio-map-functions-static.patch new file mode 100644 index 000000000..0f84426f9 --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-protocols/openlldp/files/0009-8021qaz-mark-prio-map-functions-static.patch @@ -0,0 +1,39 @@ +From 7ae79b0dff53a23fa0a964f77b9e3bb387a293c4 Mon Sep 17 00:00:00 2001 +From: Aaron Conole <aconole@redhat.com> +Date: Tue, 4 Aug 2020 09:17:50 -0400 +Subject: [PATCH 9/9] 8021qaz: mark prio map functions static + +Inline is not the correct way to mark a function for inclusion +in a single translation unit. Use 'static' to restrict export +of these functions. + +Signed-off-by: Aaron Conole <aconole@redhat.com> +--- + lldp_8021qaz.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lldp_8021qaz.c b/lldp_8021qaz.c +index 673d758..16ae167 100644 +--- a/lldp_8021qaz.c ++++ b/lldp_8021qaz.c +@@ -397,7 +397,7 @@ static int read_cfg_file(char *ifname, struct lldp_agent *agent, + return 0; + } + +-inline int get_prio_map(u32 prio_map, int prio) ++static int get_prio_map(u32 prio_map, int prio) + { + if (prio > 7) + return 0; +@@ -405,7 +405,7 @@ inline int get_prio_map(u32 prio_map, int prio) + return (prio_map >> (4 * (7-prio))) & 0xF; + } + +-inline void set_prio_map(u32 *prio_map, u8 prio, int tc) ++static void set_prio_map(u32 *prio_map, u8 prio, int tc) + { + u32 mask = ~(0xffffffff & (0xF << (4 * (7-prio)))); + *prio_map &= mask; +-- +2.28.0 + diff --git a/meta-openembedded/meta-networking/recipes-protocols/openlldp/openlldp_1.0.1.bb b/meta-openembedded/meta-networking/recipes-protocols/openlldp/openlldp_1.0.1.bb index 5fbf0645e..d8a0d6913 100644 --- a/meta-openembedded/meta-networking/recipes-protocols/openlldp/openlldp_1.0.1.bb +++ b/meta-openembedded/meta-networking/recipes-protocols/openlldp/openlldp_1.0.1.bb @@ -12,11 +12,21 @@ inherit ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} DEPENDS = "libnl libconfig readline" -SRCREV = "36d729de7ce5b56cf061d94d610cf0510154820c" +SRCREV = "b71bfb87fefb31c4b1a6a7ae351791c90966c3a8" +PV .= "+git${SRCPV}" SRC_URI = "git://github.com/intel/openlldp.git;protocol=https;branch=master \ file://0001-Fix-musl-libc-build-issue.patch \ file://0001-autotools-Add-include-path-to-generated-version.h.patch \ file://0001-autotools-Add-option-to-disable-installation-of-syst.patch \ + file://0001-cmds-fix-enum-conversion.patch \ + file://0002-lldp_head-rename-and-make-extern.patch \ + file://0003-lldp-add-packed-struct-definition.patch \ + file://0004-lldptool-make-extern.patch \ + file://0005-cisco_oui-match-encode-handler-prototypes.patch \ + file://0006-ecp22-make-enum-a-type-rather-than-instance.patch \ + file://0007-lldp_8021qaz-extern-config-object.patch \ + file://0008-stringops-fix-some-string-copy-errors.patch \ + file://0009-8021qaz-mark-prio-map-functions-static.patch \ " # Makefile.am adds -Werror to AM_CFLAGS. There are warnings so disable it. diff --git a/meta-openembedded/meta-networking/recipes-protocols/quagga/quagga.inc b/meta-openembedded/meta-networking/recipes-protocols/quagga/quagga.inc index 134a33d47..11b7d576a 100644 --- a/meta-openembedded/meta-networking/recipes-protocols/quagga/quagga.inc +++ b/meta-openembedded/meta-networking/recipes-protocols/quagga/quagga.inc @@ -40,7 +40,9 @@ PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" PACKAGECONFIG[cap] = "--enable-capabilities,--disable-capabilities,libcap" PACKAGECONFIG[pam] = "--with-libpam, --without-libpam, libpam" -inherit autotools update-rc.d useradd systemd pkgconfig multilib_header +inherit autotools update-rc.d useradd systemd pkgconfig multilib_header update-alternatives + +CFLAGS += "-fcommon" SYSTEMD_PACKAGES = "${PN} ${PN}-bgpd ${PN}-isisd ${PN}-ospf6d ${PN}-ospfd ${PN}-ripd ${PN}-ripngd" SYSTEMD_SERVICE_${PN}-bgpd = "bgpd.service" @@ -235,3 +237,7 @@ pkg_prerm_${PN}-ripngd () { pkg_prerm_${PN}-isisd () { ${sysconfdir}/init.d/quagga stop isisd } + +ALTERNATIVE_${PN} = "pimd" +ALTERNATIVE_LINK_NAME[pimd] = "${sbindir}/pimd" + |