diff options
Diffstat (limited to 'meta-networking/recipes-protocols')
124 files changed, 2173 insertions, 4011 deletions
diff --git a/meta-networking/recipes-protocols/babeld/babeld_1.9.2.bb b/meta-networking/recipes-protocols/babeld/babeld_1.13.1.bb index a7d7fc81ff..a799ad197e 100644 --- a/meta-networking/recipes-protocols/babeld/babeld_1.9.2.bb +++ b/meta-networking/recipes-protocols/babeld/babeld_1.13.1.bb @@ -12,18 +12,20 @@ SECTION = "net" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://LICENCE;md5=411a48ac3c2e9e0911b8dd9aed26f754" -SRC_URI = "git://github.com/jech/babeld.git;protocol=git" -SRCREV = "a1043879225ac205614259b480d7f577025d8bb0" +SRC_URI = "gitsm://github.com/jech/babeld.git;protocol=https;branch=master" +SRCREV = "3d61ea1e843e2c5f9706c74d1adad4e1d24d44b9" UPSTREAM_CHECK_GITTAGREGEX = "babeld-(?P<pver>\d+(\.\d+)+)" S = "${WORKDIR}/git" +EXTRA_OEMAKE += "CFLAGS='${CFLAGS}'" + do_compile () { oe_runmake babeld } do_install () { - oe_runmake install.minimal PREFIX=${D} + oe_runmake install.minimal TARGET=${D} PREFIX=${root_prefix} } diff --git a/meta-networking/recipes-protocols/dante/dante_1.4.1.bb b/meta-networking/recipes-protocols/dante/dante_1.4.3.bb index cfe71dd69d..4badff8bbd 100644 --- a/meta-networking/recipes-protocols/dante/dante_1.4.1.bb +++ b/meta-networking/recipes-protocols/dante/dante_1.4.3.bb @@ -9,12 +9,11 @@ what could be described as a non-transparent Layer 4 router." HOMEPAGE = "http://www.inet.no/dante/" LICENSE = "BSD-3-Clause" -LIC_FILES_CHKSUM = "file://LICENSE;md5=221118dda731fe93a85d0ed973467249" +LIC_FILES_CHKSUM = "file://LICENSE;md5=edd508404db7339042dfc861a3a690ad" SRC_URI = "https://www.inet.no/dante/files/dante-${PV}.tar.gz \ " -SRC_URI[md5sum] = "68c2ce12119e12cea11a90c7a80efa8f" -SRC_URI[sha256sum] = "b6d232bd6fefc87d14bf97e447e4fcdeef4b28b16b048d804b50b48f261c4f53" +SRC_URI[sha256sum] = "418a065fe1a4b8ace8fbf77c2da269a98f376e7115902e76cda7e741e4846a5d" # without --without-gssapi, config.log will contain reference to /usr/lib # as a consequence of GSSAPI path being set to /usr by default. @@ -23,27 +22,29 @@ SRC_URI[sha256sum] = "b6d232bd6fefc87d14bf97e447e4fcdeef4b28b16b048d804b50b48f26 # --enable-release build prerelease as full release EXTRA_OECONF += "--without-gssapi --sbindir=${bindir}" -DEPENDS += "flex-native bison-native libpam" - +DEPENDS += "flex-native bison-native libpam libtirpc" inherit autotools-brokensep features_check +CPPFLAGS += "-P" +CFLAGS += "-I${STAGING_INCDIR}/tirpc" +LIBS += "-ltirpc" + REQUIRED_DISTRO_FEATURES = "pam" EXTRA_AUTORECONF = "-I ${S}" PACKAGECONFIG[libwrap] = ",--disable-libwrap,tcp-wrappers,libwrap" -PACKAGECONFIG[krb5] = ",--without-krb5,krb5" PACKAGECONFIG ??= "" -do_install_append() { +do_install:append() { install -d ${D}${sysconfdir} cp ${S}/example/sock[sd].conf ${D}${sysconfdir} } PACKAGES =+ "${PN}-sockd ${PN}-libdsocks " -FILES_${PN}-libdsocks = "${libdir}/libdsocks.so" -FILES_${PN}-sockd = "${bindir}/sockd ${sysconfdir}/sockd.conf" +FILES:${PN}-libdsocks = "${libdir}/libdsocks.so" +FILES:${PN}-sockd = "${bindir}/sockd ${sysconfdir}/sockd.conf" -INSANE_SKIP_${PN}-libdsocks = "dev-elf" +INSANE_SKIP:${PN}-libdsocks = "dev-elf" diff --git a/meta-networking/recipes-protocols/freediameter/files/0001-libfdcore-sctp.c-update-the-old-sctp-api-check.patch b/meta-networking/recipes-protocols/freediameter/files/0001-libfdcore-sctp.c-update-the-old-sctp-api-check.patch deleted file mode 100644 index d5e242ac21..0000000000 --- a/meta-networking/recipes-protocols/freediameter/files/0001-libfdcore-sctp.c-update-the-old-sctp-api-check.patch +++ /dev/null @@ -1,97 +0,0 @@ -From d527a0b7b63e43263384540b5525714484bb089f Mon Sep 17 00:00:00 2001 -From: Mingli Yu <Mingli.Yu@windriver.com> -Date: Mon, 3 Sep 2018 14:40:56 +0800 -Subject: [PATCH] libfdcore/sctp.c: update the old sctp api check - -The initial sctp api check for freediameter as below: - === - commit d3c5e991cb532ea09684d69fb4d0d58e9bc39a0c - Author: Sebastien Decugis <sdecugis@freediameter.net> - Date: Mon Jun 3 12:05:37 2013 +0800 - - Add some compliancy to RFC6458. Not tested however as Ubuntu does not support this yet - - [snip] - +/* Use old draft-ietf-tsvwg-sctpsocket-17 API ? If not defined, RFC6458 API will be used */ - +/* #define OLD_SCTP_SOCKET_API */ - + - +/* Automatically fallback to old API if some of the new symbols are not defined */ - +#if (!defined(SCTP_CONNECTX_4_ARGS) || (!defined(SCTP_RECVRCVINFO)) || (!defined(SCTP_SNDINFO))) - +# define OLD_SCTP_SOCKET_API - +#endif - === - -SCTP_RECVRCVINFO is defined in <linux/sctp.h>, -but <linux/sctp.h> is't included in the source code -previouly. So defined(SCTP_RECVRCVINFO) can be 0 -and it make old sctp socket api definiton in effect -as below: - # define OLD_SCTP_SOCKET_API - -After lksctp-tools upgrade to 1.0.18, there is below -commit introduced: -=== -commit 3c8bd0d26b64611c690f33f5802c734b0642c1d8 -Author: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> -Date: Tue Apr 17 20:17:14 2018 -0300 - - sctp.h: make use kernel UAPI header - - and with that, remove tons of duplicated declarations. These were - lagging behind the kernel header, which is always the most updated one, - and as the library is intended to be run only on Linux, there is no - reason that we cannot re-use what is in there. - - That said, this patch drops all duplicated declarations and includes - linux/sctp.h to bring them into lksctp-tools. - - Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> - - [snip] - #include <stdint.h> - #include <linux/types.h> - #include <sys/socket.h> -+#include <linux/sctp.h> - [snip] -=== - -And above logic make defined(SCTP_RECVRCVINFO) to -be 1 and the old sctp socket api macro as below -won't be defined. - # define OLD_SCTP_SOCKET_API - -And it encouters below build error: -| /build/freediameter/1.2.1-r0/freeDiameter-1.2.1/libfdcore/sctp.c:1262:9: error: 'SCTP_SEND_FAILED_EVENT' undeclared (first use in this function); did you mean 'SCTP_SEND_FAILED'? - case SCTP_SEND_FAILED_EVENT: - ^~~~~~~~~~~~~~~~~~~~~~ - SCTP_SEND_FAILED -| /build/freediameter/1.2.1-r0/freeDiameter-1.2.1/libfdcore/sctp.c:1262:9: note: each undeclared identifier is reported only once for each function it appears in -| /build/freediameter/1.2.1-r0/freeDiameter-1.2.1/libfdcore/sctp.c:1274:9: error: 'SCTP_NOTIFICATIONS_STOPPED_EVENT' undeclared (first use in this function); did you mean 'SCTP_AUTHENTICATION_EVENT'? - case SCTP_NOTIFICATIONS_STOPPED_EVENT: - -Update the old sctp socket api check to fix -the above build error. - -Upstream-Status: Pending - -Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com> ---- - libfdcore/sctp.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libfdcore/sctp.c b/libfdcore/sctp.c -index c80a497..83440c7 100644 ---- a/libfdcore/sctp.c -+++ b/libfdcore/sctp.c -@@ -48,7 +48,7 @@ - /* #define OLD_SCTP_SOCKET_API */ - - /* Automatically fallback to old API if some of the new symbols are not defined */ --#if (!defined(SCTP_CONNECTX_4_ARGS) || (!defined(SCTP_RECVRCVINFO)) || (!defined(SCTP_SNDINFO))) -+#if (!defined(SCTP_CONNECTX_4_ARGS) || (!defined(SCTP_NOTIFICATIONS_STOPPED_EVENT)) || (!defined(SCTP_SNDINFO))) - # define OLD_SCTP_SOCKET_API - #endif - --- -2.7.4 - diff --git a/meta-networking/recipes-protocols/freediameter/files/0001-tests-use-EXTENSIONS_DIR.patch b/meta-networking/recipes-protocols/freediameter/files/0001-tests-use-EXTENSIONS_DIR.patch new file mode 100644 index 0000000000..4cedc21ce8 --- /dev/null +++ b/meta-networking/recipes-protocols/freediameter/files/0001-tests-use-EXTENSIONS_DIR.patch @@ -0,0 +1,92 @@ +From 935fcac46e2790e0e297ca855b8033895c1b8941 Mon Sep 17 00:00:00 2001 +From: Mingli Yu <mingli.yu@windriver.com> +Date: Wed, 24 Aug 2022 13:45:32 +0800 +Subject: [PATCH] tests: use EXTENSIONS_DIR + +Use EXTENSIONS_DIR to replace BUILD_DIR as the BUILD_DIR is meanlingless +on target and also fix buildpaths issue. + +Upstream-Status: Inappropriate [OE ptest specific] + +Signed-off-by: Mingli Yu <mingli.yu@windriver.com> +--- + tests/CMakeLists.txt | 1 + + tests/testloadext.c | 12 ++++++------ + tests/testmesg_stress.c | 12 ++++++------ + 3 files changed, 13 insertions(+), 12 deletions(-) + +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt +index 8b698ce..2c83cbb 100644 +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -37,6 +37,7 @@ SET(TEST_LIST + + ADD_DEFINITIONS(-DTEST_DEBUG) + ADD_DEFINITIONS(-DBUILD_DIR="${CMAKE_BINARY_DIR}") ++ADD_DEFINITIONS(-DEXTENSIONS_DIR="${EXTENSIONS_DIR}") + + INCLUDE_DIRECTORIES( "../libfdproto" ) + INCLUDE_DIRECTORIES( "../libfdcore" ) +diff --git a/tests/testloadext.c b/tests/testloadext.c +index 452737f..3fffef5 100644 +--- a/tests/testloadext.c ++++ b/tests/testloadext.c +@@ -35,9 +35,9 @@ + + #include "tests.h" + +-#ifndef BUILD_DIR +-#error "Missing BUILD_DIR information" +-#endif /* BUILD_DIR */ ++#ifndef EXTENSIONS_DIR ++#error "Missing EXTENSIONS_DIR information" ++#endif /* EXTENSIONS_DIR */ + + #include <sys/types.h> + #include <dirent.h> +@@ -59,9 +59,9 @@ int main(int argc, char *argv[]) + CHECK( 0, fd_rtdisp_init() ); + + /* Find all extensions which have been compiled along the test */ +- TRACE_DEBUG(INFO, "Loading from: '%s'", BUILD_DIR "/extensions"); +- CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 ); +- pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/"); ++ TRACE_DEBUG(INFO, "Loading from: '%s'", EXTENSIONS_DIR); ++ CHECK( 0, (dir = opendir (EXTENSIONS_DIR)) == NULL ? 1 : 0 ); ++ pathlen = snprintf(fullname, sizeof(fullname), EXTENSIONS_DIR "/"); + + while ((dp = readdir (dir)) != NULL) { + char * dot = strrchr(dp->d_name, '.'); +diff --git a/tests/testmesg_stress.c b/tests/testmesg_stress.c +index 310a9d2..97dfe07 100644 +--- a/tests/testmesg_stress.c ++++ b/tests/testmesg_stress.c +@@ -38,9 +38,9 @@ + #include <libgen.h> + #include <dlfcn.h> + +-#ifndef BUILD_DIR +-#error "Missing BUILD_DIR information" +-#endif /* BUILD_DIR */ ++#ifndef EXTENSIONS_DIR ++#error "Missing EXTENSIONS_DIR information" ++#endif /* EXTENSIONS_DIR */ + + + /* The number of times each operation is repeated to measure the average operation time */ +@@ -73,9 +73,9 @@ static void load_all_extensions(char * prefix) + struct fd_list ext_with_depends = FD_LIST_INITIALIZER(ext_with_depends); + + /* Find all extensions which have been compiled along the test */ +- LOG_D("Loading %s*.fdx from: '%s'", BUILD_DIR "/extensions", prefix ?: ""); +- CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 ); +- pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/"); ++ LOG_D("Loading %s*.fdx from: '%s'", EXTENSIONS_DIR, prefix ?: ""); ++ CHECK( 0, (dir = opendir (EXTENSIONS_DIR)) == NULL ? 1 : 0 ); ++ pathlen = snprintf(fullname, sizeof(fullname), EXTENSIONS_DIR "/"); + + while ((dp = readdir (dir)) != NULL) { + char * dot = strrchr(dp->d_name, '.'); +-- +2.25.1 + diff --git a/meta-networking/recipes-protocols/freediameter/files/freediameter.service b/meta-networking/recipes-protocols/freediameter/files/freediameter.service index 514481b431..70ed3803c6 100644 --- a/meta-networking/recipes-protocols/freediameter/files/freediameter.service +++ b/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-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch b/meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch deleted file mode 100644 index ea857af7d6..0000000000 --- a/meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch +++ /dev/null @@ -1,72 +0,0 @@ -freediameter ptest cases testmesg_stress.c and testloadext.c need load -extensions both build time and runtime. Then they search extensions with -build directory that causes runtime failures. - -Pass an environment variable to define runtime extension path. - -Upstream-Status: Inappropriate [OE ptest specific] - -Signed-off-by: Kai Kang <kai.kang@windriver.com> -Signed-off-by: Jackie Huang <jackie.huang@windriver.com> - -diff -Nur freeDiameter-1.2.0.orig/tests/testloadext.c freeDiameter-1.2.0/tests/testloadext.c ---- freeDiameter-1.2.0.orig/tests/testloadext.c 2014-02-19 17:33:24.785405032 +0800 -+++ freeDiameter-1.2.0/tests/testloadext.c 2014-02-19 20:08:03.871403924 +0800 -@@ -49,7 +49,7 @@ - { - DIR *dir; - struct dirent *dp; -- char fullname[512]; -+ char fullname[1024]; - int pathlen; - - /* First, initialize the daemon modules */ -@@ -57,11 +57,16 @@ - CHECK( 0, fd_queues_init() ); - CHECK( 0, fd_msg_init() ); - CHECK( 0, fd_rtdisp_init() ); -- -+ -+ char *ext_dir = getenv("EXTENSIONS_DIR"); -+ if (ext_dir) -+ pathlen = snprintf(fullname, sizeof(fullname), "%s", ext_dir); -+ else -+ pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/"); -+ - /* Find all extensions which have been compiled along the test */ -- TRACE_DEBUG(INFO, "Loading from: '%s'", BUILD_DIR "/extensions"); -- CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 ); -- pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/"); -+ TRACE_DEBUG(INFO, "Loading from: '%s'", fullname); -+ CHECK( 0, (dir = opendir (fullname)) == NULL ? 1 : 0 ); - - while ((dp = readdir (dir)) != NULL) { - char * dot = strrchr(dp->d_name, '.'); -diff -Nur freeDiameter-1.2.0.orig/tests/testmesg_stress.c freeDiameter-1.2.0/tests/testmesg_stress.c ---- freeDiameter-1.2.0.orig/tests/testmesg_stress.c 2014-02-19 17:33:24.785405032 +0800 -+++ freeDiameter-1.2.0/tests/testmesg_stress.c 2014-02-19 20:08:03.928403924 +0800 -@@ -67,15 +67,20 @@ - { - DIR *dir; - struct dirent *dp; -- char fullname[512]; -+ char fullname[1024]; - int pathlen; - struct fd_list all_extensions = FD_LIST_INITIALIZER(all_extensions); - struct fd_list ext_with_depends = FD_LIST_INITIALIZER(ext_with_depends); - -+ char *ext_dir = getenv("EXTENSIONS_DIR"); -+ if (ext_dir) -+ pathlen = snprintf(fullname, sizeof(fullname), "%s", ext_dir); -+ else -+ pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/"); -+ - /* Find all extensions which have been compiled along the test */ -- LOG_D("Loading %s*.fdx from: '%s'", BUILD_DIR "/extensions", prefix ?: ""); -- CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 ); -- pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/"); -+ TRACE_DEBUG(INFO, "Loading from: '%s'", fullname); -+ CHECK( 0, (dir = opendir (fullname)) == NULL ? 1 : 0 ); - - while ((dp = readdir (dir)) != NULL) { - char * dot = strrchr(dp->d_name, '.'); diff --git a/meta-networking/recipes-protocols/freediameter/files/run-ptest b/meta-networking/recipes-protocols/freediameter/files/run-ptest index d0ca8d9621..7d0648935c 100644 --- a/meta-networking/recipes-protocols/freediameter/files/run-ptest +++ b/meta-networking/recipes-protocols/freediameter/files/run-ptest @@ -6,6 +6,9 @@ if ! lsmod | grep -q sctp && ! modprobe sctp 2>/dev/null; then echo fi -export EXTENSIONS_DIR=$EXTENSIONS_DIR cmake -E cmake_echo_color --cyan "Running tests..." -ctest --force-new-ctest-process +if ctest --force-new-ctest-process ; then + echo "PASS: freediameter" +else + echo "FAIL: freediameter" +fi diff --git a/meta-networking/recipes-protocols/freediameter/freediameter_1.4.0.bb b/meta-networking/recipes-protocols/freediameter/freediameter_1.5.0.bb index 15ee561969..b3282d273b 100644 --- a/meta-networking/recipes-protocols/freediameter/freediameter_1.4.0.bb +++ b/meta-networking/recipes-protocols/freediameter/freediameter_1.5.0.bb @@ -7,28 +7,28 @@ Accounting needs." HOMEPAGE = "http://www.freediameter.net" -DEPENDS = "flex bison cmake-native libgcrypt gnutls libidn lksctp-tools virtual/kernel bison-native" +DEPENDS = "flex bison cmake-native libgcrypt gnutls libidn2 lksctp-tools virtual/kernel bison-native" PACKAGE_ARCH = "${MACHINE_ARCH}" fd_pkgname = "freeDiameter" -SRC_URI = "\ - http://www.freediameter.net/hg/${fd_pkgname}/archive/${PV}.tar.gz;downloadfilename=${fd_pkgname}-${PV}.tar.gz \ +PV .= "+git" +SRCREV = "f9f1e464e6c675d222b3be4cab9c13408d544c83" +SRC_URI = "git://github.com/freeDiameter/freeDiameter;protocol=https;branch=master \ file://Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch \ + file://run-ptest \ file://freediameter.service \ file://freediameter.init \ - ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'file://install_test.patch file://run-ptest file://pass-ptest-env.patch', '', d)} \ file://freeDiameter.conf \ - file://0001-libfdcore-sctp.c-update-the-old-sctp-api-check.patch \ + file://install_test.patch \ + file://0001-tests-use-EXTENSIONS_DIR.patch \ " -SRC_URI[sha256sum] = "7a537401bd110c606594b7c6be71b993f0ccc73ae151ad68040979286ba4e50e" - -S = "${WORKDIR}/${fd_pkgname}-${PV}" +S = "${WORKDIR}/git" LICENSE = "BSD-3-Clause" -LIC_FILES_CHKSUM = "file://LICENSE;md5=69bdc1d97648a2d35914563fcbbb361a" +LIC_FILES_CHKSUM = "file://LICENSE;md5=868c059b6147748b1d621e500feeac4f" PTEST_PATH = "${libdir}/${fd_pkgname}/ptest" @@ -46,6 +46,7 @@ EXTRA_OECMAKE = " \ -DBUILD_TEST_RT_ANY:BOOL=ON \ -DINSTALL_LIBRARY_SUFFIX:PATH=${baselib} \ -DINSTALL_EXTENSIONS_SUFFIX:PATH=${baselib}/${fd_pkgname} \ + -DEXTENSIONS_DIR:PATH=${libdir}/${fd_pkgname} \ -DINSTALL_TEST_SUFFIX:PATH=${PTEST_PATH}-tests \ -DCMAKE_SKIP_RPATH:BOOL=ON \ " @@ -68,7 +69,7 @@ FD_DH_PEM ?= "${BPN}-dh.pem" FD_HOSTNAME ?= "${MACHINE}" FD_REALM ?= "openembedded.org" -do_install_append() { +do_install:append() { # install the sample configuration files install -d -m 0755 ${D}${sysconfdir}/${fd_pkgname} for i in ${S}/doc/*.conf.sample; do @@ -107,32 +108,34 @@ EOF openssl req -x509 -config ${STAGING_DIR_NATIVE}/etc/ssl/openssl.cnf -newkey rsa:4096 -sha256 -nodes -out ${D}${sysconfdir}/freeDiameter/${FD_PEM} -keyout ${D}${sysconfdir}/freeDiameter/${FD_KEY} -days 3650 -subj '/CN=${FD_HOSTNAME}.${FD_REALM}' openssl dhparam -out ${D}${sysconfdir}/freeDiameter/${FD_DH_PEM} 1024 + find ${B} \( -name "*.c" -o -name "*.h" \) -exec sed -i -e 's#${WORKDIR}##g' {} \; } do_install_ptest() { - sed -i "s#\(EXTENSIONS_DIR=\).*\$#\1${libdir}/${fd_pkgname}/#" ${D}${PTEST_PATH}/run-ptest mv ${D}${PTEST_PATH}-tests/* ${D}${PTEST_PATH}/ rmdir ${D}${PTEST_PATH}-tests install -m 0644 ${B}/tests/CTestTestfile.cmake ${D}${PTEST_PATH}/ + sed -i -e 's#${WORKDIR}##g' ${D}${PTEST_PATH}/CTestTestfile.cmake + sed -i "/^set_tests_properties/d" ${D}${PTEST_PATH}/CTestTestfile.cmake } -FILES_${PN}-dbg += "${libdir}/${fd_pkgname}/.debug/*" +FILES:${PN}-dbg += "${libdir}/${fd_pkgname}/.debug/*" # include the extensions in main package -FILES_${PN} += "${libdir}/${fd_pkgname}/*" +FILES:${PN} += "${libdir}/${fd_pkgname}/*" -RDEPENDS_${PN} = "glib-2.0 gnutls libidn" -RDEPENDS_${PN} += "openssl openssl-conf openssl-engines" -RRECOMMENDS_${PN} += "kernel-module-tipc kernel-module-sctp" -RRECOMMENDS_${PN} += "kernel-module-udp-tunnel kernel-module-ipip" -RDEPENDS_${PN}-ptest = "cmake" +RDEPENDS:${PN} = "glib-2.0 gnutls libidn" +RDEPENDS:${PN} += "openssl openssl-conf openssl-engines" +RRECOMMENDS:${PN} += "kernel-module-tipc kernel-module-sctp" +RRECOMMENDS:${PN} += "kernel-module-udp-tunnel kernel-module-ipip" +RDEPENDS:${PN}-ptest = "cmake" INITSCRIPT_PACKAGES = "${PN}" -INITSCRIPT_NAME_${PN} = "${BPN}" -INITSCRIPT_PARAMS$_${PN} = "start 30 . stop 70 0 1 2 3 4 5 6 ." +INITSCRIPT_NAME:${PN} = "${BPN}" +INITSCRIPT_PARAMS:${PN} = "start 30 . stop 70 0 1 2 3 4 5 6 ." -SYSTEMD_SERVICE_${PN} = "freediameter.service" +SYSTEMD_SERVICE:${PN} = "freediameter.service" SYSTEMD_AUTO_ENABLE = "disable" -CONFFILES_${PN} = "${sysconfdir}/freediameter.conf" +CONFFILES:${PN} = "${sysconfdir}/freediameter.conf" diff --git a/meta-networking/recipes-protocols/frr/frr/0001-zebra-Mimic-GNU-basename-API-for-non-glibc-library-e.patch b/meta-networking/recipes-protocols/frr/frr/0001-zebra-Mimic-GNU-basename-API-for-non-glibc-library-e.patch new file mode 100644 index 0000000000..8c83d5c8eb --- /dev/null +++ b/meta-networking/recipes-protocols/frr/frr/0001-zebra-Mimic-GNU-basename-API-for-non-glibc-library-e.patch @@ -0,0 +1,34 @@ +From 49aeccbec4bf620bb594999bbd4a9de669a3984c Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 15 Mar 2024 14:34:06 -0700 +Subject: [PATCH] zebra: Mimic GNU basename() API for non-glibc library e.g. + musl musl only provides POSIX version of basename and it has also removed + providing it via string.h header [1] which now results in compile errors with + newer compilers e.g. clang-18 + +[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7 + +Upstream-Status: Submitted [https://github.com/FRRouting/frr/pull/15561/] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + zebra/zebra_netns_notify.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/zebra/zebra_netns_notify.c b/zebra/zebra_netns_notify.c +index 1bb1292e34..d55df2f62d 100644 +--- a/zebra/zebra_netns_notify.c ++++ b/zebra/zebra_netns_notify.c +@@ -41,6 +41,10 @@ + #define ZEBRA_NS_POLLING_INTERVAL_MSEC 1000 + #define ZEBRA_NS_POLLING_MAX_RETRIES 200 + ++#if !defined(__GLIBC__) ++#define basename(src) (strrchr(src,'/') ? strrchr(src,'/')+1 : src) ++#endif ++ + DEFINE_MTYPE_STATIC(ZEBRA, NETNS_MISC, "ZebraNetNSInfo"); + static struct event *zebra_netns_notify_current; + +-- +2.44.0 + diff --git a/meta-networking/recipes-protocols/quagga/files/quagga.pam b/meta-networking/recipes-protocols/frr/frr/frr.pam index 3541a975ae..a9ec35dd69 100644 --- a/meta-networking/recipes-protocols/quagga/files/quagga.pam +++ b/meta-networking/recipes-protocols/frr/frr/frr.pam @@ -1,10 +1,11 @@ # -# The PAM configuration file for the quagga `vtysh' service +# The PAM configuration file for the frr `vtysh' service # # This allows root to change user infomation without being # prompted for a password auth sufficient pam_rootok.so +account sufficient pam_rootok.so # The standard Unix authentication modules, used with # NIS (man nsswitch) as well as normal /etc/passwd and diff --git a/meta-networking/recipes-protocols/frr/frr_9.1.bb b/meta-networking/recipes-protocols/frr/frr_9.1.bb new file mode 100644 index 0000000000..eea6d62f5f --- /dev/null +++ b/meta-networking/recipes-protocols/frr/frr_9.1.bb @@ -0,0 +1,136 @@ +SUMMARY = "BGP/OSPF/RIP routing daemon" +DESCRIPTION = "FRRouting is a free and open source Internet routing protocol suite for Linux \ +and Unix platforms. It implements BGP, OSPF, RIP, IS-IS, PIM, LDP, BFD, Babel, PBR, OpenFabric \ +and VRRP, with alpha support for EIGRP and NHRP." +HOMEPAGE = "https://frrouting.org/" +SECTION = "net" + +LICENSE = "GPL-2.0-only & LGPL-2.1-only" +LIC_FILES_CHKSUM = "file://doc/licenses/GPL-2.0;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://doc/licenses/LGPL-2.1;md5=4fbd65380cdd255951079008b364516c" + + +SRC_URI = "git://github.com/FRRouting/frr.git;protocol=https;branch=stable/9.1 \ + file://frr.pam \ + file://0001-zebra-Mimic-GNU-basename-API-for-non-glibc-library-e.patch \ + " + +SRCREV = "ca2d6f0f1e000951224a18973cc1827f7f5215b5" + +UPSTREAM_CHECK_GITTAGREGEX = "frr-(?P<pver>\d+(\.\d+)+)$" + +CVE_PRODUCT = "frrouting" + +S = "${WORKDIR}/git" + +inherit autotools-brokensep python3native pkgconfig useradd systemd + +DEPENDS:class-native = "bison-native elfutils-native" +DEPENDS:class-target = "bison-native json-c readline c-ares libyang frr-native protobuf-c-native protobuf-c" + +RDEPENDS:${PN}:class-target = "iproute2 python3-core bash" + +PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" +PACKAGECONFIG:class-native = "" + +PACKAGECONFIG[fpm] = "--enable-fpm,--disable-fpm" +PACKAGECONFIG[pam] = "--with-libpam,--without-libpam,libpam" +PACKAGECONFIG[grpc] = "--enable-grpc,--disable-grpc,grpc-native grpc" +PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp" +PACKAGECONFIG[zeromq] = "--enable-zeromq,--disable-zeromq,zeromq" +PACKAGECONFIG[protobuf] = "--enable-protobuf,--disable-protobuf,protobuf-c-native protobuf-c" +PACKAGECONFIG[capabilities] = "--enable-capabilities,--disable-capabilities,libcap" +PACKAGECONFIG[cumulus] = "--enable-cumulus,--disable-cumulus" +PACKAGECONFIG[datacenter] = "--enable-datacenter,--disable-datacenter" +PACKAGECONFIG[ospfclient] = "--enable-ospfapi --enable-ospfclient,--disable-ospfapi --disable-ospfclient" + +EXTRA_OECONF:class-native = "--enable-clippy-only" + +EXTRA_OECONF:class-target = "--sbindir=${libexecdir}/frr \ + --sysconfdir=${sysconfdir}/frr \ + --localstatedir=${localstatedir}/run/frr \ + --enable-vtysh \ + --enable-multipath=64 \ + --enable-user=frr \ + --enable-group=frr \ + --enable-vty-group=frrvty \ + --enable-configfile-mask=0640 \ + --enable-logfile-mask=0640 \ + --disable-doc \ + --with-clippy=${RECIPE_SYSROOT_NATIVE}/usr/lib/clippy \ + " + +CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'" + +# https://github.com/FRRouting/frr/issues/14469 +DEBUG_PREFIX_MAP:remove = "-fcanon-prefix-map" + +LDFLAGS:append:mips = " -latomic" +LDFLAGS:append:mipsel = " -latomic" +LDFLAGS:append:powerpc = " -latomic" +LDFLAGS:append:riscv32 = " -latomic" + +SYSTEMD_PACKAGES = "${PN}" +SYSTEMD_SERVICE:${PN} = "frr.service" +SYSTEMD_AUTO_ENABLE = "disable" + +inherit update-alternatives multilib_script multilib_header + +ALTERNATIVE_PRIORITY = "100" +ALTERNATIVE:${PN} = " ietf-interfaces " +ALTERNATIVE_LINK_NAME[ietf-interfaces] = "${datadir}/yang/ietf-interfaces.yang" +do_compile:prepend () { + sed -i -e 's#${RECIPE_SYSROOT_NATIVE}##g' \ + -e 's#${RECIPE_SYSROOT}##g' ${S}/lib/version.h +} + +do_compile:class-native () { + oe_runmake clippy-only +} + +do_install:class-native () { + install -d ${D}${libdir} + install -m 755 ${S}/lib/clippy ${D}${libdir}/clippy +} + +do_install:append:class-target () { + install -m 0755 -d ${D}${sysconfdir}/frr + install -m 0755 -d ${D}${libexecdir}/frr + install -m 0640 ${S}/tools/etc/frr/* ${D}${sysconfdir}/frr/ + chown frr:frrvty ${D}${sysconfdir}/frr + chown frr:frr ${D}${sysconfdir}/frr/* + chown frr:frrvty ${D}${sysconfdir}/frr/vtysh.conf + chmod 640 ${D}${sysconfdir}/frr/* + + if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then + install -d ${D}/${sysconfdir}/pam.d + install -m 644 ${WORKDIR}/frr.pam ${D}/${sysconfdir}/pam.d/frr + fi + + if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${B}/tools/frrinit.sh ${D}${sysconfdir}/init.d/frr + + install -d ${D}${sysconfdir}/default/volatiles + echo "d frr frr 0755 ${localstatedir}/run/frr none" \ + > ${D}${sysconfdir}/default/volatiles/99_frr + fi + + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${B}/tools/frr*.service ${D}${systemd_system_unitdir} + + install -d ${D}${sysconfdir}/tmpfiles.d + echo "d /run/frr 0755 frr frr -" \ + > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf + fi + oe_multilib_header frr/version.h +} + +USERADD_PACKAGES = "${PN}" +GROUPADD_PARAM:${PN} = "--system frr ; --system frrvty" +USERADD_PARAM:${PN} = "--system --home ${localstatedir}/run/frr/ -M -g frr -G frrvty --shell /bin/false frr" + +FILES:${PN} += "${datadir}/yang" + +BBCLASSEXTEND = "native" diff --git a/meta-networking/recipes-protocols/mdns/files/0006-Remove-unneeded-function.patch b/meta-networking/recipes-protocols/mdns/files/0006-Remove-unneeded-function.patch deleted file mode 100644 index b461a60df7..0000000000 --- a/meta-networking/recipes-protocols/mdns/files/0006-Remove-unneeded-function.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 157d67f152777754c059ced7511352102f23ffae Mon Sep 17 00:00:00 2001 -From: Nate Karstens <nate.karstens@garmin.com> -Date: Mon, 24 Jul 2017 09:39:18 -0500 -Subject: [PATCH 06/11] Remove unneeded function - -Removes a function we no longer need by integrating it into the only -function that calls it. This was originally separated so that we could -only process network interfaces that netlink indicated had been changed, -this has since been extended to test for all network intefaces. - -Upstream-Status: Submitted [dts@apple.com] - -Signed-off-by: Nate Karstens <nate.karstens@garmin.com> ---- - mDNSPosix/mDNSPosix.c | 13 ++----------- - 1 file changed, 2 insertions(+), 11 deletions(-) - -diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c -index 59a8b8c..3fc5451 100644 ---- a/mDNSPosix/mDNSPosix.c -+++ b/mDNSPosix/mDNSPosix.c -@@ -1079,24 +1079,15 @@ mDNSlocal mStatus OpenIfNotifySocket(int *pFD) - return err; - } - --mDNSlocal mDNSBool ListContainsInterfaceIndex(GenLinkedList *list, int if_index) -+mDNSlocal void AddInterfaceIndexToList(GenLinkedList *list, int if_index) - { - NetworkInterfaceIndex *item; - - for (item = (NetworkInterfaceIndex*)list->Head; item != NULL; item = item->Next) - { -- if (if_index == item->if_index) return mDNStrue; -+ if (if_index == item->if_index) return; - } - -- return mDNSfalse; --} -- --mDNSlocal void AddInterfaceIndexToList(GenLinkedList *list, int if_index) --{ -- NetworkInterfaceIndex *item; -- -- if (ListContainsInterfaceIndex(list, if_index)) return; -- - item = malloc(sizeof *item); - if (item == NULL) return; - --- -2.17.1 - diff --git a/meta-networking/recipes-protocols/mdns/files/0007-Indicate-loopback-interface-to-mDNS-core.patch b/meta-networking/recipes-protocols/mdns/files/0007-Indicate-loopback-interface-to-mDNS-core.patch deleted file mode 100644 index 86201c650d..0000000000 --- a/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-networking/recipes-protocols/mdns/files/0009-Fix-possible-NULL-dereference.patch b/meta-networking/recipes-protocols/mdns/files/0009-Fix-possible-NULL-dereference.patch deleted file mode 100644 index 362d69768e..0000000000 --- a/meta-networking/recipes-protocols/mdns/files/0009-Fix-possible-NULL-dereference.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 38cff19781f81586926b02f0fd1cb36c040395e0 Mon Sep 17 00:00:00 2001 -From: Nate Karstens <nate.karstens@garmin.com> -Date: Thu, 10 Aug 2017 08:21:53 -0500 -Subject: [PATCH 09/11] Fix possible NULL dereference - -Fixes a possible NULL dereference if memory for -the PosixNetworkInterface could not be allocated. -Other logic seems to prevent dereferencing this -variable if NULL, but this instance seems to have -been overlooked. - -Upstream-Status: Submitted [dts@apple.com] - -Signed-off-by: Nate Karstens <nate.karstens@garmin.com> ---- - mDNSPosix/mDNSPosix.c | 11 +++++++---- - 1 file changed, 7 insertions(+), 4 deletions(-) - -diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c -index a8a57df..3243ed4 100644 ---- a/mDNSPosix/mDNSPosix.c -+++ b/mDNSPosix/mDNSPosix.c -@@ -951,12 +951,15 @@ mDNSlocal int SetupOneInterface(mDNS *const m, struct ifi_info *const ifi) - - // If interface is a direct link, address record will be marked as kDNSRecordTypeKnownUnique - // and skip the probe phase of the probe/announce packet sequence. -- intf->coreIntf.DirectLink = mDNSfalse; -+ if (err == 0) -+ { -+ intf->coreIntf.DirectLink = mDNSfalse; - #ifdef DIRECTLINK_INTERFACE_NAME -- if (strcmp(intfName, STRINGIFY(DIRECTLINK_INTERFACE_NAME)) == 0) -- intf->coreIntf.DirectLink = mDNStrue; -+ if (strcmp(intfName, STRINGIFY(DIRECTLINK_INTERFACE_NAME)) == 0) -+ intf->coreIntf.DirectLink = mDNStrue; - #endif -- intf->coreIntf.SupportsUnicastMDNSResponse = mDNStrue; -+ intf->coreIntf.SupportsUnicastMDNSResponse = mDNStrue; -+ } - - // The interface is all ready to go, let's register it with the mDNS core. - if (err == 0) --- -2.17.1 - diff --git a/meta-networking/recipes-protocols/mdns/files/0011-Change-a-dynamic-allocation-to-file-scope-variable.patch b/meta-networking/recipes-protocols/mdns/files/0011-Change-a-dynamic-allocation-to-file-scope-variable.patch deleted file mode 100644 index d64fb35db1..0000000000 --- a/meta-networking/recipes-protocols/mdns/files/0011-Change-a-dynamic-allocation-to-file-scope-variable.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 19de26db69408f02241e232b39224589a0f630df 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 - -Changes a variable from being dynamically-allocated to being -statically-allocated at the file scope. Addresses a Coverity -issue where it appeared that the memory was being leaked. - -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(-) - -diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c -index 84af26b..b7795ed 100644 ---- a/mDNSPosix/mDNSPosix.c -+++ b/mDNSPosix/mDNSPosix.c -@@ -91,6 +91,7 @@ static sigset_t gEventSignalSet; // Signals which event loop list - static sigset_t gEventSignals; // Signals which were received while inside loop - - static PosixNetworkInterface *gRecentInterfaces; -+static IfChangeRec gChgRec; - - // *************************************************************************** - // Globals (for debugging) -@@ -1412,16 +1413,11 @@ cleanup: - mDNSlocal mStatus WatchForInterfaceChange(mDNS *const m) - { - mStatus err; -- IfChangeRec *pChgRec; - -- pChgRec = (IfChangeRec*) mDNSPlatformMemAllocate(sizeof *pChgRec); -- if (pChgRec == NULL) -- return mStatus_NoMemoryErr; -- -- pChgRec->mDNS = m; -- err = OpenIfNotifySocket(&pChgRec->NotifySD); -+ gChgRec.mDNS = m; -+ err = OpenIfNotifySocket(&gChgRec.NotifySD); - if (err == 0) -- err = mDNSPosixAddFDToEventLoop(pChgRec->NotifySD, InterfaceChangeCallback, pChgRec); -+ err = mDNSPosixAddFDToEventLoop(gChgRec.NotifySD, InterfaceChangeCallback, &gChgRec); - - return err; - } --- -2.17.1 - diff --git a/meta-networking/recipes-protocols/mdns/files/build.patch b/meta-networking/recipes-protocols/mdns/files/build.patch deleted file mode 100644 index 4ab9d23bf7..0000000000 --- a/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-networking/recipes-protocols/mdns/files/0001-Create-subroutine-for-cleaning-recent-interfaces.patch b/meta-networking/recipes-protocols/mdns/mdns/0001-Create-subroutine-for-cleaning-recent-interfaces.patch index 692c344db9..f5d424d58f 100644 --- a/meta-networking/recipes-protocols/mdns/files/0001-Create-subroutine-for-cleaning-recent-interfaces.patch +++ b/meta-networking/recipes-protocols/mdns/mdns/0001-Create-subroutine-for-cleaning-recent-interfaces.patch @@ -1,7 +1,7 @@ -From 89ea6ac4a8840e8c2be0140a9805c6522c6c5280 Mon Sep 17 00:00:00 2001 +From c1f3e19d3cb0aa948248616eb1684a1e80aa39b4 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 1/8] Create subroutine for cleaning recent interfaces Moves functionality for cleaning the list of recent interfaces into its own subroutine. @@ -9,15 +9,16 @@ interfaces into its own subroutine. Upstream-Status: Submitted [dts@apple.com] Signed-off-by: Nate Karstens <nate.karstens@garmin.com> +Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> --- mDNSPosix/mDNSPosix.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) -diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c -index 0e10bd5..ffc9696 100644 ---- a/mDNSPosix/mDNSPosix.c -+++ b/mDNSPosix/mDNSPosix.c -@@ -856,6 +856,19 @@ mDNSlocal int SetupSocket(struct sockaddr *intfAddr, mDNSIPPort port, int interf +Index: mDNSResponder/mDNSPosix/mDNSPosix.c +=================================================================== +--- mDNSResponder.orig/mDNSPosix/mDNSPosix.c ++++ mDNSResponder/mDNSPosix/mDNSPosix.c +@@ -1322,6 +1322,19 @@ mDNSlocal int SetupSocket(struct sockadd return err; } @@ -30,17 +31,17 @@ index 0e10bd5..ffc9696 100644 + { + PosixNetworkInterface *pi = *ri; + if (utc - pi->LastSeen < 60) ri = (PosixNetworkInterface **)&pi->coreIntf.next; -+ else { *ri = (PosixNetworkInterface *)pi->coreIntf.next; free(pi); } ++ else { *ri = (PosixNetworkInterface *)pi->coreIntf.next; mdns_free(pi); } + } +} + // 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) + mDNSlocal int SetupOneInterface(mDNS *const m, struct sockaddr *intfAddr, struct sockaddr *intfMask, +@@ -1559,16 +1572,7 @@ mDNSlocal int SetupInterfaceList(mDNS *c // 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; @@ -49,12 +50,9 @@ index 0e10bd5..ffc9696 100644 - { - PosixNetworkInterface *pi = *ri; - if (utc - pi->LastSeen < 60) ri = (PosixNetworkInterface **)&pi->coreIntf.next; -- else { *ri = (PosixNetworkInterface *)pi->coreIntf.next; free(pi); } +- else { *ri = (PosixNetworkInterface *)pi->coreIntf.next; mdns_free(pi); } - } + CleanRecentInterfaces(); return err; } --- -2.17.1 - diff --git a/meta-networking/recipes-protocols/mdns/mdns/0001-Fix-SIGSEGV-during-DumpStateLog.patch b/meta-networking/recipes-protocols/mdns/mdns/0001-Fix-SIGSEGV-during-DumpStateLog.patch new file mode 100644 index 0000000000..4b0227f1dc --- /dev/null +++ b/meta-networking/recipes-protocols/mdns/mdns/0001-Fix-SIGSEGV-during-DumpStateLog.patch @@ -0,0 +1,30 @@ +From 14cc53bb09a3d8adf301f3842c765598467e63e1 Mon Sep 17 00:00:00 2001 +From: Alex Kiernan <alex.kiernan@gmail.com> +Date: Thu, 1 Feb 2024 14:07:03 +0000 +Subject: [PATCH] Fix SIGSEGV during DumpStateLog() + +DumpStateLog() calls LogMsgWithLevelv() with category == NULL, avoid +crashing in this case. + +Upstream-Status: Inactive-Upstream [Upstream does not take patches] +Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> +--- + mDNSShared/mDNSDebug.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mDNSShared/mDNSDebug.c b/mDNSShared/mDNSDebug.c +index 7a4ca19eff6d..d449dde320f6 100644 +--- a/mDNSShared/mDNSDebug.c ++++ b/mDNSShared/mDNSDebug.c +@@ -71,7 +71,7 @@ mDNSlocal void LogMsgWithLevelv(os_log_t category, os_log_type_t level, const ch + mDNSlocal void LogMsgWithLevelv(const char *category, mDNSLogLevel_t level, const char *format, va_list args) + { + // Do not print the logs if the log category is MDNS_LOG_CATEGORY_DISABLED. +- if (strcmp(category, MDNS_LOG_CATEGORY_DISABLED) == 0) ++ if (category && strcmp(category, MDNS_LOG_CATEGORY_DISABLED) == 0) + { + return; + } +-- +2.39.0 + diff --git a/meta-networking/recipes-protocols/mdns/mdns/0001-Handle-interface-without-ifa_addr.patch b/meta-networking/recipes-protocols/mdns/mdns/0001-Handle-interface-without-ifa_addr.patch new file mode 100644 index 0000000000..7e76f07c0e --- /dev/null +++ b/meta-networking/recipes-protocols/mdns/mdns/0001-Handle-interface-without-ifa_addr.patch @@ -0,0 +1,38 @@ +From 1cc54320306e07c1fc0eed98e7fbcbb07a2f3b28 Mon Sep 17 00:00:00 2001 +From: Stefan Agner <stefan@agner.ch> +Date: Fri, 23 Jun 2023 10:10:00 +0200 +Subject: [PATCH] Handle interface without `ifa_addr` + +It seems that certain interface types may have `ifa_addr` set to null. +Handle this case gracefully. + +Upstream-Status: Submitted [https://github.com/apple-oss-distributions/mDNSResponder/pull/2/commits/11b410d4d683c90e693c40315997bb3e8ec90e9a] + +Signed-off-by: Stefan Agner <stefan@agner.ch> +Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> +--- + mDNSPosix/mDNSPosix.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +Index: mDNSResponder/mDNSPosix/mDNSPosix.c +=================================================================== +--- mDNSResponder.orig/mDNSPosix/mDNSPosix.c ++++ mDNSResponder/mDNSPosix/mDNSPosix.c +@@ -1895,6 +1895,7 @@ mDNSlocal void InterfaceChangeCallback(i + continue; + + if ((ifa_loop4 == NULL) && ++ ((*ifi)->ifa_addr != NULL) && + ((*ifi)->ifa_addr->sa_family == AF_INET) && + ((*ifi)->ifa_flags & IFF_UP) && + ((*ifi)->ifa_flags & IFF_LOOPBACK)) +@@ -1903,7 +1904,8 @@ mDNSlocal void InterfaceChangeCallback(i + continue; + } + +- if ( (((*ifi)->ifa_addr->sa_family == AF_INET) ++ if ( ((*ifi)->ifa_addr != NULL) && ++ (((*ifi)->ifa_addr->sa_family == AF_INET) + #if HAVE_IPV6 + || ((*ifi)->ifa_addr->sa_family == AF_INET6) + #endif diff --git a/meta-networking/recipes-protocols/mdns/mdns/0001-dns-sd-Include-missing-headers.patch b/meta-networking/recipes-protocols/mdns/mdns/0001-dns-sd-Include-missing-headers.patch new file mode 100644 index 0000000000..82825b294d --- /dev/null +++ b/meta-networking/recipes-protocols/mdns/mdns/0001-dns-sd-Include-missing-headers.patch @@ -0,0 +1,27 @@ +From cea342c10731cb1c8c8b52f03d55f9d15fc3b091 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 4 Nov 2021 07:31:32 -0700 +Subject: [PATCH 1/6] dns-sd: Include missing headers + +Fixes build on Musl + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + mDNSPosix/nss_mdns.c | 3 +++ + 1 file changed, 3 insertions(+) + +Index: mDNSResponder/mDNSPosix/nss_mdns.c +=================================================================== +--- mDNSResponder.orig/mDNSPosix/nss_mdns.c ++++ mDNSResponder/mDNSPosix/nss_mdns.c +@@ -89,6 +89,9 @@ + + #include <dns_sd.h> + ++#if !defined(NETDB_INTERNAL) ++# define NETDB_INTERNAL (-1) ++#endif + + //---------- + // Public functions diff --git a/meta-networking/recipes-protocols/mdns/files/0002-Create-subroutine-for-tearing-down-an-interface.patch b/meta-networking/recipes-protocols/mdns/mdns/0002-Create-subroutine-for-tearing-down-an-interface.patch index 21ba318499..867db88a50 100644 --- a/meta-networking/recipes-protocols/mdns/files/0002-Create-subroutine-for-tearing-down-an-interface.patch +++ b/meta-networking/recipes-protocols/mdns/mdns/0002-Create-subroutine-for-tearing-down-an-interface.patch @@ -1,22 +1,23 @@ -From a2148df99ddcd122247f95c4cbcce5c4118581a1 Mon Sep 17 00:00:00 2001 +From 40ef0241afbb49f84e76afd65eb3ee17466bb582 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 02/11] Create subroutine for tearing down an interface +Subject: [PATCH 2/8] Create subroutine for tearing down an interface Creates a subroutine for tearing down an interface. Upstream-Status: Submitted [dts@apple.com] Signed-off-by: Nate Karstens <nate.karstens@garmin.com> +Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> --- mDNSPosix/mDNSPosix.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) -diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c -index ffc9696..5e5b2cd 100644 ---- a/mDNSPosix/mDNSPosix.c -+++ b/mDNSPosix/mDNSPosix.c -@@ -591,6 +591,19 @@ mDNSlocal void FreePosixNetworkInterface(PosixNetworkInterface *intf) +Index: mDNSResponder/mDNSPosix/mDNSPosix.c +=================================================================== +--- mDNSResponder.orig/mDNSPosix/mDNSPosix.c ++++ mDNSResponder/mDNSPosix/mDNSPosix.c +@@ -1043,6 +1043,19 @@ mDNSlocal void FreePosixNetworkInterface gRecentInterfaces = intf; } @@ -36,7 +37,7 @@ index ffc9696..5e5b2cd 100644 // Grab the first interface, deregister it, free it, and repeat until done. mDNSlocal void ClearInterfaceList(mDNS *const m) { -@@ -599,13 +612,10 @@ mDNSlocal void ClearInterfaceList(mDNS *const m) +@@ -1051,13 +1064,10 @@ mDNSlocal void ClearInterfaceList(mDNS * while (m->HostInterfaces) { PosixNetworkInterface *intf = (PosixNetworkInterface*)(m->HostInterfaces); @@ -52,7 +53,4 @@ index ffc9696..5e5b2cd 100644 + assert(num_registered_interfaces == 0); } - // Sets up a send/receive socket. --- -2.17.1 - + mDNSlocal int SetupIPv6Socket(int fd) diff --git a/meta-networking/recipes-protocols/mdns/mdns/0002-make-Set-libdns_sd.so-soname-correctly.patch b/meta-networking/recipes-protocols/mdns/mdns/0002-make-Set-libdns_sd.so-soname-correctly.patch new file mode 100644 index 0000000000..03fb1bc0d7 --- /dev/null +++ b/meta-networking/recipes-protocols/mdns/mdns/0002-make-Set-libdns_sd.so-soname-correctly.patch @@ -0,0 +1,24 @@ +From a198bcd457abd04f2e22812ff3a37246aa564614 Mon Sep 17 00:00:00 2001 +From: Alex Kiernan <alex.kiernan@gmail.com> +Date: Mon, 5 Dec 2022 15:14:12 +0000 +Subject: [PATCH 2/6] make: Set libdns_sd.so soname correctly + +Upstream-Status: Pending +Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> +--- + mDNSPosix/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: mDNSResponder/mDNSPosix/Makefile +=================================================================== +--- mDNSResponder.orig/mDNSPosix/Makefile ++++ mDNSResponder/mDNSPosix/Makefile +@@ -276,7 +276,7 @@ libdns_sd: setup $(BUILDDIR)/libdns_sd.$ + CLIENTLIBOBJS = $(OBJDIR)/dnssd_clientlib.c.so.o $(OBJDIR)/dnssd_clientstub.c.so.o $(OBJDIR)/dnssd_ipc.c.so.o $(OBJDIR)/dnssd_errstring.c.so.o + + $(BUILDDIR)/libdns_sd.$(LDSUFFIX): $(CLIENTLIBOBJS) +- $(LD) $(SOOPTS) $(LINKOPTS) -o $@ $+ ++ $(LD) $(SOOPTS) $(LINKOPTS) -Wl,-soname,libdns_sd.$(LDSUFFIX).1 -o $@ $+ + $(STRIP) $@ + + Clients: setup libdns_sd ../Clients/build/dns-sd diff --git a/meta-networking/recipes-protocols/mdns/files/0003-Track-interface-socket-family.patch b/meta-networking/recipes-protocols/mdns/mdns/0003-Track-interface-socket-family.patch index 8c0e6bf397..f1cda2b895 100644 --- a/meta-networking/recipes-protocols/mdns/files/0003-Track-interface-socket-family.patch +++ b/meta-networking/recipes-protocols/mdns/mdns/0003-Track-interface-socket-family.patch @@ -1,23 +1,24 @@ -From 71a7c728ae0d8143b66aa40decca74ebaa9aa2ce Mon Sep 17 00:00:00 2001 +From deb3a2c51f32e0d2741be11a492e727129f770e2 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 03/11] Track interface socket family +Subject: [PATCH 3/8] Track interface socket family Tracks the socket family associated with the interface. Upstream-Status: Submitted [dts@apple.com] Signed-off-by: Nate Karstens <nate.karstens@garmin.com> +Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> --- mDNSPosix/mDNSPosix.c | 1 + mDNSPosix/mDNSPosix.h | 2 ++ 2 files changed, 3 insertions(+) -diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c -index 5e5b2cd..8fe22be 100644 ---- a/mDNSPosix/mDNSPosix.c -+++ b/mDNSPosix/mDNSPosix.c -@@ -918,6 +918,7 @@ mDNSlocal int SetupOneInterface(mDNS *const m, struct sockaddr *intfAddr, struct +Index: mDNSResponder/mDNSPosix/mDNSPosix.c +=================================================================== +--- mDNSResponder.orig/mDNSPosix/mDNSPosix.c ++++ mDNSResponder/mDNSPosix/mDNSPosix.c +@@ -1415,6 +1415,7 @@ mDNSlocal int SetupOneInterface(mDNS *co // Set up the extra fields in PosixNetworkInterface. assert(intf->intfName != NULL); // intf->intfName already set up above intf->index = intfIndex; @@ -25,10 +26,10 @@ index 5e5b2cd..8fe22be 100644 intf->multicastSocket4 = -1; #if HAVE_IPV6 intf->multicastSocket6 = -1; -diff --git a/mDNSPosix/mDNSPosix.h b/mDNSPosix/mDNSPosix.h -index ca60d80..f77c185 100644 ---- a/mDNSPosix/mDNSPosix.h -+++ b/mDNSPosix/mDNSPosix.h +Index: mDNSResponder/mDNSPosix/mDNSPosix.h +=================================================================== +--- mDNSResponder.orig/mDNSPosix/mDNSPosix.h ++++ mDNSResponder/mDNSPosix/mDNSPosix.h @@ -19,6 +19,7 @@ #define __mDNSPlatformPosix_h @@ -38,13 +39,10 @@ index ca60d80..f77c185 100644 #ifdef __cplusplus @@ -40,6 +41,7 @@ struct PosixNetworkInterface - const char * intfName; + char * intfName; PosixNetworkInterface * aliasIntf; int index; + sa_family_t sa_family; int multicastSocket4; #if HAVE_IPV6 int multicastSocket6; --- -2.17.1 - diff --git a/meta-networking/recipes-protocols/mdns/mdns/0004-Indicate-loopback-interface-to-mDNS-core.patch b/meta-networking/recipes-protocols/mdns/mdns/0004-Indicate-loopback-interface-to-mDNS-core.patch new file mode 100644 index 0000000000..6bc36456f6 --- /dev/null +++ b/meta-networking/recipes-protocols/mdns/mdns/0004-Indicate-loopback-interface-to-mDNS-core.patch @@ -0,0 +1,55 @@ +From beab76b5708862f44d9acbe7a92db45e2f99259f 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 4/8] Indicate loopback interface to mDNS core + +Tells the mDNS core if an interface is a loopback interface, +similar to AddInterfaceToList() in the MacOS implementation. + +Upstream-Status: Submitted [dts@apple.com] + +Signed-off-by: Nate Karstens <nate.karstens@garmin.com> +Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> +--- + mDNSPosix/mDNSPosix.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +Index: mDNSResponder/mDNSPosix/mDNSPosix.c +=================================================================== +--- mDNSResponder.orig/mDNSPosix/mDNSPosix.c ++++ mDNSResponder/mDNSPosix/mDNSPosix.c +@@ -1348,7 +1348,7 @@ mDNSlocal void CleanRecentInterfaces(voi + // Creates a PosixNetworkInterface for the interface whose IP address is + // intfAddr and whose name is intfName and registers it with mDNS core. + mDNSlocal int SetupOneInterface(mDNS *const m, struct sockaddr *intfAddr, struct sockaddr *intfMask, +- const mDNSu8 *intfHaddr, mDNSu16 intfHlen, const char *intfName, int intfIndex) ++ const mDNSu8 *intfHaddr, mDNSu16 intfHlen, const char *intfName, int intfIndex, int intfFlags) + { + int err = 0; + PosixNetworkInterface *intf; +@@ -1411,6 +1411,7 @@ mDNSlocal int SetupOneInterface(mDNS *co + + intf->coreIntf.Advertise = m->AdvertiseLocalAddresses; + intf->coreIntf.McastTxRx = mDNStrue; ++ intf->coreIntf.Loopback = ((intfFlags & IFF_LOOPBACK) != 0) ? mDNStrue : mDNSfalse; + + // Set up the extra fields in PosixNetworkInterface. + assert(intf->intfName != NULL); // intf->intfName already set up above +@@ -1561,7 +1562,7 @@ mDNSlocal int SetupInterfaceList(mDNS *c + } + #endif + if (SetupOneInterface(m, i->ifa_addr, i->ifa_netmask, +- hwaddr, hwaddr_len, i->ifa_name, ifIndex) == 0) ++ hwaddr, hwaddr_len, i->ifa_name, ifIndex, i->ifa_flags) == 0) + { + if (i->ifa_addr->sa_family == AF_INET) + foundav4 = mDNStrue; +@@ -1578,7 +1579,7 @@ mDNSlocal int SetupInterfaceList(mDNS *c + // if ((m->HostInterfaces == NULL) && (firstLoopback != NULL)) + if (!foundav4 && firstLoopback) + (void) SetupOneInterface(m, firstLoopback->ifa_addr, firstLoopback->ifa_netmask, +- NULL, 0, firstLoopback->ifa_name, firstLoopbackIndex); ++ NULL, 0, firstLoopback->ifa_name, firstLoopbackIndex, firstLoopback->ifa_flags); + } + + // Clean up. diff --git a/meta-networking/recipes-protocols/mdns/mdns/0004-make-Separate-TLS-targets-from-libraries.patch b/meta-networking/recipes-protocols/mdns/mdns/0004-make-Separate-TLS-targets-from-libraries.patch new file mode 100644 index 0000000000..837580ac36 --- /dev/null +++ b/meta-networking/recipes-protocols/mdns/mdns/0004-make-Separate-TLS-targets-from-libraries.patch @@ -0,0 +1,61 @@ +From 22316f200803225f2d375ae5c36ffead59e2f6b8 Mon Sep 17 00:00:00 2001 +From: Alex Kiernan <alex.kiernan@gmail.com> +Date: Mon, 5 Dec 2022 15:14:26 +0000 +Subject: [PATCH 4/6] make: Separate TLS targets from libraries + +There are dependencies on TLSOBJS, which fails when `-lmbedtls` is +listed as a dependency, so separate it out. + +Upstream-Status: Pending +Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> +--- + mDNSPosix/Makefile | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +Index: mDNSResponder/mDNSPosix/Makefile +=================================================================== +--- mDNSResponder.orig/mDNSPosix/Makefile ++++ mDNSResponder/mDNSPosix/Makefile +@@ -112,9 +112,11 @@ ifeq ($(findstring linux,$(os)),linux) + ifeq ($(tls), no) + CFLAGS_OS = -D_GNU_SOURCE -DHAVE_IPV6 -DNOT_HAVE_SA_LEN -DUSES_NETLINK -DHAVE_LINUX -DTARGET_OS_LINUX -ftabstop=4 -Wno-expansion-to-defined + TLSOBJS = ++TLSLIBS = + else + CFLAGS_OS = -D_GNU_SOURCE -DHAVE_IPV6 -DNOT_HAVE_SA_LEN -DUSES_NETLINK -DHAVE_LINUX -DTARGET_OS_LINUX -DPOSIX_HAS_TLS -ftabstop=4 -Wno-expansion-to-defined +-TLSOBJS = $(OBJDIR)/mbedtls.c.o -lmbedtls -lmbedcrypto ++TLSOBJS = $(OBJDIR)/mbedtls.c.o ++TLSLIBS = -lmbedtls -lmbedcrypto + endif + LD = $(CC) + SOOPTS = -shared +@@ -266,7 +268,7 @@ Daemon: setup $(BUILDDIR)/mdnsd + @echo "Responder daemon done" + + $(BUILDDIR)/mdnsd: $(DAEMONOBJS) +- $(CC) -o $@ $+ $(LINKOPTS) ++ $(CC) -o $@ $+ $(LINKOPTS) $(TLSLIBS) + $(STRIP) $@ + + # libdns_sd target builds the client library +@@ -485,16 +487,16 @@ dnsextd: setup $(BUILDDIR)/dnsextd + @echo "dnsextd done" + + $(BUILDDIR)/mDNSClientPosix: $(APPOBJ) $(TLSOBJS) $(OBJDIR)/Client.c.o +- $(CC) $+ -o $@ $(LINKOPTS) ++ $(CC) $+ -o $@ $(LINKOPTS) $(TLSLIBS) + + $(BUILDDIR)/mDNSResponderPosix: $(COMMONOBJ) $(TLSOBJS) $(OBJDIR)/Responder.c.o +- $(CC) $+ -o $@ $(LINKOPTS) ++ $(CC) $+ -o $@ $(LINKOPTS) $(TLSLIBS) + + $(BUILDDIR)/mDNSProxyResponderPosix: $(COMMONOBJ) $(TLSOBJS) $(OBJDIR)/ProxyResponder.c.o +- $(CC) $+ -o $@ $(LINKOPTS) ++ $(CC) $+ -o $@ $(LINKOPTS) $(TLSLIBS) + + $(BUILDDIR)/mDNSNetMonitor: $(SPECIALOBJ) $(TLSOBJS) $(OBJDIR)/NetMonitor.c.o +- $(CC) $+ -o $@ $(LINKOPTS) ++ $(CC) $+ -o $@ $(LINKOPTS) $(TLSLIBS) + + $(OBJDIR)/NetMonitor.c.o: $(COREDIR)/mDNS.c # Note: NetMonitor.c textually imports mDNS.c + diff --git a/meta-networking/recipes-protocols/mdns/files/0004-Use-list-for-changed-interfaces.patch b/meta-networking/recipes-protocols/mdns/mdns/0005-Use-list-for-changed-interfaces.patch index 05ad49b9f9..f00116c617 100644 --- a/meta-networking/recipes-protocols/mdns/files/0004-Use-list-for-changed-interfaces.patch +++ b/meta-networking/recipes-protocols/mdns/mdns/0005-Use-list-for-changed-interfaces.patch @@ -1,7 +1,7 @@ -From e1f483510a1011e37540fdee8f3bc36111fa45a0 Mon Sep 17 00:00:00 2001 +From e79f81f5cd626ad77ec64de4325f6645cf253c5e 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 +Subject: [PATCH 5/8] Use list for changed interfaces Uses a linked list to store the index of changed network interfaces instead of a bitfield. This allows for network interfaces with an @@ -10,15 +10,16 @@ index greater than 31 (an index of 36 was seen on Android). Upstream-Status: Submitted [dts@apple.com] Signed-off-by: Nate Karstens <nate.karstens@garmin.com> +Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> --- - mDNSPosix/mDNSPosix.c | 67 +++++++++++++++++++++++++++++++++---------- - 1 file changed, 52 insertions(+), 15 deletions(-) + mDNSPosix/mDNSPosix.c | 58 ++++++++++++++++++++++++++++++++----------- + 1 file changed, 43 insertions(+), 15 deletions(-) -diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c -index 8fe22be..699855a 100644 ---- a/mDNSPosix/mDNSPosix.c -+++ b/mDNSPosix/mDNSPosix.c -@@ -75,6 +75,14 @@ struct IfChangeRec +Index: mDNSResponder/mDNSPosix/mDNSPosix.c +=================================================================== +--- mDNSResponder.orig/mDNSPosix/mDNSPosix.c ++++ mDNSResponder/mDNSPosix/mDNSPosix.c +@@ -74,6 +74,14 @@ struct IfChangeRec }; typedef struct IfChangeRec IfChangeRec; @@ -31,31 +32,22 @@ 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 +@@ -1621,6 +1629,23 @@ mDNSlocal mStatus OpenIfNotifySocket(int return err; } -+mDNSlocal mDNSBool ListContainsInterfaceIndex(GenLinkedList *list, int if_index) ++mDNSlocal void AddInterfaceIndexToList(GenLinkedList *list, int if_index) +{ + NetworkInterfaceIndex *item; + + for (item = (NetworkInterfaceIndex*)list->Head; item != NULL; item = item->Next) + { -+ if (if_index == item->if_index) return mDNStrue; ++ if (if_index == item->if_index) return; + } + -+ return mDNSfalse; -+} -+ -+mDNSlocal void AddInterfaceIndexToList(GenLinkedList *list, int if_index) -+{ -+ NetworkInterfaceIndex *item; -+ -+ if (ListContainsInterfaceIndex(list, if_index)) return; -+ -+ item = malloc(sizeof *item); ++ item = mdns_malloc(sizeof *item); + if (item == NULL) return; + + item->if_index = if_index; @@ -66,7 +58,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) +@@ -1648,14 +1673,13 @@ mDNSlocal void PrintNetLinkMsg(cons } #endif @@ -82,7 +74,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) +@@ -1691,9 +1715,9 @@ mDNSlocal mDNSu32 ProcessRoutingNo // Process the NetLink message if (pNLMsg->nlmsg_type == RTM_GETLINK || pNLMsg->nlmsg_type == RTM_NEWLINK) @@ -94,7 +86,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) +@@ -1704,8 +1728,6 @@ mDNSlocal mDNSu32 ProcessRoutingNo else break; // all done! } @@ -103,7 +95,7 @@ index 8fe22be..699855a 100644 } #else // USES_NETLINK -@@ -1187,14 +1218,13 @@ mDNSlocal void PrintRoutingSocketMsg(const struct ifa_msghdr *pRSMsg) +@@ -1737,14 +1759,13 @@ mDNSlocal void PrintRoutingSocketMs } #endif @@ -119,7 +111,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) +@@ -1759,12 +1780,10 @@ mDNSlocal mDNSu32 ProcessRoutingNo pRSMsg->ifam_type == RTM_IFINFO) { if (pRSMsg->ifam_type == RTM_IFINFO) @@ -134,7 +126,7 @@ index 8fe22be..699855a 100644 } #endif // USES_NETLINK -@@ -1224,7 +1252,8 @@ mDNSlocal void InterfaceChangeCallback(int fd, short filter, void *context) +@@ -1774,7 +1793,8 @@ mDNSlocal void InterfaceChangeCallback(i { IfChangeRec *pChgRec = (IfChangeRec*) context; fd_set readFDs; @@ -144,7 +136,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) +@@ -1782,17 +1802,25 @@ mDNSlocal void InterfaceChangeCallback(i FD_ZERO(&readFDs); FD_SET(pChgRec->NotifySD, &readFDs); @@ -167,11 +159,8 @@ index 8fe22be..699855a 100644 + while ((changedInterface = (NetworkInterfaceIndex*)changedInterfaces.Head) != NULL) + { + RemoveFromList(&changedInterfaces, changedInterface); -+ free(changedInterface); ++ mdns_free(changedInterface); + } } // Register with either a Routing Socket or RtNetLink to listen for interface changes. --- -2.17.1 - diff --git a/meta-networking/recipes-protocols/mdns/mdns/0005-mDNSCore-Fix-broken-debug-parameter.patch b/meta-networking/recipes-protocols/mdns/mdns/0005-mDNSCore-Fix-broken-debug-parameter.patch new file mode 100644 index 0000000000..fd2f2f1178 --- /dev/null +++ b/meta-networking/recipes-protocols/mdns/mdns/0005-mDNSCore-Fix-broken-debug-parameter.patch @@ -0,0 +1,25 @@ +From 764b6202402e9e5687ff873330e5ad6be6f69df7 Mon Sep 17 00:00:00 2001 +From: Alex Kiernan <alex.kiernan@gmail.com> +Date: Mon, 5 Dec 2022 22:49:49 +0000 +Subject: [PATCH] mDNSCore: Fix broken debug parameter + +Upstream-Status: Pending +Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> + +--- + mDNSCore/mDNS.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: mDNSResponder/mDNSCore/mDNS.c +=================================================================== +--- mDNSResponder.orig/mDNSCore/mDNS.c ++++ mDNSResponder/mDNSCore/mDNS.c +@@ -10231,7 +10231,7 @@ mDNSlocal void mDNSCoreReceiveNoUnicastA + #else + const DNSServRef dnsserv = qptr->qDNSServer; + #endif +- debugf("mDNSCoreReceiveNoUnicastAnswers making negative cache entry TTL %d for %##s (%s)", negttl, currentQName, DNSTypeName(q.qtype)); ++ debugf("mDNSCoreReceiveNoUnicastAnswers making negative cache entry TTL %d for %##s (%s)", negttl, currentQName->c, DNSTypeName(q.qtype)); + // Create a negative record for the current name in the CNAME chain. + MakeNegativeCacheRecord(m, &m->rec.r, currentQName, currentQNameHash, q.qtype, q.qclass, negttl, mDNSInterface_Any, + dnsserv, response->h.flags); diff --git a/meta-networking/recipes-protocols/mdns/files/0005-Handle-noisy-netlink-sockets.patch b/meta-networking/recipes-protocols/mdns/mdns/0006-Handle-noisy-netlink-sockets.patch index f2b171e55b..80cdbca500 100644 --- a/meta-networking/recipes-protocols/mdns/files/0005-Handle-noisy-netlink-sockets.patch +++ b/meta-networking/recipes-protocols/mdns/mdns/0006-Handle-noisy-netlink-sockets.patch @@ -1,7 +1,7 @@ -From 92025cab86619f548bf3eb816a1804ef40507ca7 Mon Sep 17 00:00:00 2001 +From bfa1d68bed863e22c40a6d9a19ffbcc8694bbff6 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 +Subject: [PATCH 6/8] Handle noisy netlink sockets The POSIX implementation currently clears all network interfaces when netlink indicates that there has been a change. This causes @@ -22,30 +22,36 @@ This changes netlink notification handling by: Upstream-Status: Submitted [dts@apple.com] Signed-off-by: Nate Karstens <nate.karstens@garmin.com> +Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> --- - mDNSPosix/mDNSPosix.c | 143 +++++++++++++++++++++++++++++++++++++++--- - 1 file changed, 133 insertions(+), 10 deletions(-) + mDNSPosix/mDNSPosix.c | 182 +++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 172 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 +Index: mDNSResponder/mDNSPosix/mDNSPosix.c +=================================================================== +--- mDNSResponder.orig/mDNSPosix/mDNSPosix.c ++++ mDNSResponder/mDNSPosix/mDNSPosix.c +@@ -1788,14 +1788,43 @@ mDNSlocal void ProcessRoutingNo #endif // USES_NETLINK -+// Test whether the given PosixNetworkInterface matches the given struct ifi_info -+mDNSlocal mDNSBool InterfacesMatch(PosixNetworkInterface *intf, struct ifi_info *ifi) ++// Test whether the given PosixNetworkInterface matches the given struct ifaddrs ++mDNSlocal mDNSBool InterfacesMatch(PosixNetworkInterface *intf, struct ifaddrs *ifi) +{ + mDNSBool match = mDNSfalse; + mDNSAddr ip, mask; ++ unsigned int if_index; + -+ if((intf->index == ifi->ifi_index) && -+ (intf->sa_family == ifi->ifi_addr->sa_family) && -+ (strcmp(intf->coreIntf.ifname, ifi->ifi_name) == 0)) ++ if_index = if_nametoindex(ifi->ifa_name); ++ if (if_index == 0) ++ return mDNSfalse; ++ ++ if((intf->index == if_index) && ++ (intf->sa_family == ifi->ifa_addr->sa_family) && ++ (strcmp(intf->coreIntf.ifname, ifi->ifa_name) == 0)) + { -+ SockAddrTomDNSAddr(ifi->ifi_addr, &ip, NULL); -+ SockAddrTomDNSAddr(ifi->ifi_netmask, &mask, NULL); ++ SockAddrTomDNSAddr(ifi->ifa_addr, &ip, NULL); ++ SockAddrTomDNSAddr(ifi->ifa_netmask, &mask, NULL); + + match = mDNSSameAddress(&intf->coreIntf.ip, &ip) && + mDNSSameAddress(&intf->coreIntf.mask, &mask); @@ -55,7 +61,7 @@ index 699855a..59a8b8c 100644 +} + // Called when data appears on interface change notification socket - mDNSlocal void InterfaceChangeCallback(int fd, short filter, void *context) + mDNSlocal void InterfaceChangeCallback(int fd, void *context) { IfChangeRec *pChgRec = (IfChangeRec*) context; + mDNS *m = pChgRec->mDNS; @@ -63,13 +69,13 @@ index 699855a..59a8b8c 100644 GenLinkedList changedInterfaces; NetworkInterfaceIndex *changedInterface; struct timeval zeroTimeout = { 0, 0 }; -+ struct ifi_info *ifi_list, **ifi, *ifi_free, *ifi_loop4 = NULL; ++ struct ifaddrs *ifa_list, **ifi, *ifa_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) + +@@ -1810,12 +1839,149 @@ mDNSlocal void InterfaceChangeCallback(i } while (0 < select(pChgRec->NotifySD + 1, &readFDs, (fd_set*) NULL, (fd_set*) NULL, &zeroTimeout)); @@ -82,15 +88,7 @@ index 699855a..59a8b8c 100644 + + 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 ++ if (getifaddrs(&ifa_list) < 0) goto cleanup; + + for (intf = (PosixNetworkInterface*)(m->HostInterfaces); intf != NULL; intf = intfNext) + { @@ -100,18 +98,11 @@ index 699855a..59a8b8c 100644 + if (intf->coreIntf.Loopback) continue; + + found = mDNSfalse; -+ for (ifi = &ifi_list; *ifi != NULL; ifi = &(*ifi)->ifi_next) ++ for (ifi = &ifa_list; *ifi != NULL; ifi = &(*ifi)->ifa_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; + } + } @@ -120,28 +111,76 @@ index 699855a..59a8b8c 100644 + if (!found) TearDownInterface(m, intf); + } + -+ // Add new and changed interfaces in ifi_list ++ // Add new and changed interfaces in ifa_list + // Save off loopback interface in case it is needed later -+ for (ifi = &ifi_list; *ifi != NULL; ifi = &(*ifi)->ifi_next) ++ for (ifi = &ifa_list; *ifi != NULL; ifi = &(*ifi)->ifa_next) + { -+ if ((ifi_loop4 == NULL) && -+ ((*ifi)->ifi_addr->sa_family == AF_INET) && -+ ((*ifi)->ifi_flags & IFF_UP) && -+ ((*ifi)->ifi_flags & IFF_LOOPBACK)) ++ found = mDNSfalse; ++ 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; ++ ++ if (InterfacesMatch(intf, *ifi)) ++ { ++ found = mDNStrue; ++ break; ++ } ++ ++ // Removes changed and old interfaces from m->HostInterfaces ++ } ++ if (found) ++ continue; ++ ++ if ((ifa_loop4 == NULL) && ++ ((*ifi)->ifa_addr->sa_family == AF_INET) && ++ ((*ifi)->ifa_flags & IFF_UP) && ++ ((*ifi)->ifa_flags & IFF_LOOPBACK)) + { -+ ifi_loop4 = *ifi; ++ ifa_loop4 = *ifi; + continue; + } + -+ if ( (((*ifi)->ifi_addr->sa_family == AF_INET) ++ if ( (((*ifi)->ifa_addr->sa_family == AF_INET) +#if HAVE_IPV6 -+ || ((*ifi)->ifi_addr->sa_family == AF_INET6) ++ || ((*ifi)->ifa_addr->sa_family == AF_INET6) +#endif -+ ) && ((*ifi)->ifi_flags & IFF_UP) -+ && !((*ifi)->ifi_flags & IFF_POINTOPOINT) -+ && !((*ifi)->ifi_flags & IFF_LOOPBACK)) ++ ) && ((*ifi)->ifa_flags & IFF_UP) ++ && !((*ifi)->ifa_flags & IFF_POINTOPOINT) ++ && !((*ifi)->ifa_flags & IFF_LOOPBACK)) + { -+ SetupOneInterface(m, *ifi); ++ struct ifaddrs *i = *ifi; ++ ++#define ethernet_addr_len 6 ++ uint8_t hwaddr[ethernet_addr_len]; ++ int hwaddr_len = 0; ++ ++#if defined(TARGET_OS_LINUX) && TARGET_OS_LINUX ++ struct ifreq ifr; ++ int sockfd = socket(AF_INET6, SOCK_DGRAM, 0); ++ if (sockfd >= 0) ++ { ++ /* Add hardware address */ ++ memcpy(ifr.ifr_name, i->ifa_name, IFNAMSIZ); ++ if (ioctl(sockfd, SIOCGIFHWADDR, &ifr) != -1) ++ { ++ if (ifr.ifr_hwaddr.sa_family == ARPHRD_ETHER) ++ { ++ memcpy(hwaddr, ifr.ifr_hwaddr.sa_data, ethernet_addr_len); ++ hwaddr_len = ethernet_addr_len; ++ } ++ } ++ close(sockfd); ++ } ++ else ++ { ++ memset(hwaddr, 0, sizeof(hwaddr)); ++ } ++#endif // TARGET_OS_LINUX ++ SetupOneInterface(m, i->ifa_addr, i->ifa_netmask, ++ hwaddr, hwaddr_len, i->ifa_name, if_nametoindex(i->ifa_name), i->ifa_flags); + } + } + @@ -178,19 +217,20 @@ index 699855a..59a8b8c 100644 + } + } + -+ if (!found && (ifi_loop4 != NULL)) ++ if (!found && (ifa_loop4 != NULL)) + { -+ SetupOneInterface(m, ifi_loop4); ++ SetupOneInterface(m, ifa_loop4->ifa_addr, ifa_loop4->ifa_netmask, ++ NULL, 0, ifa_loop4->ifa_name, if_nametoindex(ifa_loop4->ifa_name), ifa_loop4->ifa_flags); + } + } + -+ if (ifi_list != NULL) free_ifi_info(ifi_list); ++ if (ifa_list != NULL) freeifaddrs(ifa_list); +cleanup: while ((changedInterface = (NetworkInterfaceIndex*)changedInterfaces.Head) != NULL) { RemoveFromList(&changedInterfaces, changedInterface); -@@ -1400,15 +1527,11 @@ mDNSexport void mDNSPlatformClose(mDNS *const m) +@@ -1947,15 +2113,11 @@ mDNSexport void mDNSPlatformClose(mDNS * #endif } @@ -207,6 +247,3 @@ index 699855a..59a8b8c 100644 ClearInterfaceList(m); err = SetupInterfaceList(m); return PosixErrorToStatus(err); --- -2.17.1 - diff --git a/meta-networking/recipes-protocols/mdns/mdns/0006-make-Add-top-level-Makefile.patch b/meta-networking/recipes-protocols/mdns/mdns/0006-make-Add-top-level-Makefile.patch new file mode 100644 index 0000000000..c12a02fcdd --- /dev/null +++ b/meta-networking/recipes-protocols/mdns/mdns/0006-make-Add-top-level-Makefile.patch @@ -0,0 +1,21 @@ +From fa9ef50ab4c4225cf3ade4bafc38ddf93e6fe127 Mon Sep 17 00:00:00 2001 +From: Alex Kiernan <alex.kiernan@gmail.com> +Date: Tue, 6 Dec 2022 13:28:31 +0000 +Subject: [PATCH 6/6] make: Add top-level Makefile + +Simple top level Makefile that just delegates to mDNSPosix. + +Upstream-Status: Inappropriate [oe-specific] +Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> +--- + Makefile | 2 ++ + 1 file changed, 2 insertions(+) + create mode 100644 Makefile + +Index: mDNSResponder/Makefile +=================================================================== +--- /dev/null ++++ mDNSResponder/Makefile +@@ -0,0 +1,2 @@ ++all clean: ++ cd mDNSPosix && $(MAKE) $@ diff --git a/meta-networking/recipes-protocols/mdns/files/0008-Mark-deleted-interfaces-as-being-changed.patch b/meta-networking/recipes-protocols/mdns/mdns/0007-Mark-deleted-interfaces-as-being-changed.patch index fdc5105cb9..dae1ac7ea0 100644 --- a/meta-networking/recipes-protocols/mdns/files/0008-Mark-deleted-interfaces-as-being-changed.patch +++ b/meta-networking/recipes-protocols/mdns/mdns/0007-Mark-deleted-interfaces-as-being-changed.patch @@ -1,7 +1,7 @@ -From 0fcc0f210f3a9310a1963de640b384ce866410fd Mon Sep 17 00:00:00 2001 +From a8accffb95267490b50401c8b65ec18db57b5ef5 Mon Sep 17 00:00:00 2001 From: Nate Karstens <nate.karstens@garmin.com> Date: Wed, 9 Aug 2017 09:16:58 -0500 -Subject: [PATCH 08/11] Mark deleted interfaces as being changed +Subject: [PATCH 7/8] Mark deleted interfaces as being changed Netlink notification handling ignores messages for deleted links, RTM_DELLINK. It does handle RTM_GETLINK. According to libnl docu- @@ -17,15 +17,16 @@ Testing and Verification Instructions: Upstream-Status: Submitted [dts@apple.com] Signed-off-by: Nate Karstens <nate.karstens@garmin.com> +Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> --- mDNSPosix/mDNSPosix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c -index 798ab10..a8a57df 100644 ---- a/mDNSPosix/mDNSPosix.c -+++ b/mDNSPosix/mDNSPosix.c -@@ -1163,7 +1163,7 @@ mDNSlocal void ProcessRoutingNotification(int sd, GenLinkedList *change +Index: mDNSResponder/mDNSPosix/mDNSPosix.c +=================================================================== +--- mDNSResponder.orig/mDNSPosix/mDNSPosix.c ++++ mDNSResponder/mDNSPosix/mDNSPosix.c +@@ -1714,7 +1714,7 @@ mDNSlocal void ProcessRoutingNo #endif // Process the NetLink message @@ -34,6 +35,3 @@ index 798ab10..a8a57df 100644 AddInterfaceIndexToList(changedInterfaces, ((struct ifinfomsg*) NLMSG_DATA(pNLMsg))->ifi_index); else if (pNLMsg->nlmsg_type == RTM_DELADDR || pNLMsg->nlmsg_type == RTM_NEWADDR) AddInterfaceIndexToList(changedInterfaces, ((struct ifaddrmsg*) NLMSG_DATA(pNLMsg))->ifa_index); --- -2.17.1 - diff --git a/meta-networking/recipes-protocols/mdns/files/0010-Handle-errors-from-socket-calls.patch b/meta-networking/recipes-protocols/mdns/mdns/0008-Handle-errors-from-socket-calls.patch index b9b0157276..1789001e14 100644 --- a/meta-networking/recipes-protocols/mdns/files/0010-Handle-errors-from-socket-calls.patch +++ b/meta-networking/recipes-protocols/mdns/mdns/0008-Handle-errors-from-socket-calls.patch @@ -1,7 +1,7 @@ -From 382b3b924e43abd1bdc5792918161d0922666691 Mon Sep 17 00:00:00 2001 +From ed58146d3aeecdb9920fdc017f85c18b5b10f2db Mon Sep 17 00:00:00 2001 From: Nate Karstens <nate.karstens@garmin.com> Date: Thu, 10 Aug 2017 08:27:32 -0500 -Subject: [PATCH 10/11] Handle errors from socket calls +Subject: [PATCH 8/8] Handle errors from socket calls Adds handling for socket() or read() returning a negative value (indicating an error has occurred). @@ -9,15 +9,16 @@ negative value (indicating an error has occurred). Upstream-Status: Submitted [dts@apple.com] Signed-off-by: Nate Karstens <nate.karstens@garmin.com> +Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> --- mDNSPosix/mDNSPosix.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) -diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c -index 3243ed4..84af26b 100644 ---- a/mDNSPosix/mDNSPosix.c -+++ b/mDNSPosix/mDNSPosix.c -@@ -1129,7 +1129,7 @@ mDNSlocal void ProcessRoutingNotification(int sd, GenLinkedList *change +Index: mDNSResponder/mDNSPosix/mDNSPosix.c +=================================================================== +--- mDNSResponder.orig/mDNSPosix/mDNSPosix.c ++++ mDNSResponder/mDNSPosix/mDNSPosix.c +@@ -1677,7 +1677,7 @@ mDNSlocal void ProcessRoutingNo // Read through the messages on sd and if any indicate that any interface records should // be torn down and rebuilt, return affected indices as a bitmask. Otherwise return 0. { @@ -26,7 +27,7 @@ index 3243ed4..84af26b 100644 char buff[4096]; struct nlmsghdr *pNLMsg = (struct nlmsghdr*) buff; -@@ -1138,7 +1138,10 @@ mDNSlocal void ProcessRoutingNotification(int sd, GenLinkedList *change +@@ -1686,7 +1686,10 @@ mDNSlocal void ProcessRoutingNo // enough to hold all pending data and so avoid message fragmentation. // (Note that FIONREAD is not supported on AF_NETLINK.) @@ -38,7 +39,7 @@ index 3243ed4..84af26b 100644 while (1) { // Make sure we've got an entire nlmsghdr in the buffer, and payload, too. -@@ -1154,7 +1157,9 @@ mDNSlocal void ProcessRoutingNotification(int sd, GenLinkedList *change +@@ -1702,7 +1705,9 @@ mDNSlocal void ProcessRoutingNo pNLMsg = (struct nlmsghdr*) buff; // read more data @@ -49,7 +50,7 @@ index 3243ed4..84af26b 100644 continue; // spin around and revalidate with new readCount } else -@@ -1429,6 +1434,7 @@ mDNSlocal mDNSBool mDNSPlatformInit_CanReceiveUnicast(void) +@@ -2017,6 +2022,7 @@ mDNSlocal mDNSBool mDNSPlatformInit_CanR int err; int s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); struct sockaddr_in s5353; @@ -57,6 +58,3 @@ index 3243ed4..84af26b 100644 s5353.sin_family = AF_INET; s5353.sin_port = MulticastDNSPort.NotAnInteger; s5353.sin_addr.s_addr = 0; --- -2.17.1 - diff --git a/meta-networking/recipes-protocols/mdns/mdns/0009-remove-unneeded-headers.patch b/meta-networking/recipes-protocols/mdns/mdns/0009-remove-unneeded-headers.patch new file mode 100644 index 0000000000..d443bc97b2 --- /dev/null +++ b/meta-networking/recipes-protocols/mdns/mdns/0009-remove-unneeded-headers.patch @@ -0,0 +1,31 @@ +From 1d7e71e72c597ffcc19c04373a477d1fbd3ad955 Mon Sep 17 00:00:00 2001 +From: Beniamin Sandu <beniaminsandu@gmail.com> +Date: Thu, 15 Jun 2023 17:02:58 +0000 +Subject: [PATCH] remove unneeded headers + +From a quick look, these seem to not be needed and having them +breaks the build with mbedtls 3.x. Without them it builds fine +on both 2.x and 3.x versions. + +Upstream-Status: Pending + +Signed-off-by: Beniamin Sandu <beniaminsandu@gmail.com> +--- + mDNSPosix/mbedtls.c | 2 -- + 1 file changed, 2 deletions(-) + +Index: mDNSResponder/mDNSPosix/mbedtls.c +=================================================================== +--- mDNSResponder.orig/mDNSPosix/mbedtls.c ++++ mDNSResponder/mDNSPosix/mbedtls.c +@@ -38,10 +38,8 @@ + #include <mbedtls/sha256.h> + #include <mbedtls/base64.h> + +-#include <mbedtls/certs.h> + #include <mbedtls/x509.h> + #include <mbedtls/ssl.h> +-#include <mbedtls/config.h> + + // Posix TLS server context + struct TLSContext_struct { diff --git a/meta-networking/recipes-protocols/mdns/mdns/0015-Add-missing-limits.h.patch b/meta-networking/recipes-protocols/mdns/mdns/0015-Add-missing-limits.h.patch new file mode 100644 index 0000000000..511a6fdc18 --- /dev/null +++ b/meta-networking/recipes-protocols/mdns/mdns/0015-Add-missing-limits.h.patch @@ -0,0 +1,23 @@ +From 9fc45a2cf3b78573a568abf538a6e6f4bd30b2d7 Mon Sep 17 00:00:00 2001 +From: Alex Kiernan <alex.kiernan@gmail.com> +Date: Wed, 27 Sep 2023 11:45:26 +0100 +Subject: [PATCH] Add missing limits.h + +Upstream-Status: Pending +Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> +--- + mDNSShared/PlatformCommon.c | 1 + + 1 file changed, 1 insertion(+) + +Index: mDNSResponder/mDNSShared/PlatformCommon.c +=================================================================== +--- mDNSResponder.orig/mDNSShared/PlatformCommon.c ++++ mDNSResponder/mDNSShared/PlatformCommon.c +@@ -32,6 +32,7 @@ + #include <time.h> + #include <sys/time.h> // Needed for #include <sys/time.h>(). + #include <assert.h> ++#include <limits.h> + + + #include "mDNSEmbeddedAPI.h" // Defines the interface provided to the client layer above diff --git a/meta-networking/recipes-protocols/mdns/files/mdns.service b/meta-networking/recipes-protocols/mdns/mdns/mdns.service index 531d142dcd..531d142dcd 100644 --- a/meta-networking/recipes-protocols/mdns/files/mdns.service +++ b/meta-networking/recipes-protocols/mdns/mdns/mdns.service diff --git a/meta-networking/recipes-protocols/mdns/mdns_2200.100.94.0.2.bb b/meta-networking/recipes-protocols/mdns/mdns_2200.100.94.0.2.bb new file mode 100644 index 0000000000..183f05ebc3 --- /dev/null +++ b/meta-networking/recipes-protocols/mdns/mdns_2200.100.94.0.2.bb @@ -0,0 +1,135 @@ +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 = "https://developer.apple.com/bonjour/" +LICENSE = "Apache-2.0 & BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=31c50371921e0fb731003bbc665f29bf" + +DEPENDS:append:libc-musl = " musl-nscd" + +SRC_URI = "git://github.com/apple-oss-distributions/mDNSResponder;protocol=https;branch=rel/mDNSResponder-2200 \ + file://0001-dns-sd-Include-missing-headers.patch \ + file://0002-make-Set-libdns_sd.so-soname-correctly.patch \ + file://0004-make-Separate-TLS-targets-from-libraries.patch \ + file://0005-mDNSCore-Fix-broken-debug-parameter.patch \ + file://0006-make-Add-top-level-Makefile.patch \ + file://0001-Create-subroutine-for-cleaning-recent-interfaces.patch \ + file://0002-Create-subroutine-for-tearing-down-an-interface.patch \ + file://0003-Track-interface-socket-family.patch \ + file://0004-Indicate-loopback-interface-to-mDNS-core.patch \ + file://0005-Use-list-for-changed-interfaces.patch \ + file://0006-Handle-noisy-netlink-sockets.patch \ + file://0007-Mark-deleted-interfaces-as-being-changed.patch \ + file://0008-Handle-errors-from-socket-calls.patch \ + file://0009-remove-unneeded-headers.patch \ + file://mdns.service \ + file://0015-Add-missing-limits.h.patch \ + file://0001-Handle-interface-without-ifa_addr.patch \ + file://0001-Fix-SIGSEGV-during-DumpStateLog.patch \ + " +SRCREV = "8f70f98fc1d0cf439ca3a6470be6ad8ac2bcc019" + +# We install a stub Makefile in the top directory so that the various checks +# in base.bbclass pass their tests for a Makefile, this ensures (that amongst +# other things) the sstate checks will clean the build directory when the +# task hashes changes. +# +# We can't use the approach of setting ${S} to mDNSPosix as we need +# DEBUG_PREFIX_MAP to cover files which come from the Clients directory too. +S = "${WORKDIR}/git" + +inherit github-releases manpages systemd update-rc.d + +PACKAGECONFIG ?= "tls \ + ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}" +PACKAGECONFIG[debug] = "DEBUG=1,DEBUG=0" +PACKAGECONFIG[ipv6] = "HAVE_IPV6=1,HAVE_IPV6=0" +PACKAGECONFIG[manpages] = "" +PACKAGECONFIG[tls] = ",tls=no,mbedtls" + +CVE_PRODUCT = "apple:mdnsresponder" + +CVE_STATUS[CVE-2007-0613] = "not-applicable-platform: Issue affects Apple products \ +i.e. ichat,mdnsresponder, instant message framework and MacOS. Also, \ +https://www.exploit-db.com/exploits/3230 shows the part of code \ +affected by CVE-2007-0613 which is not preset in upstream source code. \ +Hence, CVE-2007-0613 does not affect other Yocto implementations and \ +is not reported for other distros can be marked whitelisted. \ +Links: https://vulmon.com/vulnerabilitydetails?qid=CVE-2007-0613 \ +https://www.incibe-cert.es/en/early-warning/vulnerabilities/cve-2007-0613 \ +https://security-tracker.debian.org/tracker/CVE-2007-0613 \ +https://vulmon.com/vulnerabilitydetails?qid=CVE-2007-0613" + +PARALLEL_MAKE = "" + +EXTRA_OEMAKE = "os=linux 'CC=${CCLD}' 'LD=${CCLD}' 'LINKOPTS=${LDFLAGS}' STRIP=: ${PACKAGECONFIG_CONFARGS}" + +# MDNS_VERSIONSTR_NODTS disables __DATE__ and __TIME__ in the version string, +# which are fixed anyway for build reproducibility. +TARGET_CPPFLAGS += "-DMDNS_VERSIONSTR_NODTS" + +TARGET_CC_ARCH += "${LDFLAGS}" + +MDNS_BUILDDIR = "build/${@bb.utils.contains('PACKAGECONFIG','debug','debug','prod', d)}" + +do_install () { + cd mDNSPosix + + install -d ${D}${sbindir} + install ${MDNS_BUILDDIR}/mdnsd ${D}${sbindir} + + install -d ${D}${libdir} + install -m 0644 ${MDNS_BUILDDIR}/libdns_sd.so ${D}${libdir}/libdns_sd.so.1 + ln -s libdns_sd.so.1 ${D}${libdir}/libdns_sd.so + + install -d ${D}${includedir} + install -m 0644 ../mDNSShared/dns_sd.h ${D}${includedir} + + install -d ${D}${mandir}/man8 + install -m 0644 ../mDNSShared/mDNSResponder.8 ${D}${mandir}/man8/mdnsd.8 + + install -d ${D}${bindir} + install -m 0755 ../Clients/build/dns-sd ${D}${bindir} + + install -d ${D}${libdir} + oe_libinstall -C ${MDNS_BUILDDIR} -so libnss_mdns-0.2 ${D}${libdir} + ln -s libnss_mdns-0.2.so ${D}${libdir}/libnss_mdns.so.2 + + install -d ${D}${sysconfdir} + install -m 0644 nss_mdns.conf ${D}${sysconfdir} + + install -d ${D}${mandir}/man5 + install -m 0644 nss_mdns.conf.5 ${D}${mandir}/man5 + + install -d ${D}${mandir}/man8 + install -m 0644 libnss_mdns.8 ${D}${mandir}/man8 + + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${WORKDIR}/mdns.service ${D}${systemd_system_unitdir} + + install -d ${D}${INIT_D_DIR} + install mdnsd.sh ${D}${INIT_D_DIR}/mdns +} + +pkg_postinst:${PN} () { + if [ -r $D${sysconfdir}/nsswitch.conf ]; then + sed -e '/^hosts:/s/\s*\<mdns\>//' \ + -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 mdns\3\4\5/' \ + -i $D${sysconfdir}/nsswitch.conf + fi +} + +pkg_prerm:${PN} () { + if [ -r $D${sysconfdir}/nsswitch.conf ]; then + sed -e '/^hosts:/s/\s*\<mdns\>//' \ + -e '/^hosts:/s/\s*mdns//' \ + -i $D${sysconfdir}/nsswitch.conf + fi +} + +SYSTEMD_SERVICE:${PN} = "mdns.service" +INITSCRIPT_NAME = "mdns" + +FILES_SOLIBSDEV = "${libdir}/libdns_sd.so" +FILES:${PN} += "${libdir}/libnss_mdns-0.2.so" + +RPROVIDES:${PN} += "libdns_sd.so" diff --git a/meta-networking/recipes-protocols/mdns/mdns_878.270.2.bb b/meta-networking/recipes-protocols/mdns/mdns_878.270.2.bb deleted file mode 100644 index 0f8dc92df3..0000000000 --- a/meta-networking/recipes-protocols/mdns/mdns_878.270.2.bb +++ /dev/null @@ -1,101 +0,0 @@ -SUMMARY = "Publishes & browses available services on a link according to the Zeroconf / Bonjour protocol" -DESCRIPTION = "Bonjour, also known as zero-configuration networking, enables automatic discovery of computers, devices, and services on IP networks." -HOMEPAGE = "http://developer.apple.com/networking/bonjour/" -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://../LICENSE;md5=31c50371921e0fb731003bbc665f29bf" - -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-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" - -PARALLEL_MAKE = "" - -S = "${WORKDIR}/mDNSResponder-${PV}/mDNSPosix" - -EXTRA_OEMAKE += "os=linux DEBUG=0 'CC=${CC}' 'LD=${CCLD} ${LDFLAGS}'" - -TARGET_CC_ARCH += "${LDFLAGS}" - -do_install () { - install -d ${D}${sbindir} - install -m 0755 build/prod/mdnsd ${D}${sbindir} - - install -d ${D}${libdir} - cp build/prod/libdns_sd.so ${D}${libdir}/libdns_sd.so.1 - chmod 0644 ${D}${libdir}/libdns_sd.so.1 - ln -s libdns_sd.so.1 ${D}${libdir}/libdns_sd.so - - install -d ${D}${includedir} - install -m 0644 ../mDNSShared/dns_sd.h ${D}${includedir} - - install -d ${D}${mandir}/man8 - install -m 0644 ../mDNSShared/mDNSResponder.8 ${D}${mandir}/man8/mdnsd.8 - - install -d ${D}${bindir} - install -m 0755 ../Clients/build/dns-sd ${D}${bindir} - - install -d ${D}${libdir} - oe_libinstall -C build/prod -so libnss_mdns-0.2 ${D}${libdir} - ln -s libnss_mdns-0.2.so ${D}${libdir}/libnss_mdns.so.2 - - install -d ${D}${sysconfdir} - install -m 0644 nss_mdns.conf ${D}${sysconfdir} - - install -d ${D}${mandir}/man5 - install -m 0644 nss_mdns.conf.5 ${D}${mandir}/man5 - - install -d ${D}${mandir}/man8 - install -m 0644 libnss_mdns.8 ${D}${mandir}/man8 - - install -d ${D}${systemd_unitdir}/system/ - install -m 0644 ${WORKDIR}/mdns.service ${D}${systemd_unitdir}/system/ -} - -pkg_postinst_${PN} () { - sed -e '/^hosts:/s/\s*\<mdns\>//' \ - -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 mdns\3\4\5/' \ - -i $D/etc/nsswitch.conf -} - -pkg_prerm_${PN} () { - sed -e '/^hosts:/s/\s*\<mdns\>//' \ - -e '/^hosts:/s/\s*mdns//' \ - -i $D/etc/nsswitch.conf -} - -inherit systemd - -SYSTEMD_SERVICE_${PN} = "mdns.service" - -FILES_${PN} += "${systemd_unitdir}/system/mdns.service" -FILES_${PN} += "${libdir}/libdns_sd.so.1 \ - ${bindir}/dns-sd \ - ${libdir}/libnss_mdns-0.2.so \ - ${sysconfdir}/nss_mdns.conf" - -FILES_${PN}-dev += "${libdir}/libdns_sd.so \ - ${includedir}/dns_sd.h " - -FILES_${PN}-man += "${mandir}/man8/mdnsd.8 \ - ${mandir}/man5/nss_mdns.conf.5 \ - ${mandir}/man8/libnss_mdns.8" - -PACKAGES = "${PN} ${PN}-dev ${PN}-man ${PN}-dbg" diff --git a/meta-networking/recipes-protocols/net-snmp/files/init b/meta-networking/recipes-protocols/net-snmp/files/init index 47995466fb..47995466fb 100755..100644 --- a/meta-networking/recipes-protocols/net-snmp/files/init +++ b/meta-networking/recipes-protocols/net-snmp/files/init diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-Add-pkg-config-support-for-building-applications-and.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-Add-pkg-config-support-for-building-applications-and.patch deleted file mode 100644 index dd159b9cec..0000000000 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-Add-pkg-config-support-for-building-applications-and.patch +++ /dev/null @@ -1,168 +0,0 @@ -From 4bf83597379523032663c8e95b3786a217c9a849 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 9dbdde1353..ec972636c2 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 9e9e9009e5..e714f91e72 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 cad6b74486..8909bffe05 100755 ---- a/configure -+++ b/configure -@@ -31717,6 +31717,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" -@@ -32740,6 +32742,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 1622b7c051..898b50f368 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -118,6 +118,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 0000000000..3a1c77bbf8 ---- /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 0000000000..0a1f5785a4 ---- /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.26.2 - diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-Android-Fix-the-build.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-Android-Fix-the-build.patch new file mode 100644 index 0000000000..097d9f83cd --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-Android-Fix-the-build.patch @@ -0,0 +1,83 @@ +From b4598662a39ff6974119c900ea56a4d020eac366 Mon Sep 17 00:00:00 2001 +From: Bart Van Assche <bvanassche@acm.org> +Date: Wed, 20 Dec 2023 13:08:06 -0800 +Subject: [PATCH] Android: Fix the build + +Include <sys/select.h> for the fd_set type. In the configure script, +check whether 'unsigned long' is the underlying type of fd_set. Use +u_long instead of ulong. + +Upstream-Status: Backport [https://github.com/net-snmp/net-snmp/commit/b4598662a39ff6974119c900ea56a4d020eac366] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + agent/mibgroup/ip-mib/data_access/ipaddress_linux.c | 4 ++-- + configure | 2 +- + configure.d/config_project_types | 2 +- + include/net-snmp/types.h | 3 +++ + 4 files changed, 7 insertions(+), 4 deletions(-) + +diff --git a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c +index b38beb57dd..232202d0f9 100644 +--- a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c ++++ b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c +@@ -50,7 +50,7 @@ int _load_v6(netsnmp_container *container, int idx_offset); + int + netsnmp_access_ipaddress_extra_prefix_info(int index, + u_long *preferedlt, +- ulong *validlt, ++ u_long *validlt, + char *addr); + #endif + +@@ -523,7 +523,7 @@ out: + + int + netsnmp_access_ipaddress_extra_prefix_info(int index, u_long *preferedlt, +- ulong *validlt, char *addr) ++ u_long *validlt, char *addr) + { + + struct { +diff --git a/configure b/configure +index e7bf859bba..48abcbab11 100755 +--- a/configure ++++ b/configure +@@ -31577,7 +31577,7 @@ CFLAGS="$CFLAGS -Werror" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the type of fd_set::fds_bits" >&5 + printf %s "checking for the type of fd_set::fds_bits... " >&6; } +-for type in __fd_mask __int32_t long\ int unknown; do ++for type in __fd_mask __int32_t long 'unsigned long' unknown; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +diff --git a/configure.d/config_project_types b/configure.d/config_project_types +index a78e8ebb06..ac958d6712 100644 +--- a/configure.d/config_project_types ++++ b/configure.d/config_project_types +@@ -66,7 +66,7 @@ netsnmp_save_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -Werror" + + AC_MSG_CHECKING([for the type of fd_set::fds_bits]) +-for type in __fd_mask __int32_t long\ int unknown; do ++for type in __fd_mask __int32_t long 'unsigned long' unknown; do + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ + #include <sys/select.h> + #include <stddef.h> +diff --git a/include/net-snmp/types.h b/include/net-snmp/types.h +index b78f53ffd7..6228170e5f 100644 +--- a/include/net-snmp/types.h ++++ b/include/net-snmp/types.h +@@ -23,6 +23,9 @@ + #endif + + #include <sys/types.h> ++#ifdef __ANDROID__ ++#include <sys/select.h> ++#endif + + #if defined(WIN32) && !defined(cygwin) + typedef HANDLE netsnmp_pid_t; +-- +2.44.0 + diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-add-knob-whether-nlist.h-are-checked.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-net-snmp-add-knob-whether-nlist.h-are-checked.patch index fb773e6388..ea9dccac28 100644 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-add-knob-whether-nlist.h-are-checked.patch +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-net-snmp-add-knob-whether-nlist.h-are-checked.patch @@ -1,4 +1,4 @@ -From a1134a31d417cc05a1fdb094f613a00a7a5e7ac5 Mon Sep 17 00:00:00 2001 +From 787269b337e70f073e194c3b361eaf4d5f2291ce 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 @@ -6,7 +6,7 @@ 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. -Upstream-status: Pending +Upstream-Status: Pending Signed-off-by: Chong Lu <Chong.Lu@windriver.com> --- @@ -14,25 +14,25 @@ Signed-off-by: Chong Lu <Chong.Lu@windriver.com> 1 file changed, 2 insertions(+) diff --git a/configure.d/config_os_headers b/configure.d/config_os_headers -index 2fdb5a35d6..af997461d5 100644 +index 584064e..c0688f8 100644 --- a/configure.d/config_os_headers +++ b/configure.d/config_os_headers -@@ -32,6 +32,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 [ -@@ -39,6 +40,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 + AC_CHECK_HEADERS([crt_externs.h ] dnl -- -2.26.2 +2.25.1 diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-net-snmp-fix-compile-error-disable-des.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-net-snmp-fix-compile-error-disable-des.patch deleted file mode 100644 index 33a1e745fa..0000000000 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-net-snmp-fix-compile-error-disable-des.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 383e67e359b89abe0440597ce414297892ade511 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 8ad1d70d90..8c6882d9ab 100644 ---- a/snmplib/scapi.c -+++ b/snmplib/scapi.c -@@ -1251,7 +1251,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)); - -@@ -1261,6 +1260,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.26.2 - diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0002-configure-fix-a-cc-check-issue.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0002-configure-fix-a-cc-check-issue.patch deleted file mode 100644 index 4782714d57..0000000000 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp/0002-configure-fix-a-cc-check-issue.patch +++ /dev/null @@ -1,28 +0,0 @@ -From a3631df3d6743113e1cd63579925e15bcce85868 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. - -When has "." in cc value, the expression -$myperl -V:cc | $myperl -n -e 'print if (s/^\s*cc=.([-=\w\s\/]+).;\s*/$1/);' -can't get corretly the cc's value. - -Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com> - ---- - configure.d/config_project_perl_python | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.d/config_project_perl_python b/configure.d/config_project_perl_python -index 475c843..22d2ad3 100644 ---- a/configure.d/config_project_perl_python -+++ b/configure.d/config_project_perl_python -@@ -87,7 +87,7 @@ if test "x$install_perl" != "xno" ; then - if test "x$enable_perl_cc_checks" != "xno" ; then - AC_MSG_CHECKING([for Perl cc]) - changequote(, ) -- PERLCC=`$myperl -V:cc | $myperl -n -e 'print if (s/^\s*cc=.([-=\w\s\/]+).;\s*/$1/);'` -+ PERLCC=`$myperl -V:cc | $myperl -n -e 'print if (s/^\s*cc=.([-=\.\w\s\/]+).;\s*/$1/);'` - changequote([, ]) - if test "x$PERLCC" != "x" ; then - AC_MSG_RESULT([$PERLCC]) diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/fix-libtool-finish.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0002-net-snmp-fix-libtool-finish.patch index fc3ac2a4ba..e951537b04 100644 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp/fix-libtool-finish.patch +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/0002-net-snmp-fix-libtool-finish.patch @@ -1,4 +1,4 @@ -From 0becb4843a40910d5ec9aa11969d4905a22037cf Mon Sep 17 00:00:00 2001 +From 5f002c3cc46ecf4d4a29571309f2cc0d3d34330f 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" @@ -14,17 +14,16 @@ rpm-postinst for each recipe while do_package, in package.bbclass. Upstream-Status: Inappropriate [cross compile specific] Signed-off-by: Roy.Li <rongqing.li@windriver.com> - --- Makefile.top | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.top b/Makefile.top -index 5d4f9bc..d0ed31c 100644 +index d1b3923..53e0392 100644 --- a/Makefile.top +++ b/Makefile.top -@@ -89,7 +89,7 @@ LIBREVISION = 0 - LIB_LD_CMD = $(LIBTOOL) --mode=link $(LINKCC) $(CFLAGS) -rpath $(libdir) -version-info $(LIBCURRENT):$(LIBREVISION):$(LIBAGE) -o +@@ -89,7 +89,7 @@ LIBREVISION = 1 + LIB_LD_CMD = $(LIBTOOL) --mode=link $(LINKCC) $(CFLAGS) -rpath $(libdir) -version-info $(LIBCURRENT):$(LIBREVISION):$(LIBAGE) @LD_NO_UNDEFINED@ -o LIB_EXTENSION = la LIB_VERSION = -LIB_LDCONFIG_CMD = $(LIBTOOL) --mode=finish $(INSTALL_PREFIX)$(libdir) @@ -32,3 +31,6 @@ index 5d4f9bc..d0ed31c 100644 LINK = $(LIBTOOL) --mode=link $(LINKCC) # RANLIB = @RANLIB@ RANLIB = : +-- +2.25.1 + diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-testing-add-the-output-format-for-ptest.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0003-testing-add-the-output-format-for-ptest.patch index 7cbaf0bc50..ab54492934 100644 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-testing-add-the-output-format-for-ptest.patch +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/0003-testing-add-the-output-format-for-ptest.patch @@ -1,4 +1,4 @@ -From 827fe3b0253aab33472828f40ad05934cc0261b8 Mon Sep 17 00:00:00 2001 +From 2a1a2b58af09c6c03026474f1fd0db7d36e977c7 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 @@ -6,7 +6,6 @@ Subject: [PATCH] testing: add the output format for ptest Upstream-Status: Inappropriate [OE specific] Signed-off-by: Jackie Huang <jackie.huang@windriver.com> - --- testing/RUNTESTS | 4 ++++ 1 file changed, 4 insertions(+) @@ -33,3 +32,6 @@ index 6715831..a2b6fb8 100755 done if [ -f failed_tests ]; then +-- +2.25.1 + diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-config_os_headers-Error-Fix.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0004-config_os_headers-Error-Fix.patch index 5ad7470c90..e2269bc3e8 100644 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-config_os_headers-Error-Fix.patch +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/0004-config_os_headers-Error-Fix.patch @@ -1,4 +1,4 @@ -From 2ad4df6d503be72a8910c3087611adb33d77ffde Mon Sep 17 00:00:00 2001 +From b1c941c20577578aa5ff3450d9d8d7a23c55d14a 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 @@ -10,7 +10,7 @@ conftest.c:168:17: fatal error: pkg.h: No such file or directory #include <pkg.h> ^ -Upstream-Status: pending +Upstream-Status: Pending Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com> --- @@ -18,10 +18,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 2fdb5a35d6..0272f02c8e 100644 +index c0688f8..f68713c 100644 --- a/configure.d/config_os_headers +++ b/configure.d/config_os_headers -@@ -487,8 +487,8 @@ then +@@ -395,8 +395,8 @@ then unset ac_cv_header_pkg_h netsnmp_save_CPPFLAGS="$CPPFLAGS" netsnmp_save_LDFLAGS="$LDFLAGS" @@ -33,5 +33,5 @@ index 2fdb5a35d6..0272f02c8e 100644 NETSNMP_SEARCH_LIBS(pkg_init, pkg, AC_DEFINE(HAVE_LIBPKG, 1, [define if you have BSD pkg-ng]))) -- -2.26.2 +2.25.1 diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-snmplib-keytools.c-Don-t-check-for-return-from-EVP_M.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0005-snmplib-keytools.c-Don-t-check-for-return-from-EVP_M.patch index 778b40188b..7a6b35460e 100644 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-snmplib-keytools.c-Don-t-check-for-return-from-EVP_M.patch +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/0005-snmplib-keytools.c-Don-t-check-for-return-from-EVP_M.patch @@ -1,31 +1,37 @@ -From 89538a973119f1bf976b3a6df157ea940cf32eb5 Mon Sep 17 00:00:00 2001 +From c790411f9aa82064fea9bbf23b499fb6b7f22c4f 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 - EVP_MD_CTX_init() 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> +Upstream-Status: Pending +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 388e655..5a66898 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; +-- +2.25.1 + diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-get_pid_from_inode-Include-limit.h.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0006-get_pid_from_inode-Include-limit.h.patch index bf133b3e37..6a0161ae27 100644 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-get_pid_from_inode-Include-limit.h.patch +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/0006-get_pid_from_inode-Include-limit.h.patch @@ -1,4 +1,4 @@ -From 98c6edba4835b515d933542411d80879327eee16 Mon Sep 17 00:00:00 2001 +From 95868615a04b4a6f0dd5997c9726422828426116 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 @@ -8,13 +8,12 @@ PATH_MAX and NAME_MAX are required by this file Upstream-Status: Pending Signed-off-by: Khem Raj <raj.khem@gmail.com> - --- agent/mibgroup/util_funcs/get_pid_from_inode.c | 1 + 1 file changed, 1 insertion(+) diff --git a/agent/mibgroup/util_funcs/get_pid_from_inode.c b/agent/mibgroup/util_funcs/get_pid_from_inode.c -index aee907d..7abaec2 100644 +index 5788e1d..ea380a6 100644 --- a/agent/mibgroup/util_funcs/get_pid_from_inode.c +++ b/agent/mibgroup/util_funcs/get_pid_from_inode.c @@ -6,6 +6,7 @@ @@ -23,5 +22,8 @@ index aee907d..7abaec2 100644 #include <ctype.h> +#include <limits.h> #include <stdio.h> - #if HAVE_STDLIB_H + #ifdef HAVE_STDLIB_H #include <stdlib.h> +-- +2.25.1 + diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0004-configure-fix-incorrect-variable.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0007-configure-fix-incorrect-variable.patch index a3d84b291b..5d394eec14 100644 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp/0004-configure-fix-incorrect-variable.patch +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/0007-configure-fix-incorrect-variable.patch @@ -1,20 +1,19 @@ -From f3c5cd4df7ce8e5639c99b7b918e41fb89e969e3 Mon Sep 17 00:00:00 2001 +From 385fa343cf178ccfe2c9a9fd7795d0db3c959fdd 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. Upstream-Status: Inappropriate [cross compile specific] Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com> - --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in -index 9dbdde1..5fdc760 100644 +index 1c1182e..f947b8c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -173,7 +173,7 @@ OTHERCLEANTODOS=perlclean @PYTHONCLEANTARGS@ cleanfeatures perlcleanfeatures pyt @@ -26,3 +25,6 @@ index 9dbdde1..5fdc760 100644 if test $$? != 0 ; then \ exit 1 ; \ fi +-- +2.25.1 + diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0008-net-snmp-fix-engineBoots-value-on-SIGHUP.patch index 5cbb60d8e5..a57c4c8f14 100644 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/0008-net-snmp-fix-engineBoots-value-on-SIGHUP.patch @@ -1,35 +1,35 @@ -From d619cd9fc01f336ff0ff55b18f9112789eb4d84c Mon Sep 17 00:00:00 2001 -From: Marian Florea <marian.florea@windriver.com> -Date: Thu, 20 Jul 2017 16:55:24 +0800 +From b5cbe0953a7e7a3c77c7ec69dfe81254475f08c0 Mon Sep 17 00:00:00 2001 +From: Zheng Ruoqin <zhengrq.fnst@fujitsu.com> +Date: Wed, 9 Jun 2021 15:47:30 +0900 Subject: [PATCH] net snmp: fix engineBoots value on SIGHUP Upstream-Status: Pending Signed-off-by: Marian Florea <marian.florea@windriver.com> Signed-off-by: Li Zhou <li.zhou@windriver.com> - +Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> --- agent/snmpd.c | 1 + snmplib/snmpv3.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/agent/snmpd.c b/agent/snmpd.c -index 6566354..eb0d4b4 100644 +index fe31c87..d9f68dd 100644 --- a/agent/snmpd.c +++ b/agent/snmpd.c -@@ -1239,6 +1239,7 @@ receive(void) - snmp_log(LOG_INFO, "NET-SNMP version %s restarted\n", - netsnmp_get_version()); - update_config(); -+ snmp_store(app_name); - send_easy_trap(SNMP_TRAP_ENTERPRISESPECIFIC, 3); - #if HAVE_SIGHOLD - sigrelse(SIGHUP); +@@ -1169,6 +1169,7 @@ snmpd_reconfig(void) + snmp_log(LOG_INFO, "NET-SNMP version %s restarted\n", + netsnmp_get_version()); + update_config(); ++ snmp_store(app_name); + send_easy_trap(SNMP_TRAP_ENTERPRISESPECIFIC, 3); + #ifdef HAVE_SIGPROCMASK + ret = sigprocmask(SIG_UNBLOCK, &set, NULL); diff --git a/snmplib/snmpv3.c b/snmplib/snmpv3.c -index 771ba3b..5de05e7 100644 +index be9256f..d17d2e3 100644 --- a/snmplib/snmpv3.c +++ b/snmplib/snmpv3.c -@@ -1060,9 +1060,9 @@ init_snmpv3_post_config(int majorid, int minorid, void *serverarg, +@@ -1071,9 +1071,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 */ @@ -41,3 +41,6 @@ index 771ba3b..5de05e7 100644 engineBoots = 1; } +-- +2.25.1 + diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-fix-for-disable-des.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0009-net-snmp-fix-for-disable-des.patch index 4cd8fd1e46..36a676fb02 100644 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-fix-for-disable-des.patch +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/0009-net-snmp-fix-for-disable-des.patch @@ -1,4 +1,4 @@ -From 068952c0e0cdda5a91250b91c5fcc9b85b43daab Mon Sep 17 00:00:00 2001 +From aa1f157c675da248ed186e020d17cb2528d0be12 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 @@ -9,16 +9,15 @@ the --disable-des works correctly. Upstream-Status: Submitted [net-snmp-coders@lists.sourceforge.net] Signed-off-by: Jackie Huang <jackie.huang@windriver.com> - --- snmplib/scapi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/snmplib/scapi.c b/snmplib/scapi.c -index 8ad1d70..43caddf 100644 +index ac77004..7545bfa 100644 --- a/snmplib/scapi.c +++ b/snmplib/scapi.c -@@ -84,7 +84,9 @@ netsnmp_feature_child_of(usm_scapi, usm_support) +@@ -86,7 +86,9 @@ netsnmp_feature_child_of(usm_scapi, usm_support); #include <openssl/hmac.h> #include <openssl/evp.h> #include <openssl/rand.h> @@ -28,3 +27,6 @@ index 8ad1d70..43caddf 100644 #ifdef HAVE_AES #include <openssl/aes.h> #endif +-- +2.25.1 + diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0010-net-snmp-Reproducibility-Don-t-check-build-host-for.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0010-net-snmp-Reproducibility-Don-t-check-build-host-for.patch new file mode 100644 index 0000000000..246ce2b8d9 --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/0010-net-snmp-Reproducibility-Don-t-check-build-host-for.patch @@ -0,0 +1,34 @@ +From a96140995d10660046146d9fa75faa5f7faabab0 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. + +Upstream-Status: Pending +--- + 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 4c445d6..099257f 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 +-if test -r /etc/printcap; then ++AC_CHECK_FILE([/etc/printcap], + AC_DEFINE(HAVE_PRINTCAP, 1, [Set if /etc/printcap exists]) +-fi ++) + + + # Check ps args +-- +2.25.1 + diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0011-ac_add_search_path.m4-keep-consistent-between-32bit-.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0011-ac_add_search_path.m4-keep-consistent-between-32bit-.patch new file mode 100644 index 0000000000..1e845c4e63 --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/0011-ac_add_search_path.m4-keep-consistent-between-32bit-.patch @@ -0,0 +1,40 @@ +From 85a6c5017a2cd18a5a66afcb3f6a02276c101ad0 Mon Sep 17 00:00:00 2001 +From: Mingli Yu <mingli.yu@windriver.com> +Date: Fri, 29 Jan 2021 08:49:15 +0000 +Subject: [PATCH] ac_add_search_path.m4: keep consistent between 32bit and + 64bit + +With configure option "--with-openssl=${STAGING_EXECPREFIXDIR}", it behaves +differently between 32bit and 64bit system as the openssl lib resides under +/build/tmp/work/corei7-64-wrs-linux/net-snmp/5.9-r0/recipe-sysroot/usr/lib64 +for 64bit system, but resides under [1] for 32bit system. + +So add the patch to fix the gap between 32bit and 64bit system. + +[1] /build/tmp/work/corei7-64-wrs-linux/net-snmp/5.9-r0/recipe-sysroot/usr/lib + +Upstream-Status: Inappropriate [configuration specific] + +Signed-off-by: Mingli Yu <mingli.yu@windriver.com> +--- + m4/ac_add_search_path.m4 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/m4/ac_add_search_path.m4 b/m4/ac_add_search_path.m4 +index 8e0a819..e9585bc 100644 +--- a/m4/ac_add_search_path.m4 ++++ b/m4/ac_add_search_path.m4 +@@ -3,8 +3,8 @@ dnl Add a search path to the LIBS and CPPFLAGS variables + dnl + AC_DEFUN([AC_ADD_SEARCH_PATH],[ + if test "x$1" != x -a -d $1; then +- if test -d $1/lib; then +- LDFLAGS="-L$1/lib $LDFLAGS" ++ if test -d $1/${libdir:5}; then ++ LDFLAGS="-L$1/${libdir:5} $LDFLAGS" + fi + if test -d $1/include; then + CPPFLAGS="-I$1/include $CPPFLAGS" +-- +2.25.1 + diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0012-Fix-configuration-of-NETSNMP_FD_MASK_TYPE.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0012-Fix-configuration-of-NETSNMP_FD_MASK_TYPE.patch new file mode 100644 index 0000000000..9d4b769930 --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/0012-Fix-configuration-of-NETSNMP_FD_MASK_TYPE.patch @@ -0,0 +1,43 @@ +From 21ea0b9ce5cc9445f7ffd7a9020b816681e16284 Mon Sep 17 00:00:00 2001 +From: Adam Gajda <adgajda@users.noreply.github.com> +Date: Mon, 2 Oct 2023 16:40:31 +0200 +Subject: [PATCH] Fix configuration of NETSNMP_FD_MASK_TYPE + +Upstream-Status: Backport +[https://github.com/net-snmp/net-snmp/commit/af1b7f77975bbb2fcbdb3f005f8cb010d1d33cd3] + +Signed-off-by: Yi Zhao <yi.zhao@windriver.com> +--- + configure | 2 +- + configure.d/config_project_types | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index 907d441..f4468c6 100755 +--- a/configure ++++ b/configure +@@ -31638,7 +31638,7 @@ CFLAGS="$CFLAGS -Werror" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the type of fd_set::fds_bits" >&5 + printf %s "checking for the type of fd_set::fds_bits... " >&6; } +-for type in __fd_mask __int32_t unknown; do ++for type in __fd_mask __int32_t long\ int unknown; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +diff --git a/configure.d/config_project_types b/configure.d/config_project_types +index 1b4c66b..a78e8eb 100644 +--- a/configure.d/config_project_types ++++ b/configure.d/config_project_types +@@ -66,7 +66,7 @@ netsnmp_save_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -Werror" + + AC_MSG_CHECKING([for the type of fd_set::fds_bits]) +-for type in __fd_mask __int32_t unknown; do ++for type in __fd_mask __int32_t long\ int unknown; do + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ + #include <sys/select.h> + #include <stddef.h> +-- +2.25.1 + diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/CVE-2019-20892.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/CVE-2019-20892.patch deleted file mode 100644 index ec1b6de8fc..0000000000 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp/CVE-2019-20892.patch +++ /dev/null @@ -1,120 +0,0 @@ -From 5f881d3bf24599b90d67a45cae7a3eb099cd71c9 Mon Sep 17 00:00:00 2001 -From: Bart Van Assche <bvanassche@acm.org> -Date: Sat, 27 Jul 2019 19:34:09 -0700 -Subject: [PATCH] libsnmp, USM: Introduce a reference count in struct - usmStateReference - -This patch fixes https://sourceforge.net/p/net-snmp/bugs/2956/. - -Upstream-Status: Backport -[ak: fixup for 5.8 context, changes to library/snmpusm.h] - -CVE: CVE-2019-20892 - -Signed-off-by: Armin Kuster <akuster@mvista.com> -Signed-off-by: Mingde (Matthew) Zeng <matthew.zeng@windriver.com> - ---- - snmplib/snmp_client.c | 22 +++---------- - snmplib/snmpusm.c | 73 ++++++++++++++++++++++++++++--------------- - 2 files changed, 53 insertions(+), 42 deletions(-) - -Index: net-snmp-5.8/snmplib/snmpusm.c -=================================================================== ---- net-snmp-5.8.orig/snmplib/snmpusm.c -+++ net-snmp-5.8/snmplib/snmpusm.c -@@ -285,12 +285,35 @@ free_enginetime_on_shutdown(int majorid, - struct usmStateReference * - usm_malloc_usmStateReference(void) - { -- struct usmStateReference *retval = (struct usmStateReference *) -- calloc(1, sizeof(struct usmStateReference)); -+ struct usmStateReference *retval; - -+ retval = calloc(1, sizeof(struct usmStateReference)); -+ if (retval) -+ retval->refcnt = 1; - return retval; - } /* end usm_malloc_usmStateReference() */ - -+static int -+usm_clone(netsnmp_pdu *pdu, netsnmp_pdu *new_pdu) -+{ -+ struct usmStateReference *ref = pdu->securityStateRef; -+ struct usmStateReference **new_ref = -+ (struct usmStateReference **)&new_pdu->securityStateRef; -+ int ret = 0; -+ -+ if (!ref) -+ return ret; -+ -+ if (pdu->command == SNMP_MSG_TRAP2) { -+ netsnmp_assert(pdu->securityModel == SNMP_DEFAULT_SECMODEL); -+ ret = usm_clone_usmStateReference(ref, new_ref); -+ } else { -+ netsnmp_assert(ref == *new_ref); -+ ref->refcnt++; -+ } -+ -+ return ret; -+} - - void - usm_free_usmStateReference(void *old) -@@ -3345,6 +3368,7 @@ init_usm(void) - def->encode_reverse = usm_secmod_rgenerate_out_msg; - def->encode_forward = usm_secmod_generate_out_msg; - def->decode = usm_secmod_process_in_msg; -+ def->pdu_clone = usm_clone; - def->pdu_free_state_ref = usm_free_usmStateReference; - def->session_setup = usm_session_init; - def->handle_report = usm_handle_report; -Index: net-snmp-5.8/snmplib/snmp_client.c -=================================================================== ---- net-snmp-5.8.orig/snmplib/snmp_client.c -+++ net-snmp-5.8/snmplib/snmp_client.c -@@ -402,27 +402,15 @@ _clone_pdu_header(netsnmp_pdu *pdu) - return NULL; - } - -- if (pdu->securityStateRef && -- pdu->command == SNMP_MSG_TRAP2) { -- -- ret = usm_clone_usmStateReference((struct usmStateReference *) pdu->securityStateRef, -- (struct usmStateReference **) &newpdu->securityStateRef ); -- -- if (ret) -- { -+ sptr = find_sec_mod(newpdu->securityModel); -+ if (sptr && sptr->pdu_clone) { -+ /* call security model if it needs to know about this */ -+ ret = sptr->pdu_clone(pdu, newpdu); -+ if (ret) { - snmp_free_pdu(newpdu); - return NULL; - } - } -- -- if ((sptr = find_sec_mod(newpdu->securityModel)) != NULL && -- sptr->pdu_clone != NULL) { -- /* -- * call security model if it needs to know about this -- */ -- (*sptr->pdu_clone) (pdu, newpdu); -- } -- - return newpdu; - } - -Index: net-snmp-5.8/include/net-snmp/library/snmpusm.h -=================================================================== ---- net-snmp-5.8.orig/include/net-snmp/library/snmpusm.h -+++ net-snmp-5.8/include/net-snmp/library/snmpusm.h -@@ -43,6 +43,7 @@ extern "C" { - * Structures. - */ - struct usmStateReference { -+ int refcnt; - char *usr_name; - size_t usr_name_length; - u_char *usr_engine_id; diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/reproducibility-accept-configure-options-from-env.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/reproducibility-accept-configure-options-from-env.patch deleted file mode 100644 index b0dbf5ad36..0000000000 --- a/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-networking/recipes-protocols/net-snmp/net-snmp/reproducibility-have-printcap.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/reproducibility-have-printcap.patch deleted file mode 100644 index 4316c7a713..0000000000 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp/reproducibility-have-printcap.patch +++ /dev/null @@ -1,19 +0,0 @@ -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 @@ - [Path to the lpstat command]) - AC_DEFINE(HAVE_LPSTAT, 1, [Set if the lpstat command is available]) - fi --if test -r /etc/printcap; then -+AC_CHECK_FILE([/etc/printcap], - AC_DEFINE(HAVE_PRINTCAP, 1, [Set if /etc/printcap exists]) --fi -+) - - - # Check ps args diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/run-ptest b/meta-networking/recipes-protocols/net-snmp/net-snmp/run-ptest index 76514c202e..76514c202e 100755..100644 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp/run-ptest +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/run-ptest diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/systemd-support.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/systemd-support.patch deleted file mode 100644 index c6af8c0f33..0000000000 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp/systemd-support.patch +++ /dev/null @@ -1,1652 +0,0 @@ -From 0cad0c6c36af2a2d589563804c9ed2b37b7085fb Mon Sep 17 00:00:00 2001 -From: Li xin <lixin.fnst@cn.fujitsu.com> -Date: Fri, 21 Aug 2015 14:37:02 +0900 -Subject: [PATCH] ystemd support backported from the master branch as of - 23/04/2012 (post 5.7.1, pre 5.8). - -The following commits have been cherry-picked: - -19499c3c90bf9d7b2b9e5d08baa26cc6bba28a11 -fef6cddfdb94da1a6b1fb768af62918b80f11fd3 -0641e43c694c485cbbffef0556efc4641bd3ff50 -76530a89f1c8bbd0b63acce63e10d5d4812a1a16 (conflict resolved) -bf108d7f1354f6276fc43c129963f2c49b9fc242 -3692875172352f72cf3afd0d35f355e83d7e421b -74412748067c685e1d8ab6ed3bcc3ca9c2774844 -86132e3f1e6ef7b4e0b96d8fa24e37c81b71b0e0 -63557cf8986a33dba1d4429b583a901361052c4f - -Upstream-Status: Backport - -Signed-off-by: Thomas Fitzsimmons <fitzsim@cisco.com> ---- - README.systemd | 41 +++ - agent/snmpd.c | 33 +- - apps/snmptrapd.c | 32 +- - configure.d/config_modules_lib | 8 + - configure.d/config_project_with_enable | 9 + - dist/snmpd.servic | 18 + - dist/snmpd.socket | 17 + - dist/snmptrapd.service | 16 + - dist/snmptrapd.socket | 14 + - include/net-snmp/library/sd-daemon.h | 290 ++++++++++++++++ - snmplib/sd-daemon.c | 532 +++++++++++++++++++++++++++++ - snmplib/transports/snmpTCPDomain.c | 43 ++- - snmplib/transports/snmpTCPIPv6Domain.c | 46 ++- - snmplib/transports/snmpUDPIPv4BaseDomain.c | 33 +- - snmplib/transports/snmpUDPIPv6Domain.c | 34 +- - snmplib/transports/snmpUnixDomain.c | 66 ++-- - win32/libsnmp/Makefile.in | 6 + - win32/net-snmp/net-snmp-config.h | 2 + - win32/net-snmp/net-snmp-config.h.in | 2 + - 19 files changed, 1176 insertions(+), 66 deletions(-) - create mode 100644 README.systemd - create mode 100644 dist/snmpd.servic - create mode 100644 dist/snmpd.socket - create mode 100644 dist/snmptrapd.service - create mode 100644 dist/snmptrapd.socket - create mode 100644 include/net-snmp/library/sd-daemon.h - create mode 100644 snmplib/sd-daemon.c - -diff --git a/README.systemd b/README.systemd -new file mode 100644 -index 0000000..dba15d1 ---- /dev/null -+++ b/README.systemd -@@ -0,0 +1,41 @@ -+README.systemd -+-------------- -+Net-SNMP provides two daemons, which support systemd system manager. -+See http://www.freedesktop.org/wiki/Software/systemd to learn how -+systemd works. Both socket activation and notification is supported by these -+daemons. -+ -+To enable systemd support, the sources must be compiled with -+--with-systemd configure option. -+ -+snmpd - The SNMP agent -+---------------------- -+Socket activation od snmpd daemon is implemented, but it's discouraged. -+The reason is simple - snmpd not only listens and processes SNMP requests -+from network, but also gathers system statistics counters, sends traps and -+communicates with subagents. It even opens few netlink sockets. -+ -+In other words, snmpd should run from system start to properly work. -+This can be done in two ways: -+1) either as snmpd service unit with 'Type=notification' and without a socket -+ unit -+2) or as snmpd service unit with 'Type=simple', appropriate socket socket unit -+ and the snmpd service enabled. This way systemd creates the snmpd listening -+ socket early during boot and passes the sockets to snmpd slightly later -+ (but still during machine boot). This way systemd can paralelize start of -+ services, which depend on snmpd. Admins must adjust the socket file manually, -+ depending if the snmpd support AgentX, IPv6, SMUX etc. -+ -+snmpd should be started with '-f' command line parameter to disable forking - -+systemd does that for us automatically. -+ -+ -+snmptrapd - The trap processing daemon -+-------------------------------------- -+snmptrapd supports full socket activation and also notification (if needed). -+Both 'Type=simple' (with appropriate socket unit) and 'Type=notify' services -+will work. Again, '-f' parameter should be provided on snmptrapd command line. -+ -+If integration with SNMP agent using AgentX protocol is enabled, snmptrapd should -+start during boot and not after first SNMP trap arrives. Same rules as for snmpd -+applies then. -diff --git a/agent/snmpd.c b/agent/snmpd.c -index cfc7bce..116ee5c 100644 ---- a/agent/snmpd.c -+++ b/agent/snmpd.c -@@ -164,6 +164,10 @@ typedef long fd_mask; - - #endif - -+#ifndef NETSNMP_NO_SYSTEMD -+#include <net-snmp/library/sd-daemon.h> -+#endif -+ - netsnmp_feature_want(logging_file) - netsnmp_feature_want(logging_stdio) - netsnmp_feature_want(logging_syslog) -@@ -443,19 +447,29 @@ main(int argc, char *argv[]) - int agent_mode = -1; - char *pid_file = NULL; - char option_compatability[] = "-Le"; -+#ifndef WIN32 -+ int prepared_sockets = 0; -+#endif - #if HAVE_GETPID - int fd; - FILE *PID; - #endif - - #ifndef WIN32 -+#ifndef NETSNMP_NO_SYSTEMD -+ /* check if systemd has sockets for us and don't close them */ -+ prepared_sockets = netsnmp_sd_listen_fds(0); -+#endif /* NETSNMP_NO_SYSTEMD */ -+ - /* - * close all non-standard file descriptors we may have - * inherited from the shell. - */ -- for (i = getdtablesize() - 1; i > 2; --i) { -- (void) close(i); -- } -+ if (!prepared_sockets) { -+ for (i = getdtablesize() - 1; i > 2; --i) { -+ (void) close(i); -+ } -+} - #endif /* #WIN32 */ - - /* -@@ -1107,6 +1121,19 @@ main(int argc, char *argv[]) - netsnmp_addrcache_initialise(); - - /* -+ * Let systemd know we're up. -+ */ -+#ifndef NETSNMP_NO_SYSTEMD -+ netsnmp_sd_notify(1, "READY=1\n"); -+ if (prepared_sockets) -+ /* -+ * Clear the environment variable, we already processed all the sockets -+ * by now. -+ */ -+ netsnmp_sd_listen_fds(1); -+#endif -+ -+ /* - * Forever monitor the dest_port for incoming PDUs. - */ - DEBUGMSGTL(("snmpd/main", "We're up. Starting to process data.\n")); -diff --git a/apps/snmptrapd.c b/apps/snmptrapd.c -index bce0d47..c6a74ec 100644 ---- a/apps/snmptrapd.c -+++ b/apps/snmptrapd.c -@@ -125,6 +125,10 @@ SOFTWARE. - - #include <net-snmp/net-snmp-features.h> - -+#ifndef NETSNMP_NO_SYSTEMD -+#include <net-snmp/library/sd-daemon.h> -+#endif -+ - #ifndef BSD4_3 - #define BSD4_2 - #endif -@@ -657,16 +661,25 @@ main(int argc, char *argv[]) - int agentx_subagent = 1; - #endif - netsnmp_trapd_handler *traph; -+#ifndef WIN32 -+ int prepared_sockets = 0; -+#endif - - - #ifndef WIN32 -+#ifndef NETSNMP_NO_SYSTEMD -+ /* check if systemd has sockets for us and don't close them */ -+ prepared_sockets = netsnmp_sd_listen_fds(0); -+#endif - /* - * close all non-standard file descriptors we may have - * inherited from the shell. - */ -- for (i = getdtablesize() - 1; i > 2; --i) { -- (void) close(i); -- } -+ if (!prepared_sockets) { -+ for (i = getdtablesize() - 1; i > 2; --i) { -+ (void) close(i); -+ } -+} - #endif /* #WIN32 */ - - #ifdef SIGTERM -@@ -1318,6 +1331,19 @@ main(int argc, char *argv[]) - #endif - #endif - -+ /* -+ * Let systemd know we're up. -+ */ -+#ifndef NETSNMP_NO_SYSTEMD -+ netsnmp_sd_notify(1, "READY=1\n"); -+ if (prepared_sockets) -+ /* -+ * Clear the environment variable, we already processed all the sockets -+ * by now. -+ */ -+ netsnmp_sd_listen_fds(1); -+#endif -+ - #ifdef WIN32SERVICE - trapd_status = SNMPTRAPD_RUNNING; - #endif -diff --git a/configure.d/config_modules_lib b/configure.d/config_modules_lib -index 362ba0a..bb69daa 100644 ---- a/configure.d/config_modules_lib -+++ b/configure.d/config_modules_lib -@@ -53,6 +53,14 @@ if test "x$PARTIALTARGETOS" = "xmingw32" -o "x$PARTIALTARGETOS" = "xmingw32msvc" - other_ftobjs_list="$other_ftobjs_list winpipe.ft" - fi - -+# Linux systemd -+if test "x$with_systemd" == "xyes"; then -+ other_src_list="$other_src_list sd-daemon.c" -+ other_objs_list="$other_objs_list sd-daemon.o" -+ other_lobjs_list="$other_lobjs_list sd-daemon.lo" -+ other_ftobjs_list="$other_ftobjs_list sd-daemon.ft" -+fi -+ - AC_SUBST(other_src_list) - AC_SUBST(other_objs_list) - AC_SUBST(other_lobjs_list) -diff --git a/configure.d/config_project_with_enable b/configure.d/config_project_with_enable -index 61ba026..d782d12 100644 ---- a/configure.d/config_project_with_enable -+++ b/configure.d/config_project_with_enable -@@ -690,6 +690,15 @@ if test "x$with_dummy_values" != "xyes"; then - data for]) - fi - -+NETSNMP_ARG_WITH(systemd, -+[ --with-systemd Provide systemd support. See README.systemd -+ for details.]) -+# Define unless specifically suppressed (i.e., option defaults to false). -+if test "x$with_systemd" != "xyes"; then -+ AC_DEFINE(NETSNMP_NO_SYSTEMD, 1, -+ [If you don't want to integrate with systemd.]) -+fi -+ - NETSNMP_ARG_ENABLE(set-support, - [ --disable-set-support Do not allow SNMP set requests.]) - if test "x$enable_set_support" = "xno"; then -diff --git a/dist/snmpd.servic b/dist/snmpd.servic -new file mode 100644 -index 0000000..31391e5 ---- /dev/null -+++ b/dist/snmpd.servic -@@ -0,0 +1,18 @@ -+# -+# SNMP agent service file for systemd -+# -+# -+# The service should be enabled, i.e. snmpd should start during machine boot. -+# Socket activation shall not be used. See README.systemd for details. -+ -+[Unit] -+Description=Simple Network Management Protocol (SNMP) daemon. -+After=syslog.target network.target -+ -+[Service] -+# Type=notify is also supported. It should be set when snmpd.socket is not used. -+Type=simple -+ExecStart=/usr/sbin/snmpd -f -+ -+[Install] -+WantedBy=multi-user.target -diff --git a/dist/snmpd.socket b/dist/snmpd.socket -new file mode 100644 -index 0000000..7f3a2d9 ---- /dev/null -+++ b/dist/snmpd.socket -@@ -0,0 +1,17 @@ -+[Unit] -+Description=Socket listening for SNMP and AgentX messages -+ -+[Socket] -+ListenDatagram=0.0.0.0:161 -+# Uncomment other listening addresses as needed - TCP, UDP6, TCP6. -+# It must match listening addresses/ports defined in snmpd.service -+# or snmpd.conf. -+# ListenStream=0.0.0.0:161 -+# ListenDatagram=[::]:161 -+# ListenStream=[::]:161 -+# -+# Uncomment AgentX socket if snmpd.conf enables AgentX protocol. -+# ListenStream=/var/agentx/master -+ -+[Install] -+WantedBy=sockets.target -diff --git a/dist/snmptrapd.service b/dist/snmptrapd.service -new file mode 100644 -index 0000000..e88a5b4 ---- /dev/null -+++ b/dist/snmptrapd.service -@@ -0,0 +1,16 @@ -+# -+# SNMP trap-processing service file for systemd -+# -+ -+[Unit] -+Description=Simple Network Management Protocol (SNMP) Trap daemon. -+After=syslog.target network.target -+ -+[Service] -+# Type=notify is also supported. It should be set when snmptrapd.socket is not -+# used. -+Type=simple -+ExecStart=/usr/sbin/snmptrapd -f -+ -+[Install] -+WantedBy=multi-user.target -diff --git a/dist/snmptrapd.socket b/dist/snmptrapd.socket -new file mode 100644 -index 0000000..2d24fb8 ---- /dev/null -+++ b/dist/snmptrapd.socket -@@ -0,0 +1,14 @@ -++[Unit] -++Description=Socket listening for SNMP trap messages -++ -++[Socket] -++ListenDatagram=0.0.0.0:162 -++# Uncomment other listening addresses as needed - TCP, UDP6, TCP6. -++# It must match listening addresses/ports defined in snmptrapd.service -++# or snmptrapd.conf. -++# ListenStream=0.0.0.0:162 -++# ListenDatagram=[::]:162 -++# ListenStream=[::]:162 -++ -++[Install] -++WantedBy=sockets.target -diff --git a/include/net-snmp/library/sd-daemon.h b/include/net-snmp/library/sd-daemon.h -new file mode 100644 -index 0000000..85274c9 ---- /dev/null -+++ b/include/net-snmp/library/sd-daemon.h -@@ -0,0 +1,290 @@ -+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ -+ -+#ifndef SNMPD_SD_DAEMON_H -+#define SNMPD_SD_DAEMON_H -+ -+/*** -+ Copyright 2010 Lennart Poettering -+ -+ Permission is hereby granted, free of charge, to any person -+ obtaining a copy of this software and associated documentation files -+ (the "Software"), to deal in the Software without restriction, -+ including without limitation the rights to use, copy, modify, merge, -+ publish, distribute, sublicense, and/or sell copies of the Software, -+ and to permit persons to whom the Software is furnished to do so, -+ subject to the following conditions: -+ -+ The above copyright notice and this permission notice shall be -+ included in all copies or substantial portions of the Software. -+ -+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -+ SOFTWARE. -+***/ -+ -+#ifdef HAVE_SYS_TYPES_H -+#include <sys/types.h> -+#endif -+#ifdef HAVE_INTTYPES_H -+#include <inttypes.h> -+#endif -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+/* -+ Reference implementation of a few systemd related interfaces for -+ writing daemons. These interfaces are trivial to implement. To -+ simplify porting we provide this reference implementation. -+ Applications are welcome to reimplement the algorithms described -+ here if they do not want to include these two source files. -+ -+ The following functionality is provided: -+ -+ - Support for logging with log levels on stderr -+ - File descriptor passing for socket-based activation -+ - Daemon startup and status notification -+ - Detection of systemd boots -+ -+ You may compile this with -DDISABLE_SYSTEMD to disable systemd -+ support. This makes all those calls NOPs that are directly related to -+ systemd (i.e. only sd_is_xxx() will stay useful). -+ -+ Since this is drop-in code we don't want any of our symbols to be -+ exported in any case. Hence we declare hidden visibility for all of -+ them. -+ -+ You may find an up-to-date version of these source files online: -+ -+ http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.h -+ http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.c -+ -+ This should compile on non-Linux systems, too, but with the -+ exception of the sd_is_xxx() calls all functions will become NOPs. -+ -+ See sd-daemon(7) for more information. -+*/ -+ -+#ifndef _sd_printf_attr_ -+#if __GNUC__ >= 4 -+#define _sd_printf_attr_(a,b) __attribute__ ((format (printf, a, b))) -+#else -+#define _sd_printf_attr_(a,b) -+#endif -+#endif -+ -+/* -+ Log levels for usage on stderr: -+ -+ fprintf(stderr, SD_NOTICE "Hello World!\n"); -+ -+ This is similar to printk() usage in the kernel. -+*/ -+#define SD_EMERG "<0>" /* system is unusable */ -+#define SD_ALERT "<1>" /* action must be taken immediately */ -+#define SD_CRIT "<2>" /* critical conditions */ -+#define SD_ERR "<3>" /* error conditions */ -+#define SD_WARNING "<4>" /* warning conditions */ -+#define SD_NOTICE "<5>" /* normal but significant condition */ -+#define SD_INFO "<6>" /* informational */ -+#define SD_DEBUG "<7>" /* debug-level messages */ -+ -+/* The first passed file descriptor is fd 3 */ -+#define SD_LISTEN_FDS_START 3 -+ -+/* -+ Returns how many file descriptors have been passed, or a negative -+ errno code on failure. Optionally, removes the $LISTEN_FDS and -+ $LISTEN_PID file descriptors from the environment (recommended, but -+ problematic in threaded environments). If r is the return value of -+ this function you'll find the file descriptors passed as fds -+ SD_LISTEN_FDS_START to SD_LISTEN_FDS_START+r-1. Returns a negative -+ errno style error code on failure. This function call ensures that -+ the FD_CLOEXEC flag is set for the passed file descriptors, to make -+ sure they are not passed on to child processes. If FD_CLOEXEC shall -+ not be set, the caller needs to unset it after this call for all file -+ descriptors that are used. -+ -+ See sd_listen_fds(3) for more information. -+*/ -+int netsnmp_sd_listen_fds(int unset_environment); -+ -+/* -+ Helper call for identifying a passed file descriptor. Returns 1 if -+ the file descriptor is a FIFO in the file system stored under the -+ specified path, 0 otherwise. If path is NULL a path name check will -+ not be done and the call only verifies if the file descriptor -+ refers to a FIFO. Returns a negative errno style error code on -+ failure. -+ -+ See sd_is_fifo(3) for more information. -+*/ -+int netsnmp_sd_is_fifo(int fd, const char *path); -+ -+/* -+ Helper call for identifying a passed file descriptor. Returns 1 if -+ the file descriptor is a special character device on the file -+ system stored under the specified path, 0 otherwise. -+ If path is NULL a path name check will not be done and the call -+ only verifies if the file descriptor refers to a special character. -+ Returns a negative errno style error code on failure. -+ -+ See sd_is_special(3) for more information. -+*/ -+int netsnmp_sd_is_special(int fd, const char *path); -+ -+/* -+ Helper call for identifying a passed file descriptor. Returns 1 if -+ the file descriptor is a socket of the specified family (AF_INET, -+ ...) and type (SOCK_DGRAM, SOCK_STREAM, ...), 0 otherwise. If -+ family is 0 a socket family check will not be done. If type is 0 a -+ socket type check will not be done and the call only verifies if -+ the file descriptor refers to a socket. If listening is > 0 it is -+ verified that the socket is in listening mode. (i.e. listen() has -+ been called) If listening is == 0 it is verified that the socket is -+ not in listening mode. If listening is < 0 no listening mode check -+ is done. Returns a negative errno style error code on failure. -+ -+ See sd_is_socket(3) for more information. -+*/ -+int netsnmp_sd_is_socket(int fd, int family, int type, int listening); -+ -+/* -+ Helper call for identifying a passed file descriptor. Returns 1 if -+ the file descriptor is an Internet socket, of the specified family -+ (either AF_INET or AF_INET6) and the specified type (SOCK_DGRAM, -+ SOCK_STREAM, ...), 0 otherwise. If version is 0 a protocol version -+ check is not done. If type is 0 a socket type check will not be -+ done. If port is 0 a socket port check will not be done. The -+ listening flag is used the same way as in sd_is_socket(). Returns a -+ negative errno style error code on failure. -+ -+ See sd_is_socket_inet(3) for more information. -+*/ -+int netsnmp_sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port); -+ -+/* -+ Helper call for identifying a passed file descriptor. Returns 1 if -+ the file descriptor is an AF_UNIX socket of the specified type -+ (SOCK_DGRAM, SOCK_STREAM, ...) and path, 0 otherwise. If type is 0 -+ a socket type check will not be done. If path is NULL a socket path -+ check will not be done. For normal AF_UNIX sockets set length to -+ 0. For abstract namespace sockets set length to the length of the -+ socket name (including the initial 0 byte), and pass the full -+ socket path in path (including the initial 0 byte). The listening -+ flag is used the same way as in sd_is_socket(). Returns a negative -+ errno style error code on failure. -+ -+ See sd_is_socket_unix(3) for more information. -+*/ -+int netsnmp_sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length); -+ -+/* -+ Informs systemd about changed daemon state. This takes a number of -+ newline separated environment-style variable assignments in a -+ string. The following variables are known: -+ -+ READY=1 Tells systemd that daemon startup is finished (only -+ relevant for services of Type=notify). The passed -+ argument is a boolean "1" or "0". Since there is -+ little value in signaling non-readiness the only -+ value daemons should send is "READY=1". -+ -+ STATUS=... Passes a single-line status string back to systemd -+ that describes the daemon state. This is free-from -+ and can be used for various purposes: general state -+ feedback, fsck-like programs could pass completion -+ percentages and failing programs could pass a human -+ readable error message. Example: "STATUS=Completed -+ 66% of file system check..." -+ -+ ERRNO=... If a daemon fails, the errno-style error code, -+ formatted as string. Example: "ERRNO=2" for ENOENT. -+ -+ BUSERROR=... If a daemon fails, the D-Bus error-style error -+ code. Example: "BUSERROR=org.freedesktop.DBus.Error.TimedOut" -+ -+ MAINPID=... The main pid of a daemon, in case systemd did not -+ fork off the process itself. Example: "MAINPID=4711" -+ -+ Daemons can choose to send additional variables. However, it is -+ recommended to prefix variable names not listed above with X_. -+ -+ Returns a negative errno-style error code on failure. Returns > 0 -+ if systemd could be notified, 0 if it couldn't possibly because -+ systemd is not running. -+ -+ Example: When a daemon finished starting up, it could issue this -+ call to notify systemd about it: -+ -+ sd_notify(0, "READY=1"); -+ -+ See sd_notifyf() for more complete examples. -+ -+ See sd_notify(3) for more information. -+*/ -+int netsnmp_sd_notify(int unset_environment, const char *state); -+ -+/* -+ Similar to sd_notify() but takes a format string. -+ -+ Example 1: A daemon could send the following after initialization: -+ -+ sd_notifyf(0, "READY=1\n" -+ "STATUS=Processing requests...\n" -+ "MAINPID=%lu", -+ (unsigned long) getpid()); -+ -+ Example 2: A daemon could send the following shortly before -+ exiting, on failure: -+ -+ sd_notifyf(0, "STATUS=Failed to start up: %s\n" -+ "ERRNO=%i", -+ strerror(errno), -+ errno); -+ -+ See sd_notifyf(3) for more information. -+*/ -+int netsnmp_sd_notifyf(int unset_environment, const char *format, ...) _sd_printf_attr_(2,3); -+ -+/* -+ Returns > 0 if the system was booted with systemd. Returns < 0 on -+ error. Returns 0 if the system was not booted with systemd. Note -+ that all of the functions above handle non-systemd boots just -+ fine. You should NOT protect them with a call to this function. Also -+ note that this function checks whether the system, not the user -+ session is controlled by systemd. However the functions above work -+ for both user and system services. -+ -+ See sd_booted(3) for more information. -+*/ -+int netsnmp_sd_booted(void); -+ -+/** -+ * Find an socket with given parameters. See man sd_is_socket_inet for -+ * description of the arguments. -+ * -+ * Returns the file descriptor if it is found, 0 otherwise. -+ */ -+int netsnmp_sd_find_inet_socket(int family, int type, int listening, int port); -+ -+/** -+ * Find an unix socket with given parameters. See man sd_is_socket_unix for -+ * description of the arguments. -+ * -+ * Returns the file descriptor if it is found, 0 otherwise. -+ */ -+int -+netsnmp_sd_find_unix_socket(int type, int listening, const char *path); -+ -+#ifdef __cplusplus -+} -+#endif -+ -+#endif /* SNMPD_SD_DAEMON_H */ -diff --git a/snmplib/sd-daemon.c b/snmplib/sd-daemon.c -new file mode 100644 -index 0000000..42dba29 ---- /dev/null -+++ b/snmplib/sd-daemon.c -@@ -0,0 +1,532 @@ -+/* -+ * Systemd integration parts. -+ * -+ * Most of this file is directly copied from systemd sources. -+ * Changes: -+ * - all functions were renamed to have netsnmp_ prefix -+ * - includes were changed to match Net-SNMP style. -+ * - removed gcc export macros -+ * - removed POSIX message queues -+ */ -+ -+#include <net-snmp/net-snmp-config.h> -+#include <net-snmp/net-snmp-features.h> -+#include <net-snmp/types.h> -+#include <net-snmp/library/snmp_debug.h> -+ -+#ifndef NETSNMP_NO_SYSTEMD -+ -+/*** -+ Copyright 2010 Lennart Poettering -+ -+ Permission is hereby granted, free of charge, to any person -+ obtaining a copy of this software and associated documentation files -+ (the "Software"), to deal in the Software without restriction, -+ including without limitation the rights to use, copy, modify, merge, -+ publish, distribute, sublicense, and/or sell copies of the Software, -+ and to permit persons to whom the Software is furnished to do so, -+ subject to the following conditions: -+ -+ The above copyright notice and this permission notice shall be -+ included in all copies or substantial portions of the Software. -+ -+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -+ SOFTWARE. -+***/ -+ -+#ifndef _GNU_SOURCE -+#define _GNU_SOURCE -+#endif -+ -+#include <sys/types.h> -+#include <sys/stat.h> -+#include <sys/socket.h> -+#include <sys/un.h> -+#include <sys/fcntl.h> -+#include <netinet/in.h> -+#include <stdlib.h> -+#include <errno.h> -+#include <unistd.h> -+#include <string.h> -+#include <stdarg.h> -+#include <stdio.h> -+#include <stddef.h> -+#include <limits.h> -+ -+#include <net-snmp/library/sd-daemon.h> -+ -+int netsnmp_sd_listen_fds(int unset_environment) { -+ -+ int r, fd; -+ const char *e; -+ char *p = NULL; -+ unsigned long l; -+ -+ if (!(e = getenv("LISTEN_PID"))) { -+ r = 0; -+ goto finish; -+ } -+ -+ errno = 0; -+ l = strtoul(e, &p, 10); -+ -+ if (errno != 0) { -+ r = -errno; -+ goto finish; -+ } -+ -+ if (!p || *p || l <= 0) { -+ r = -EINVAL; -+ goto finish; -+ } -+ -+ /* Is this for us? */ -+ if (getpid() != (pid_t) l) { -+ r = 0; -+ goto finish; -+ } -+ -+ if (!(e = getenv("LISTEN_FDS"))) { -+ r = 0; -+ goto finish; -+ } -+ -+ errno = 0; -+ l = strtoul(e, &p, 10); -+ -+ if (errno != 0) { -+ r = -errno; -+ goto finish; -+ } -+ -+ if (!p || *p) { -+ r = -EINVAL; -+ goto finish; -+ } -+ -+ for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + (int) l; fd ++) { -+ int flags; -+ -+ if ((flags = fcntl(fd, F_GETFD)) < 0) { -+ r = -errno; -+ goto finish; -+ } -+ -+ if (flags & FD_CLOEXEC) -+ continue; -+ -+ if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) < 0) { -+ r = -errno; -+ goto finish; -+ } -+ } -+ -+ r = (int) l; -+ -+finish: -+ if (unset_environment) { -+ unsetenv("LISTEN_PID"); -+ unsetenv("LISTEN_FDS"); -+ } -+ -+ return r; -+} -+ -+int netsnmp_sd_is_fifo(int fd, const char *path) { -+ struct stat st_fd; -+ -+ if (fd < 0) -+ return -EINVAL; -+ -+ memset(&st_fd, 0, sizeof(st_fd)); -+ if (fstat(fd, &st_fd) < 0) -+ return -errno; -+ -+ if (!S_ISFIFO(st_fd.st_mode)) -+ return 0; -+ -+ if (path) { -+ struct stat st_path; -+ -+ memset(&st_path, 0, sizeof(st_path)); -+ if (stat(path, &st_path) < 0) { -+ -+ if (errno == ENOENT || errno == ENOTDIR) -+ return 0; -+ -+ return -errno; -+ } -+ -+ return -+ st_path.st_dev == st_fd.st_dev && -+ st_path.st_ino == st_fd.st_ino; -+ } -+ -+ return 1; -+} -+ -+int netsnmp_sd_is_special(int fd, const char *path) { -+ struct stat st_fd; -+ -+ if (fd < 0) -+ return -EINVAL; -+ -+ if (fstat(fd, &st_fd) < 0) -+ return -errno; -+ -+ if (!S_ISREG(st_fd.st_mode) && !S_ISCHR(st_fd.st_mode)) -+ return 0; -+ -+ if (path) { -+ struct stat st_path; -+ -+ if (stat(path, &st_path) < 0) { -+ -+ if (errno == ENOENT || errno == ENOTDIR) -+ return 0; -+ -+ return -errno; -+ } -+ -+ if (S_ISREG(st_fd.st_mode) && S_ISREG(st_path.st_mode)) -+ return -+ st_path.st_dev == st_fd.st_dev && -+ st_path.st_ino == st_fd.st_ino; -+ else if (S_ISCHR(st_fd.st_mode) && S_ISCHR(st_path.st_mode)) -+ return st_path.st_rdev == st_fd.st_rdev; -+ else -+ return 0; -+ } -+ -+ return 1; -+} -+ -+static int sd_is_socket_internal(int fd, int type, int listening) { -+ struct stat st_fd; -+ -+ if (fd < 0 || type < 0) -+ return -EINVAL; -+ -+ if (fstat(fd, &st_fd) < 0) -+ return -errno; -+ -+ if (!S_ISSOCK(st_fd.st_mode)) -+ return 0; -+ -+ if (type != 0) { -+ int other_type = 0; -+ socklen_t l = sizeof(other_type); -+ -+ if (getsockopt(fd, SOL_SOCKET, SO_TYPE, &other_type, &l) < 0) -+ return -errno; -+ -+ if (l != sizeof(other_type)) -+ return -EINVAL; -+ -+ if (other_type != type) -+ return 0; -+ } -+ -+ if (listening >= 0) { -+ int accepting = 0; -+ socklen_t l = sizeof(accepting); -+ -+ if (getsockopt(fd, SOL_SOCKET, SO_ACCEPTCONN, &accepting, &l) < 0) -+ return -errno; -+ -+ if (l != sizeof(accepting)) -+ return -EINVAL; -+ -+ if (!accepting != !listening) -+ return 0; -+ } -+ -+ return 1; -+} -+ -+union sockaddr_union { -+ struct sockaddr sa; -+ struct sockaddr_in in4; -+ struct sockaddr_in6 in6; -+ struct sockaddr_un un; -+ struct sockaddr_storage storage; -+}; -+ -+int netsnmp_sd_is_socket(int fd, int family, int type, int listening) { -+ int r; -+ -+ if (family < 0) -+ return -EINVAL; -+ -+ if ((r = sd_is_socket_internal(fd, type, listening)) <= 0) -+ return r; -+ -+ if (family > 0) { -+ union sockaddr_union sockaddr; -+ socklen_t l; -+ -+ memset(&sockaddr, 0, sizeof(sockaddr)); -+ l = sizeof(sockaddr); -+ -+ if (getsockname(fd, &sockaddr.sa, &l) < 0) -+ return -errno; -+ -+ if (l < sizeof(sa_family_t)) -+ return -EINVAL; -+ -+ return sockaddr.sa.sa_family == family; -+ } -+ -+ return 1; -+} -+ -+int netsnmp_sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port) { -+ union sockaddr_union sockaddr; -+ socklen_t l; -+ int r; -+ -+ if (family != 0 && family != AF_INET && family != AF_INET6) -+ return -EINVAL; -+ -+ if ((r = sd_is_socket_internal(fd, type, listening)) <= 0) -+ return r; -+ -+ memset(&sockaddr, 0, sizeof(sockaddr)); -+ l = sizeof(sockaddr); -+ -+ if (getsockname(fd, &sockaddr.sa, &l) < 0) -+ return -errno; -+ -+ if (l < sizeof(sa_family_t)) -+ return -EINVAL; -+ -+ if (sockaddr.sa.sa_family != AF_INET && -+ sockaddr.sa.sa_family != AF_INET6) -+ return 0; -+ -+ if (family > 0) -+ if (sockaddr.sa.sa_family != family) -+ return 0; -+ -+ if (port > 0) { -+ if (sockaddr.sa.sa_family == AF_INET) { -+ if (l < sizeof(struct sockaddr_in)) -+ return -EINVAL; -+ -+ return htons(port) == sockaddr.in4.sin_port; -+ } else { -+ if (l < sizeof(struct sockaddr_in6)) -+ return -EINVAL; -+ -+ return htons(port) == sockaddr.in6.sin6_port; -+ } -+ } -+ -+ return 1; -+} -+ -+int netsnmp_sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length) { -+ union sockaddr_union sockaddr; -+ socklen_t l; -+ int r; -+ -+ if ((r = sd_is_socket_internal(fd, type, listening)) <= 0) -+ return r; -+ -+ memset(&sockaddr, 0, sizeof(sockaddr)); -+ l = sizeof(sockaddr); -+ -+ if (getsockname(fd, &sockaddr.sa, &l) < 0) -+ return -errno; -+ -+ if (l < sizeof(sa_family_t)) -+ return -EINVAL; -+ -+ if (sockaddr.sa.sa_family != AF_UNIX) -+ return 0; -+ -+ if (path) { -+ if (length <= 0) -+ length = strlen(path); -+ -+ if (length <= 0) -+ /* Unnamed socket */ -+ return l == offsetof(struct sockaddr_un, sun_path); -+ -+ if (path[0]) -+ /* Normal path socket */ -+ return -+ (l >= offsetof(struct sockaddr_un, sun_path) + length + 1) && -+ memcmp(path, sockaddr.un.sun_path, length+1) == 0; -+ else -+ /* Abstract namespace socket */ -+ return -+ (l == offsetof(struct sockaddr_un, sun_path) + length) && -+ memcmp(path, sockaddr.un.sun_path, length) == 0; -+ } -+ -+ return 1; -+} -+ -+int netsnmp_sd_notify(int unset_environment, const char *state) { -+ int fd = -1, r; -+ struct msghdr msghdr; -+ struct iovec iovec; -+ union sockaddr_union sockaddr; -+ const char *e; -+ -+ if (!state) { -+ r = -EINVAL; -+ goto finish; -+ } -+ -+ if (!(e = getenv("NOTIFY_SOCKET"))) -+ return 0; -+ -+ /* Must be an abstract socket, or an absolute path */ -+ if ((e[0] != '@' && e[0] != '/') || e[1] == 0) { -+ r = -EINVAL; -+ goto finish; -+ } -+ -+ if ((fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0)) < 0) { -+ r = -errno; -+ goto finish; -+ } -+ -+ memset(&sockaddr, 0, sizeof(sockaddr)); -+ sockaddr.sa.sa_family = AF_UNIX; -+ strncpy(sockaddr.un.sun_path, e, sizeof(sockaddr.un.sun_path)); -+ -+ if (sockaddr.un.sun_path[0] == '@') -+ sockaddr.un.sun_path[0] = 0; -+ -+ memset(&iovec, 0, sizeof(iovec)); -+ iovec.iov_base = (char *)state; -+ iovec.iov_len = strlen(state); -+ -+ memset(&msghdr, 0, sizeof(msghdr)); -+ msghdr.msg_name = &sockaddr; -+ msghdr.msg_namelen = offsetof(struct sockaddr_un, sun_path) + strlen(e); -+ -+ if (msghdr.msg_namelen > sizeof(struct sockaddr_un)) -+ msghdr.msg_namelen = sizeof(struct sockaddr_un); -+ -+ msghdr.msg_iov = &iovec; -+ msghdr.msg_iovlen = 1; -+ -+ if (sendmsg(fd, &msghdr, MSG_NOSIGNAL) < 0) { -+ r = -errno; -+ goto finish; -+ } -+ -+ r = 1; -+ -+finish: -+ if (unset_environment) -+ unsetenv("NOTIFY_SOCKET"); -+ -+ if (fd >= 0) -+ close(fd); -+ -+ return r; -+} -+ -+int netsnmp_sd_notifyf(int unset_environment, const char *format, ...) { -+ va_list ap; -+ char *p = NULL; -+ int r; -+ -+ va_start(ap, format); -+ r = vasprintf(&p, format, ap); -+ va_end(ap); -+ -+ if (r < 0 || !p) -+ return -ENOMEM; -+ -+ r = netsnmp_sd_notify(unset_environment, p); -+ free(p); -+ -+ return r; -+} -+ -+int netsnmp_sd_booted(void) { -+ struct stat a, b; -+ -+ /* We simply test whether the systemd cgroup hierarchy is -+ * mounted */ -+ -+ if (lstat("/sys/fs/cgroup", &a) < 0) -+ return 0; -+ -+ if (lstat("/sys/fs/cgroup/systemd", &b) < 0) -+ return 0; -+ -+ return a.st_dev != b.st_dev; -+} -+ -+/* End of original sd-daemon.c from systemd sources */ -+ -+int -+netsnmp_sd_find_inet_socket(int family, int type, int listening, int port) -+{ -+ int count, fd; -+ -+ count = netsnmp_sd_listen_fds(0); -+ if (count <= 0) { -+ DEBUGMSGTL(("systemd:find_inet_socket", "No LISTEN_FDS found.\n")); -+ return 0; -+ } -+ DEBUGMSGTL(("systemd:find_inet_socket", "LISTEN_FDS reports %d sockets.\n", -+ count)); -+ -+ for (fd = 3; fd < 3+count; fd++) { -+ int rc = netsnmp_sd_is_socket_inet(fd, family, type, listening, port); -+ if (rc < 0) -+ DEBUGMSGTL(("systemd:find_inet_socket", -+ "sd_is_socket_inet error: %d\n", rc)); -+ if (rc > 0) { -+ DEBUGMSGTL(("systemd:find_inet_socket", -+ "Found the socket in LISTEN_FDS\n")); -+ return fd; -+ } -+ } -+ DEBUGMSGTL(("systemd:find_inet_socket", "Socket not found in LISTEN_FDS\n")); -+ return 0; -+} -+ -+int -+netsnmp_sd_find_unix_socket(int type, int listening, const char *path) -+{ -+ int count, fd; -+ -+ count = netsnmp_sd_listen_fds(0); -+ if (count <= 0) { -+ DEBUGMSGTL(("systemd:find_unix_socket", "No LISTEN_FDS found.\n")); -+ return 0; -+ } -+ DEBUGMSGTL(("systemd:find_unix_socket", "LISTEN_FDS reports %d sockets.\n", -+ count)); -+ -+ for (fd = 3; fd < 3+count; fd++) { -+ int rc = netsnmp_sd_is_socket_unix(fd, type, listening, path, 0); -+ if (rc < 0) -+ DEBUGMSGTL(("systemd:find_unix_socket", -+ "netsnmp_sd_is_socket_unix error: %d\n", rc)); -+ if (rc > 0) { -+ DEBUGMSGTL(("systemd:find_unix_socket", -+ "Found the socket in LISTEN_FDS\n")); -+ return fd; -+ } -+ } -+ DEBUGMSGTL(("systemd:find_unix_socket", "Socket not found in LISTEN_FDS\n")); -+ return 0; -+} -+ -+#endif /* ! NETSNMP_NO_SYSTEMD */ -diff --git a/snmplib/transports/snmpTCPDomain.c b/snmplib/transports/snmpTCPDomain.c -index 7feb028..a41b926 100644 ---- a/snmplib/transports/snmpTCPDomain.c -+++ b/snmplib/transports/snmpTCPDomain.c -@@ -43,6 +43,10 @@ - #include <net-snmp/library/snmpTCPBaseDomain.h> - #include <net-snmp/library/tools.h> - -+#ifndef NETSNMP_NO_SYSTEMD -+#include <net-snmp/library/sd-daemon.h> -+#endif -+ - /* - * needs to be in sync with the definitions in snmplib/snmpUDPDomain.c - * and perl/agent/agent.xs -@@ -149,6 +153,7 @@ netsnmp_tcp_transport(struct sockaddr_in *addr, int local) - netsnmp_transport *t = NULL; - netsnmp_udp_addr_pair *addr_pair = NULL; - int rc = 0; -+ int socket_initialized = 0; - - #ifdef NETSNMP_NO_LISTEN_SUPPORT - if (local) -@@ -178,7 +183,19 @@ netsnmp_tcp_transport(struct sockaddr_in *addr, int local) - t->domain_length = - sizeof(netsnmp_snmpTCPDomain) / sizeof(netsnmp_snmpTCPDomain[0]); - -- t->sock = socket(PF_INET, SOCK_STREAM, 0); -+#ifndef NETSNMP_NO_SYSTEMD -+ /* -+ * Maybe the socket was already provided by systemd... -+ */ -+ if (local) { -+ t->sock = netsnmp_sd_find_inet_socket(PF_INET, SOCK_STREAM, 1, -+ ntohs(addr->sin_port)); -+ if (t->sock) -+ socket_initialized = 1; -+ } -+#endif -+ if (!socket_initialized) -+ t->sock = socket(PF_INET, SOCK_STREAM, 0); - if (t->sock < 0) { - netsnmp_transport_free(t); - return NULL; -@@ -215,11 +232,13 @@ netsnmp_tcp_transport(struct sockaddr_in *addr, int local) - setsockopt(t->sock, SOL_SOCKET, SO_REUSEADDR, (void *)&opt, - sizeof(opt)); - -- rc = bind(t->sock, (struct sockaddr *)addr, sizeof(struct sockaddr)); -- if (rc != 0) { -- netsnmp_socketbase_close(t); -- netsnmp_transport_free(t); -- return NULL; -+ if (!socket_initialized) { -+ rc = bind(t->sock, (struct sockaddr *)addr, sizeof(struct sockaddr)); -+ if (rc != 0) { -+ netsnmp_socketbase_close(t); -+ netsnmp_transport_free(t); -+ return NULL; -+ } - } - - /* -@@ -236,11 +255,13 @@ netsnmp_tcp_transport(struct sockaddr_in *addr, int local) - * Now sit here and wait for connections to arrive. - */ - -- rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN); -- if (rc != 0) { -- netsnmp_socketbase_close(t); -- netsnmp_transport_free(t); -- return NULL; -+ if (!socket_initialized) { -+ rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN); -+ if (rc != 0) { -+ netsnmp_socketbase_close(t); -+ netsnmp_transport_free(t); -+ return NULL; -+ } - } - - /* -diff --git a/snmplib/transports/snmpTCPIPv6Domain.c b/snmplib/transports/snmpTCPIPv6Domain.c -index d2e0a2d..22de6d4 100644 ---- a/snmplib/transports/snmpTCPIPv6Domain.c -+++ b/snmplib/transports/snmpTCPIPv6Domain.c -@@ -49,6 +49,10 @@ - #include <net-snmp/library/snmpTCPBaseDomain.h> - #include <net-snmp/library/tools.h> - -+#ifndef NETSNMP_NO_SYSTEMD -+#include <net-snmp/library/sd-daemon.h> -+#endif -+ - #include "inet_ntop.h" - - oid netsnmp_TCPIPv6Domain[] = { TRANSPORT_DOMAIN_TCP_IPV6 }; -@@ -140,6 +144,8 @@ netsnmp_tcp6_transport(struct sockaddr_in6 *addr, int local) - { - netsnmp_transport *t = NULL; - int rc = 0; -+ char *str = NULL; -+ int socket_initialized = 0; - - #ifdef NETSNMP_NO_LISTEN_SUPPORT - if (local) -@@ -174,7 +180,19 @@ netsnmp_tcp6_transport(struct sockaddr_in6 *addr, int local) - t->domain = netsnmp_TCPIPv6Domain; - t->domain_length = sizeof(netsnmp_TCPIPv6Domain) / sizeof(oid); - -- t->sock = socket(PF_INET6, SOCK_STREAM, 0); -+#ifndef NETSNMP_NO_SYSTEMD -+ /* -+ * Maybe the socket was already provided by systemd... -+ */ -+ if (local) { -+ t->sock = netsnmp_sd_find_inet_socket(PF_INET6, SOCK_STREAM, 1, -+ ntohs(addr->sin6_port)); -+ if (t->sock) -+ socket_initialized = 1; -+ } -+#endif -+ if (!socket_initialized) -+ t->sock = socket(PF_INET6, SOCK_STREAM, 0); - if (t->sock < 0) { - netsnmp_transport_free(t); - return NULL; -@@ -220,12 +238,14 @@ netsnmp_tcp6_transport(struct sockaddr_in6 *addr, int local) - - setsockopt(t->sock, SOL_SOCKET, SO_REUSEADDR, (void *)&opt, sizeof(opt)); - -- rc = bind(t->sock, (struct sockaddr *) addr, -- sizeof(struct sockaddr_in6)); -- if (rc != 0) { -- netsnmp_socketbase_close(t); -- netsnmp_transport_free(t); -- return NULL; -+ if (!socket_initialized) { -+ rc = bind(t->sock, (struct sockaddr *) addr, -+ sizeof(struct sockaddr_in6)); -+ if (rc != 0) { -+ netsnmp_socketbase_close(t); -+ netsnmp_transport_free(t); -+ return NULL; -+ } - } - - /* -@@ -242,11 +262,13 @@ netsnmp_tcp6_transport(struct sockaddr_in6 *addr, int local) - * Now sit here and wait for connections to arrive. - */ - -- rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN); -- if (rc != 0) { -- netsnmp_socketbase_close(t); -- netsnmp_transport_free(t); -- return NULL; -+ if (!socket_initialized) { -+ rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN); -+ if (rc != 0) { -+ netsnmp_socketbase_close(t); -+ netsnmp_transport_free(t); -+ return NULL; -+ } - } - - /* -diff --git a/snmplib/transports/snmpUDPIPv4BaseDomain.c b/snmplib/transports/snmpUDPIPv4BaseDomain.c -index 8c0fb05..00e5bbc 100644 ---- a/snmplib/transports/snmpUDPIPv4BaseDomain.c -+++ b/snmplib/transports/snmpUDPIPv4BaseDomain.c -@@ -40,6 +40,10 @@ - - #include <net-snmp/library/snmpSocketBaseDomain.h> - -+#ifndef NETSNMP_NO_SYSTEMD -+#include <net-snmp/library/sd-daemon.h> -+#endif -+ - #if defined(HAVE_IP_PKTINFO) || defined(HAVE_IP_RECVDSTADDR) - int netsnmp_udpipv4_recvfrom(int s, void *buf, int len, struct sockaddr *from, - socklen_t *fromlen, struct sockaddr *dstip, -@@ -64,6 +68,7 @@ netsnmp_udpipv4base_transport(struct sockaddr_in *addr, int local) - char *client_socket = NULL; - netsnmp_indexed_addr_pair addr_pair; - socklen_t local_addr_len; -+ int socket_initialized = 0; - - #ifdef NETSNMP_NO_LISTEN_SUPPORT - if (local) -@@ -88,7 +93,19 @@ netsnmp_udpipv4base_transport(struct sockaddr_in *addr, int local) - free(str); - } - -- t->sock = socket(PF_INET, SOCK_DGRAM, 0); -+#ifndef NETSNMP_NO_SYSTEMD -+ /* -+ * Maybe the socket was already provided by systemd... -+ */ -+ if (local) { -+ t->sock = netsnmp_sd_find_inet_socket(PF_INET, SOCK_DGRAM, -1, -+ ntohs(addr->sin_port)); -+ if (t->sock) -+ socket_initialized = 1; -+ } -+#endif -+ if (!socket_initialized) -+ t->sock = socket(PF_INET, SOCK_DGRAM, 0); - DEBUGMSGTL(("UDPBase", "openned socket %d as local=%d\n", t->sock, local)); - if (t->sock < 0) { - netsnmp_transport_free(t); -@@ -151,12 +168,14 @@ netsnmp_udpipv4base_transport(struct sockaddr_in *addr, int local) - } - } - #endif /* !defined(WIN32) */ -- rc = bind(t->sock, (struct sockaddr *) addr, -- sizeof(struct sockaddr)); -- if (rc != 0) { -- netsnmp_socketbase_close(t); -- netsnmp_transport_free(t); -- return NULL; -+ if (!socket_initialized) { -+ rc = bind(t->sock, (struct sockaddr *) addr, -+ sizeof(struct sockaddr)); -+ if (rc != 0) { -+ netsnmp_socketbase_close(t); -+ netsnmp_transport_free(t); -+ return NULL; -+ } - } - t->data = NULL; - t->data_length = 0; -diff --git a/snmplib/transports/snmpUDPIPv6Domain.c b/snmplib/transports/snmpUDPIPv6Domain.c -index 18de876..fd2ced4 100644 ---- a/snmplib/transports/snmpUDPIPv6Domain.c -+++ b/snmplib/transports/snmpUDPIPv6Domain.c -@@ -67,6 +67,10 @@ static const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; - #include <net-snmp/library/snmpSocketBaseDomain.h> - #include <net-snmp/library/tools.h> - -+#ifndef NETSNMP_NO_SYSTEMD -+#include <net-snmp/library/sd-daemon.h> -+#endif -+ - #include "inet_ntop.h" - #include "inet_pton.h" - -@@ -190,6 +194,8 @@ netsnmp_udp6_transport(struct sockaddr_in6 *addr, int local) - { - netsnmp_transport *t = NULL; - int rc = 0; -+ char *str = NULL; -+ int socket_initialized = 0; - - #ifdef NETSNMP_NO_LISTEN_SUPPORT - if (local) -@@ -217,7 +223,19 @@ netsnmp_udp6_transport(struct sockaddr_in6 *addr, int local) - t->domain_length = - sizeof(netsnmp_UDPIPv6Domain) / sizeof(netsnmp_UDPIPv6Domain[0]); - -- t->sock = socket(PF_INET6, SOCK_DGRAM, 0); -+#ifndef NETSNMP_NO_SYSTEMD -+ /* -+ * Maybe the socket was already provided by systemd... -+ */ -+ if (local) { -+ t->sock = netsnmp_sd_find_inet_socket(PF_INET6, SOCK_DGRAM, -1, -+ ntohs(addr->sin6_port)); -+ if (t->sock) -+ socket_initialized = 1; -+ } -+#endif -+ if (!socket_initialized) -+ t->sock = socket(PF_INET6, SOCK_DGRAM, 0); - if (t->sock < 0) { - netsnmp_transport_free(t); - return NULL; -@@ -243,12 +261,14 @@ netsnmp_udp6_transport(struct sockaddr_in6 *addr, int local) - } - #endif - -- rc = bind(t->sock, (struct sockaddr *) addr, -- sizeof(struct sockaddr_in6)); -- if (rc != 0) { -- netsnmp_socketbase_close(t); -- netsnmp_transport_free(t); -- return NULL; -+ if (!socket_initialized) { -+ rc = bind(t->sock, (struct sockaddr *) addr, -+ sizeof(struct sockaddr_in6)); -+ if (rc != 0) { -+ netsnmp_socketbase_close(t); -+ netsnmp_transport_free(t); -+ return NULL; -+ } - } - t->local = (unsigned char*)malloc(18); - if (t->local == NULL) { -diff --git a/snmplib/transports/snmpUnixDomain.c b/snmplib/transports/snmpUnixDomain.c -index 47dffc1..8f34c37 100644 ---- a/snmplib/transports/snmpUnixDomain.c -+++ b/snmplib/transports/snmpUnixDomain.c -@@ -37,6 +37,10 @@ - #include <net-snmp/library/system.h> /* mkdirhier */ - #include <net-snmp/library/tools.h> - -+#ifndef NETSNMP_NO_SYSTEMD -+#include <net-snmp/library/sd-daemon.h> -+#endif -+ - netsnmp_feature_child_of(transport_unix_socket_all, transport_all) - netsnmp_feature_child_of(unix_socket_paths, transport_unix_socket_all) - -@@ -295,6 +299,8 @@ netsnmp_unix_transport(struct sockaddr_un *addr, int local) - netsnmp_transport *t = NULL; - sockaddr_un_pair *sup = NULL; - int rc = 0; -+ char *string = NULL; -+ int socket_initialized = 0; - - #ifdef NETSNMP_NO_LISTEN_SUPPORT - /* SPECIAL CIRCUMSTANCE: We still want AgentX to be able to operate, -@@ -333,7 +339,18 @@ netsnmp_unix_transport(struct sockaddr_un *addr, int local) - t->data_length = sizeof(sockaddr_un_pair); - sup = (sockaddr_un_pair *) t->data; - -- t->sock = socket(PF_UNIX, SOCK_STREAM, 0); -+#ifndef NETSNMP_NO_SYSTEMD -+ /* -+ * Maybe the socket was already provided by systemd... -+ */ -+ if (local) { -+ t->sock = netsnmp_sd_find_unix_socket(SOCK_STREAM, 1, addr->sun_path); -+ if (t->sock) -+ socket_initialized = 1; -+ } -+#endif -+ if (!socket_initialized) -+ t->sock = socket(PF_UNIX, SOCK_STREAM, 0); - if (t->sock < 0) { - netsnmp_transport_free(t); - return NULL; -@@ -357,25 +374,26 @@ netsnmp_unix_transport(struct sockaddr_un *addr, int local) - - t->flags |= NETSNMP_TRANSPORT_FLAG_LISTEN; - -- unlink(addr->sun_path); -- rc = bind(t->sock, (struct sockaddr *) addr, SUN_LEN(addr)); -- -- if (rc != 0 && errno == ENOENT && create_path) { -- rc = mkdirhier(addr->sun_path, create_mode, 1); -+ if (!socket_initialized) { -+ unlink(addr->sun_path); -+ rc = bind(t->sock, (struct sockaddr *) addr, SUN_LEN(addr)); -+ if (rc != 0 && errno == ENOENT && create_path) { -+ rc = mkdirhier(addr->sun_path, create_mode, 1); -+ if (rc != 0) { -+ netsnmp_unix_close(t); -+ netsnmp_transport_free(t); -+ return NULL; -+ } -+ rc = bind(t->sock, (struct sockaddr *) addr, SUN_LEN(addr)); -+ } - if (rc != 0) { -+ DEBUGMSGTL(("netsnmp_unix_transport", -+ "couldn't bind \"%s\", errno %d (%s)\n", -+ addr->sun_path, errno, strerror(errno))); - netsnmp_unix_close(t); - netsnmp_transport_free(t); - return NULL; - } -- rc = bind(t->sock, (struct sockaddr *) addr, SUN_LEN(addr)); -- } -- if (rc != 0) { -- DEBUGMSGTL(("netsnmp_unix_transport", -- "couldn't bind \"%s\", errno %d (%s)\n", -- addr->sun_path, errno, strerror(errno))); -- netsnmp_unix_close(t); -- netsnmp_transport_free(t); -- return NULL; - } - - /* -@@ -391,14 +409,16 @@ netsnmp_unix_transport(struct sockaddr_un *addr, int local) - * Now sit here and listen for connections to arrive. - */ - -- rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN); -- if (rc != 0) { -- DEBUGMSGTL(("netsnmp_unix_transport", -- "couldn't listen to \"%s\", errno %d (%s)\n", -- addr->sun_path, errno, strerror(errno))); -- netsnmp_unix_close(t); -- netsnmp_transport_free(t); -- return NULL; -+ if (!socket_initialized) { -+ rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN); -+ if (rc != 0) { -+ DEBUGMSGTL(("netsnmp_unix_transport", -+ "couldn't listen to \"%s\", errno %d (%s)\n", -+ addr->sun_path, errno, strerror(errno))); -+ netsnmp_unix_close(t); -+ netsnmp_transport_free(t); -+ return NULL; -+ } - } - - } else { -diff --git a/win32/libsnmp/Makefile.in b/win32/libsnmp/Makefile.in -index 98d83c8..b228d20 100644 ---- a/win32/libsnmp/Makefile.in -+++ b/win32/libsnmp/Makefile.in -@@ -42,6 +42,7 @@ LIB32_OBJS= \ - "$(INTDIR)\read_config.obj" \ - "$(INTDIR)\readdir.obj" \ - "$(INTDIR)\scapi.obj" \ -+ "$(INTDIR)\sd-daemon.obj" \ - "$(INTDIR)\snmp-tc.obj" \ - "$(INTDIR)\snmp.obj" \ - "$(INTDIR)\snmpCallbackDomain.obj" \ -@@ -138,6 +139,11 @@ SOURCE=..\..\snmplib\asn1.c - "$(INTDIR)\asn1.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - -+SOURCE=..\..\snmplib\sd-daemon.c -+ -+"$(INTDIR)\sd-daemon.obj" : $(SOURCE) "$(INTDIR)" -+ $(CPP) $(CPP_PROJ) $(SOURCE) -+ - - SOURCE=..\..\snmplib\callback.c - -diff --git a/win32/net-snmp/net-snmp-config.h b/win32/net-snmp/net-snmp-config.h -index 1608563..7aec547 100644 ---- a/win32/net-snmp/net-snmp-config.h -+++ b/win32/net-snmp/net-snmp-config.h -@@ -1717,6 +1717,8 @@ enum { - #define DMALLOC_FUNC_CHECK - #endif - -++#define NETSNMP_NO_SYSTEMD -++ - /* #undef NETSNMP_ENABLE_LOCAL_SMUX */ - - /* define if agentx transport is to use domain sockets only */ -diff --git a/win32/net-snmp/net-snmp-config.h.in b/win32/net-snmp/net-snmp-config.h.in -index 9693730..96ec3d9 100644 ---- a/win32/net-snmp/net-snmp-config.h.in -+++ b/win32/net-snmp/net-snmp-config.h.in -@@ -1717,6 +1717,8 @@ enum { - #define DMALLOC_FUNC_CHECK - #endif - -+#define NETSNMP_NO_SYSTEMD -+ - /* #undef NETSNMP_ENABLE_LOCAL_SMUX */ - - /* define if agentx transport is to use domain sockets only */ --- -1.8.4.2 - diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.8.bb b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb index 67316db0d2..395b02df00 100644 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.8.bb +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb @@ -1,11 +1,12 @@ SUMMARY = "Various tools relating to the Simple Network Management Protocol" HOMEPAGE = "http://www.net-snmp.org/" SECTION = "net" -LICENSE = "BSD & MIT" +LICENSE = "BSD-3-Clause & MIT" LIC_FILES_CHKSUM = "file://COPYING;md5=9d100a395a38584f2ec18a8275261687" -DEPENDS = "openssl libnl pciutils" +DEPENDS = "openssl" +DEPENDS:append:class-target = " pciutils" SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.tar.gz \ file://init \ @@ -13,25 +14,22 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.tar.gz \ file://snmptrapd.conf \ file://snmpd.service \ file://snmptrapd.service \ - file://net-snmp-add-knob-whether-nlist.h-are-checked.patch \ - file://fix-libtool-finish.patch \ - file://net-snmp-testing-add-the-output-format-for-ptest.patch \ file://run-ptest \ - file://0001-config_os_headers-Error-Fix.patch \ - file://0001-snmplib-keytools.c-Don-t-check-for-return-from-EVP_M.patch \ - file://0001-get_pid_from_inode-Include-limit.h.patch \ - file://0002-configure-fix-a-cc-check-issue.patch \ - file://0004-configure-fix-incorrect-variable.patch \ - 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 \ - file://CVE-2019-20892.patch \ - " -SRC_URI[md5sum] = "63bfc65fbb86cdb616598df1aff6458a" -SRC_URI[sha256sum] = "b2fc3500840ebe532734c4786b0da4ef0a5f67e51ef4c86b3345d697e4976adf" + file://0001-net-snmp-add-knob-whether-nlist.h-are-checked.patch \ + file://0002-net-snmp-fix-libtool-finish.patch \ + file://0003-testing-add-the-output-format-for-ptest.patch \ + file://0004-config_os_headers-Error-Fix.patch \ + file://0005-snmplib-keytools.c-Don-t-check-for-return-from-EVP_M.patch \ + file://0006-get_pid_from_inode-Include-limit.h.patch \ + file://0007-configure-fix-incorrect-variable.patch \ + file://0008-net-snmp-fix-engineBoots-value-on-SIGHUP.patch \ + file://0009-net-snmp-fix-for-disable-des.patch \ + file://0010-net-snmp-Reproducibility-Don-t-check-build-host-for.patch \ + file://0011-ac_add_search_path.m4-keep-consistent-between-32bit-.patch \ + file://0012-Fix-configuration-of-NETSNMP_FD_MASK_TYPE.patch \ + file://0001-Android-Fix-the-build.patch \ + " +SRC_URI[sha256sum] = "8b4de01391e74e3c7014beb43961a2d6d6fa03acc34280b9585f4930745b0544" UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/net-snmp/files/net-snmp/" UPSTREAM_CHECK_REGEX = "/net-snmp/(?P<pver>\d+(\.\d+)+)/" @@ -42,30 +40,31 @@ EXTRA_OEMAKE = "INSTALL_PREFIX=${D} OTHERLDFLAGS='${LDFLAGS}' HOST_CPPFLAGS='${B PARALLEL_MAKE = "" CCACHE = "" +CLEANBROKEN = "1" TARGET_CC_ARCH += "${LDFLAGS}" -PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} des" +PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 systemd', d)} des smux" +PACKAGECONFIG[des] = "--enable-des, --disable-des" PACKAGECONFIG[elfutils] = "--with-elf, --without-elf, elfutils" +PACKAGECONFIG[ipv6] = "--enable-ipv6, --disable-ipv6" PACKAGECONFIG[libnl] = "--with-nl, --without-nl, libnl" - -PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,," - -PACKAGECONFIG[perl] = "--enable-embedded-perl --with-perl-modules=yes, --disable-embedded-perl --with-perl-modules=no,\ - perl," -PACKAGECONFIG[des] = "--enable-des,--disable-des" - -EXTRA_OECONF = "--enable-shared \ - --disable-manuals \ - --with-defaults \ - --with-install-prefix=${D} \ - --with-persistent-directory=${localstatedir}/lib/net-snmp \ - ${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', '--with-endianness=little', '--with-endianness=big', d)} \ - --with-openssl=${STAGING_EXECPREFIXDIR} \ +PACKAGECONFIG[perl] = "--enable-embedded-perl --with-perl-modules=yes, --disable-embedded-perl --with-perl-modules=no, perl" +PACKAGECONFIG[smux] = "" +PACKAGECONFIG[systemd] = "--with-systemd, --without-systemd" + +EXTRA_OECONF = " \ + --enable-shared \ + --disable-manuals \ + --with-defaults \ + --with-install-prefix=${D} \ + --with-persistent-directory=${localstatedir}/lib/net-snmp \ + --with-endianness=${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', 'little', 'big', d)} \ + --with-mib-modules='${MIB_MODULES}' \ " -# net-snmp needs to have mib-modules=smux enabled to enable quagga to support snmp -EXTRA_OECONF += "--with-mib-modules=smux" +MIB_MODULES = "" +MIB_MODULES:append = " ${@bb.utils.filter('PACKAGECONFIG', 'smux', d)}" CACHED_CONFIGUREVARS = " \ ac_cv_header_valgrind_valgrind_h=no \ @@ -73,17 +72,20 @@ CACHED_CONFIGUREVARS = " \ ac_cv_ETC_MNTTAB=/etc/mtab \ lt_cv_shlibpath_overrides_runpath=yes \ ac_cv_path_UNAMEPROG=${base_bindir}/uname \ + ac_cv_path_PSPROG=${base_bindir}/ps \ ac_cv_file__etc_printcap=no \ NETSNMP_CONFIGURE_OPTIONS= \ " -export PERLPROG="${bindir}/env perl" -PERLPROG_append = "${@bb.utils.contains('PACKAGECONFIG', 'perl', ' -I${WORKDIR}', '', d)}" +PERLPROG = "${bindir}/env perl" +PERLPROG:class-native = "${bindir_native}/env perl" +PERLPROG:append = "${@bb.utils.contains('PACKAGECONFIG', 'perl', ' -I${WORKDIR}', '', d)}" +export PERLPROG HAS_PERL = "${@bb.utils.contains('PACKAGECONFIG', 'perl', '1', '0', d)}" PTEST_BUILD_HOST_FILES += "net-snmp-config gen-variables" -do_configure_prepend() { +do_configure:prepend() { sed -i -e "s|I/usr/include|I${STAGING_INCDIR}|g" \ "${S}"/configure \ "${S}"/configure.d/config_os_libs2 @@ -104,15 +106,14 @@ do_configure_prepend() { } -do_configure_append() { - if [ "${HAS_PERL}" = "1" ]; then - sed -e "s@^NSC_INCLUDEDIR=.*@NSC_INCLUDEDIR=${STAGING_DIR_TARGET}\$\{includedir\}@g" \ - -e "s@^NSC_LIBDIR=-L.*@NSC_LIBDIR=-L${STAGING_DIR_TARGET}\$\{libdir\}@g" \ - -i ${B}/net-snmp-config - fi +do_configure:append() { + sed -e "s@^NSC_INCLUDEDIR=.*@NSC_INCLUDEDIR=${STAGING_DIR_TARGET}\$\{includedir\}@g" \ + -e "s@^NSC_LIBDIR=-L.*@NSC_LIBDIR=-L${STAGING_DIR_TARGET}\$\{libdir\}@g" \ + -e "s@^NSC_LDFLAGS=\"-L.* @NSC_LDFLAGS=\"-L${STAGING_DIR_TARGET}\$\{libdir\} @g" \ + -i ${B}/net-snmp-config } -do_install_append() { +do_install:append() { install -d ${D}${sysconfdir}/snmp install -d ${D}${sysconfdir}/init.d install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/snmpd @@ -121,9 +122,10 @@ do_install_append() { install -d ${D}${systemd_unitdir}/system install -m 0644 ${WORKDIR}/snmpd.service ${D}${systemd_unitdir}/system install -m 0644 ${WORKDIR}/snmptrapd.service ${D}${systemd_unitdir}/system - sed -e "s@^NSC_SRCDIR=.*@NSC_SRCDIR=.@g" \ + sed -e "s@^NSC_SRCDIR=.*@NSC_SRCDIR=.@g" \ -i ${D}${bindir}/net-snmp-create-v3-user sed -e 's@^NSC_SRCDIR=.*@NSC_SRCDIR=.@g' \ + -e 's@[^ ]*-ffile-prefix-map=[^ "]*@@g' \ -e 's@[^ ]*-fdebug-prefix-map=[^ "]*@@g' \ -e 's@[^ ]*-fmacro-prefix-map=[^ "]*@@g' \ -e 's@[^ ]*--sysroot=[^ "]*@@g' \ @@ -131,17 +133,32 @@ do_install_append() { -e 's@[^ ]*--with-install-prefix=[^ "]*@@g' \ -e 's@[^ ]*PKG_CONFIG_PATH=[^ "]*@@g' \ -e 's@[^ ]*PKG_CONFIG_LIBDIR=[^ "]*@@g' \ - -e 's@-L${STAGING_DIR_HOST}${libdir}@@g' \ - -e 's@-I${STAGING_DIR_HOST}${includedir}@@g' \ -i ${D}${bindir}/net-snmp-config - if [ "${HAS_PERL}" = "1" ]; then - sed -e "s@^NSC_INCLUDEDIR=.*@NSC_INCLUDEDIR=\$\{includedir\}@g" \ - -e "s@^NSC_LIBDIR=-L.*@NSC_LIBDIR=-L\$\{libdir\}@g" \ - -i ${D}${bindir}/net-snmp-config + sed -e 's@[^ ]*-ffile-prefix-map=[^ "]*@@g' \ + -e 's@[^ ]*-fdebug-prefix-map=[^ "]*@@g' \ + -e 's@[^ ]*-fmacro-prefix-map=[^ "]*@@g' \ + -i ${D}${libdir}/pkgconfig/netsnmp*.pc + + # ${STAGING_DIR_HOST} is empty for native builds, and the sed command below + # will result in errors if run for native. + if [ "${STAGING_DIR_HOST}" ]; then + sed -e 's@${STAGING_DIR_HOST}@@g' \ + -i ${D}${bindir}/net-snmp-config ${D}${libdir}/pkgconfig/netsnmp*.pc fi + sed -e "s@^NSC_INCLUDEDIR=.*@NSC_INCLUDEDIR=\$\{includedir\}@g" \ + -e "s@^NSC_LIBDIR=-L.*@NSC_LIBDIR=-L\$\{libdir\}@g" \ + -e "s@^NSC_LDFLAGS=\"-L.* @NSC_LDFLAGS=\"-L\$\{libdir\} @g" \ + -i ${D}${bindir}/net-snmp-config + + sed -i -e 's:${HOSTTOOLS_DIR}/::g' ${D}${bindir}/net-snmp-create-v3-user + oe_multilib_header net-snmp/net-snmp-config.h + + if [ "${HAS_PERL}" = "1" ]; then + find ${D}${libdir}/ -type f -name "perllocal.pod" | xargs rm -f + fi } do_install_ptest() { @@ -163,7 +180,7 @@ do_install_ptest() { } SYSROOT_PREPROCESS_FUNCS += "net_snmp_sysroot_preprocess" -SNMP_DBGDIR = "/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}" +SNMP_DBGDIR = "${TARGET_DBGSRC_DIR}" net_snmp_sysroot_preprocess () { if [ -e ${D}${bindir}/net-snmp-config ]; then @@ -175,6 +192,7 @@ net_snmp_sysroot_preprocess () { -e "s@^includedir=.*@includedir=${STAGING_INCDIR}@g" \ -e "s@^libdir=.*@libdir=${STAGING_LIBDIR}@g" \ -e "s@^NSC_SRCDIR=.*@NSC_SRCDIR=${S}@g" \ + -e "s@-ffile-prefix-map=${SNMP_DBGDIR}@-ffile-prefix-map=${WORKDIR}=${SNMP_DBGDIR}@g" \ -e "s@-fdebug-prefix-map=${SNMP_DBGDIR}@-fdebug-prefix-map=${WORKDIR}=${SNMP_DBGDIR}@g" \ -e "s@-fdebug-prefix-map= -fdebug-prefix-map=@-fdebug-prefix-map=${STAGING_DIR_NATIVE}= \ -fdebug-prefix-map=${STAGING_DIR_HOST}=@g" \ @@ -193,86 +211,86 @@ PACKAGES += "${PN}-libs ${PN}-mibs ${PN}-server ${PN}-client \ # perl module PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'perl', '${PN}-perl-modules', '', d)}" -ALLOW_EMPTY_${PN} = "1" -ALLOW_EMPTY_${PN}-server = "1" -ALLOW_EMPTY_${PN}-libs = "1" +ALLOW_EMPTY:${PN} = "1" +ALLOW_EMPTY:${PN}-server = "1" +ALLOW_EMPTY:${PN}-libs = "1" -FILES_${PN}-perl-modules = "${libdir}/perl?/*" -RDEPENDS_${PN}-perl-modules = "perl" +FILES:${PN}-perl-modules = "${libdir}/perl?/*" +RDEPENDS:${PN}-perl-modules = "perl" -FILES_${PN}-libs = "" -FILES_${PN}-mibs = "${datadir}/snmp/mibs" -FILES_${PN}-server-snmpd = "${sbindir}/snmpd \ +FILES:${PN}-libs = "" +FILES:${PN}-mibs = "${datadir}/snmp/mibs" +FILES:${PN}-server-snmpd = "${sbindir}/snmpd \ ${sysconfdir}/snmp/snmpd.conf \ ${sysconfdir}/init.d \ ${systemd_unitdir}/system/snmpd.service \ " -FILES_${PN}-server-snmptrapd = "${sbindir}/snmptrapd \ +FILES:${PN}-server-snmptrapd = "${sbindir}/snmptrapd \ ${sysconfdir}/snmp/snmptrapd.conf \ ${systemd_unitdir}/system/snmptrapd.service \ " -FILES_${PN}-lib-netsnmp = "${libdir}/libnetsnmp${SOLIBS}" -FILES_${PN}-lib-agent = "${libdir}/libnetsnmpagent${SOLIBS}" -FILES_${PN}-lib-helpers = "${libdir}/libnetsnmphelpers${SOLIBS}" -FILES_${PN}-lib-mibs = "${libdir}/libnetsnmpmibs${SOLIBS}" -FILES_${PN}-lib-trapd = "${libdir}/libnetsnmptrapd${SOLIBS}" +FILES:${PN}-lib-netsnmp = "${libdir}/libnetsnmp${SOLIBS}" +FILES:${PN}-lib-agent = "${libdir}/libnetsnmpagent${SOLIBS}" +FILES:${PN}-lib-helpers = "${libdir}/libnetsnmphelpers${SOLIBS}" +FILES:${PN}-lib-mibs = "${libdir}/libnetsnmpmibs${SOLIBS}" +FILES:${PN}-lib-trapd = "${libdir}/libnetsnmptrapd${SOLIBS}" -FILES_${PN} = "" -FILES_${PN}-client = "${bindir}/* ${datadir}/snmp/" -FILES_${PN}-dbg += "${libdir}/.debug/ ${sbindir}/.debug/ ${bindir}/.debug/" -FILES_${PN}-dev += "${bindir}/mib2c \ +FILES:${PN} = "" +FILES:${PN}-client = "${bindir}/* ${datadir}/snmp/" +FILES:${PN}-dbg += "${libdir}/.debug/ ${sbindir}/.debug/ ${bindir}/.debug/" +FILES:${PN}-dev += "${bindir}/mib2c \ ${bindir}/mib2c-update \ ${bindir}/net-snmp-config \ ${bindir}/net-snmp-create-v3-user \ " -CONFFILES_${PN}-server-snmpd = "${sysconfdir}/snmp/snmpd.conf" -CONFFILES_${PN}-server-snmptrapd = "${sysconfdir}/snmp/snmptrapd.conf" +CONFFILES:${PN}-server-snmpd = "${sysconfdir}/snmp/snmpd.conf" +CONFFILES:${PN}-server-snmptrapd = "${sysconfdir}/snmp/snmptrapd.conf" INITSCRIPT_PACKAGES = "${PN}-server-snmpd" -INITSCRIPT_NAME_${PN}-server-snmpd = "snmpd" -INITSCRIPT_PARAMS_${PN}-server-snmpd = "start 90 2 3 4 5 . stop 60 0 1 6 ." - -EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--with-systemd', '--without-systemd', d)}" +INITSCRIPT_NAME:${PN}-server-snmpd = "snmpd" +INITSCRIPT_PARAMS:${PN}-server-snmpd = "start 90 2 3 4 5 . stop 60 0 1 6 ." SYSTEMD_PACKAGES = "${PN}-server-snmpd \ ${PN}-server-snmptrapd" -SYSTEMD_SERVICE_${PN}-server-snmpd = "snmpd.service" -SYSTEMD_SERVICE_${PN}-server-snmptrapd = "snmptrapd.service" +SYSTEMD_SERVICE:${PN}-server-snmpd = "snmpd.service" +SYSTEMD_SERVICE:${PN}-server-snmptrapd = "snmptrapd.service" -RDEPENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'perl', 'net-snmp-perl-modules', '', d)}" -RDEPENDS_${PN} += "net-snmp-client" -RDEPENDS_${PN}-server-snmpd += "net-snmp-mibs" -RDEPENDS_${PN}-server-snmptrapd += "net-snmp-server-snmpd ${PN}-lib-trapd" -RDEPENDS_${PN}-server += "net-snmp-server-snmpd net-snmp-server-snmptrapd" -RDEPENDS_${PN}-client += "net-snmp-mibs net-snmp-libs" -RDEPENDS_${PN}-libs += "libpci \ +RDEPENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'perl', 'net-snmp-perl-modules', '', d)}" +RDEPENDS:${PN} += "net-snmp-client" +RDEPENDS:${PN}-server-snmpd += "net-snmp-mibs" +RDEPENDS:${PN}-server-snmptrapd += "net-snmp-server-snmpd ${PN}-lib-trapd" +RDEPENDS:${PN}-server += "net-snmp-server-snmpd net-snmp-server-snmptrapd" +RDEPENDS:${PN}-client += "net-snmp-mibs net-snmp-libs" +RDEPENDS:${PN}-libs += "libpci \ ${PN}-lib-netsnmp \ ${PN}-lib-agent \ ${PN}-lib-helpers \ ${PN}-lib-mibs \ " -RDEPENDS_${PN}-ptest += "perl \ +RDEPENDS:${PN}-ptest += "perl \ perl-module-test \ perl-module-file-basename \ perl-module-getopt-long \ perl-module-file-temp \ perl-module-data-dumper \ " -RDEPENDS_${PN}-dev = "net-snmp-client (= ${EXTENDPKGV}) net-snmp-server (= ${EXTENDPKGV})" -RRECOMMENDS_${PN}-dbg = "net-snmp-client (= ${EXTENDPKGV}) net-snmp-server (= ${EXTENDPKGV})" +RDEPENDS:${PN}-dev = "net-snmp-client (= ${EXTENDPKGV}) net-snmp-server (= ${EXTENDPKGV})" +RRECOMMENDS:${PN}-dbg = "net-snmp-client (= ${EXTENDPKGV}) net-snmp-server (= ${EXTENDPKGV})" -RPROVIDES_${PN}-server-snmpd += "${PN}-server-snmpd-systemd" -RREPLACES_${PN}-server-snmpd += "${PN}-server-snmpd-systemd" -RCONFLICTS_${PN}-server-snmpd += "${PN}-server-snmpd-systemd" +RPROVIDES:${PN}-server-snmpd += "${PN}-server-snmpd-systemd" +RREPLACES:${PN}-server-snmpd += "${PN}-server-snmpd-systemd" +RCONFLICTS:${PN}-server-snmpd += "${PN}-server-snmpd-systemd" -RPROVIDES_${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd" -RREPLACES_${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd" -RCONFLICTS_${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd" +RPROVIDES:${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd" +RREPLACES:${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd" +RCONFLICTS:${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd" LEAD_SONAME = "libnetsnmp.so" MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/net-snmp-config" + +BBCLASSEXTEND = "native" diff --git a/meta-networking/recipes-protocols/nopoll/nopoll_0.4.6.b400.bb b/meta-networking/recipes-protocols/nopoll/nopoll_0.4.6.b400.bb index 8c57d29492..816e513a15 100644 --- a/meta-networking/recipes-protocols/nopoll/nopoll_0.4.6.b400.bb +++ b/meta-networking/recipes-protocols/nopoll/nopoll_0.4.6.b400.bb @@ -7,7 +7,7 @@ noPoll provides support for WebSocket (ws://) and TLS (secure) WebSocket (wss:// allowing message based (handler notified) programming or stream oriented access." HOMEPAGE = "http://www.aspl.es/nopoll/" -LICENSE = "LGPL-2.1" +LICENSE = "LGPL-2.1-only" LIC_FILES_CHKSUM = "file://COPYING;md5=f0504124678c1b3158146e0630229298 \ " DEPENDS = "openssl" diff --git a/meta-networking/recipes-protocols/opcua/open62541/0001-fix-build-do-not-install-git-files.patch b/meta-networking/recipes-protocols/opcua/open62541/0001-fix-build-do-not-install-git-files.patch new file mode 100644 index 0000000000..b93e311054 --- /dev/null +++ b/meta-networking/recipes-protocols/opcua/open62541/0001-fix-build-do-not-install-git-files.patch @@ -0,0 +1,24 @@ +From a490e82dca5a669b0af27a13d74759d8f77e2333 Mon Sep 17 00:00:00 2001 +From: Vyacheslav Yurkov <v.yurkov@precitec.de> +Date: Mon, 3 Oct 2022 18:25:15 +0200 +Subject: [PATCH] fix(build): do not install git files + +Signed-off-by: Vyacheslav Yurkov <v.yurkov@precitec.de> +--- +Upstream-Status: Backport [https://github.com/open62541/open62541/commit/a0328d4cb527f9778a262fc4a6b42bfbdffc38e9] + + CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1934374e..bc5c8bad 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1703,6 +1703,7 @@ install(DIRECTORY ${UA_install_tools_dirs} + FILES_MATCHING + PATTERN "*" + PATTERN "*.pyc" EXCLUDE ++ PATTERN ".git*" EXCLUDE + ) + + install(FILES ${UA_install_tools_files} DESTINATION ${open62541_install_tools_dir}) diff --git a/meta-networking/recipes-protocols/opcua/open62541_1.3.8.bb b/meta-networking/recipes-protocols/opcua/open62541_1.3.8.bb new file mode 100644 index 0000000000..19a50aee3a --- /dev/null +++ b/meta-networking/recipes-protocols/opcua/open62541_1.3.8.bb @@ -0,0 +1,53 @@ +DESCRIPTION = "open62541 is an implementation of OPC UA (OPC Unified Architecture)" +HOMEPAGE = "https://github.com/open62541/open62541.git" +LICENSE = "MPL-2.0 & BSD-3-Clause & MIT" +LIC_FILES_CHKSUM = "\ + file://LICENSE;md5=815ca599c9df247a0c7f619bab123dad \ + file://deps/mdnsd/LICENSE;md5=3bb4047dc4095cd7336de3e2a9be94f0 \ + file://deps/mqtt-c/LICENSE;md5=9226377baf0b79174c89a1ab55592456 \ +" + +SRCREV_FORMAT = "opcua_mdnsd_ua-nodeset_mqtt-c" +SRCREV_opcua = "086b1557d6f49e8a82c999054a7da77d080cd54e" +SRCREV_mdnsd = "3151afe5899dba5125dffa9f4cf3ae1fe2edc0f0" +SRCREV_ua-nodeset = "f71b3f411d5cb16097c3ae0c744f67ad45535ffb" +SRCREV_mqtt-c = "f69ce1e7fd54f3b1834c9c9137ce0ec5d703cb4d" + +SRC_URI = " \ + git://github.com/open62541/open62541.git;name=opcua;branch=1.3;protocol=https \ + git://github.com/Pro/mdnsd.git;name=mdnsd;protocol=https;branch=master;destsuffix=git/deps/mdnsd \ + git://github.com/OPCFoundation/UA-Nodeset;name=ua-nodeset;protocol=https;branch=v1.04;destsuffix=git/deps/ua-nodeset \ + git://github.com/LiamBindle/MQTT-C.git;name=mqtt-c;protocol=https;branch=master;destsuffix=git/deps/mqtt-c \ + file://0001-fix-build-do-not-install-git-files.patch \ +" + +S = "${WORKDIR}/git" + +inherit cmake python3native + +EXTRA_OECMAKE += "\ + -DBUILD_SHARED_LIBS=ON \ + -DUA_NAMESPACE_ZERO=FULL \ + -DUA_LOGLEVEL=600 \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ +" + +PACKAGECONFIG ?= "encryption-mbedtls pubsub pubsub-eth subscriptions subscriptions-events" +PACKAGECONFIG[amalgamation] = "-DUA_ENABLE_AMALGAMATION=ON, -DUA_ENABLE_AMALGAMATION=OFF" +PACKAGECONFIG[encryption-mbedtls] = "-DUA_ENABLE_ENCRYPTION=MBEDTLS, , mbedtls, , , encryption-openssl" +PACKAGECONFIG[encryption-openssl] = "-DUA_ENABLE_ENCRYPTION=OPENSSL, , openssl, , , encryption-mbedtls" +PACKAGECONFIG[multithreading] = "-DUA_MULTITHREADING=100, -DUA_MULTITHREADING=0" +PACKAGECONFIG[pubsub] = "-DUA_ENABLE_PUBSUB=ON, -DUA_ENABLE_PUBSUB=OFF" +PACKAGECONFIG[pubsub-eth] = "-DUA_ENABLE_PUBSUB_ETH_UADP=ON, -DUA_ENABLE_PUBSUB_ETH_UADP=OFF" +PACKAGECONFIG[subscriptions] = "-DUA_ENABLE_SUBSCRIPTIONS=ON, -DUA_ENABLE_SUBSCRIPTIONS=OFF" +PACKAGECONFIG[subscriptions-events] = "-DUA_ENABLE_SUBSCRIPTIONS_EVENTS=ON, -DUA_ENABLE_SUBSCRIPTIONS_EVENTS=OFF" +PACKAGECONFIG[werror] = "-DUA_FORCE_WERROR=ON, -DUA_FORCE_WERROR=OFF" + +do_configure:prepend:toolchain-clang:riscv64() { + sed -i -e 's/set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)/set(CMAKE_INTERPROCEDURAL_OPTIMIZATION OFF)/' ${S}/CMakeLists.txt +} + +do_configure:prepend:toolchain-clang:riscv32() { + sed -i -e 's/set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)/set(CMAKE_INTERPROCEDURAL_OPTIMIZATION OFF)/' ${S}/CMakeLists.txt +} + diff --git a/meta-networking/recipes-protocols/openflow/openflow.inc b/meta-networking/recipes-protocols/openflow/openflow.inc deleted file mode 100644 index cccbfa19a6..0000000000 --- a/meta-networking/recipes-protocols/openflow/openflow.inc +++ /dev/null @@ -1,37 +0,0 @@ -SUMMARY = "OpenFlow communications protocol" -DESCRIPTION = "\ -Open standard that enables researchers to run experimental protocols in \ -contained networks. OpenFlow is a communications interface between \ -control and forwarding planes of a software-defined networking architecture.\ -" -HOMEPAGE = "http://www.openflow.org" - -SECTION = "net" -LICENSE = "GPLv2" - -LIC_FILES_CHKSUM = "file://COPYING;md5=e870c934e2c3d6ccf085fd7cf0a1e2e2" - -SRC_URI = "git://gitosis.stanford.edu/openflow.git;protocol=git" - -DEPENDS = "virtual/libc" - -PACKAGECONFIG ??= "openssl" -PACKAGECONFIG[openssl] = "--enable-ssl,--disable-ssl, openssl openssl-native, libssl" - -EXTRA_OECONF += " \ - KARCH=${TARGET_ARCH} \ - ${@bb.utils.contains('PACKAGECONFIG', 'openssl', 'SSL_LIBS="-lssl -lcrypto"', '', d)} \ - " - -S = "${WORKDIR}/git" - -inherit autotools-brokensep pkgconfig - -do_configure_prepend() { - ./boot.sh -} - -do_install_append() { - # Remove /var/run as it is created on startup - rm -rf ${D}${localstatedir}/run -} diff --git a/meta-networking/recipes-protocols/openflow/openflow/0001-Check-and-use-strlcpy-from-libc-before-defining-own.patch b/meta-networking/recipes-protocols/openflow/openflow/0001-Check-and-use-strlcpy-from-libc-before-defining-own.patch index 952274bb97..2175a20b90 100644 --- a/meta-networking/recipes-protocols/openflow/openflow/0001-Check-and-use-strlcpy-from-libc-before-defining-own.patch +++ b/meta-networking/recipes-protocols/openflow/openflow/0001-Check-and-use-strlcpy-from-libc-before-defining-own.patch @@ -9,6 +9,8 @@ failures. Signed-off-by: Khem Raj <raj.khem@gmail.com> --- +Upstream-Status: Pending + configure.ac | 2 +- lib/util.c | 2 ++ lib/util.h | 1 + diff --git a/meta-networking/recipes-protocols/openflow/openflow/0001-Makefile.am-Specify-export-dynamic-directly-to-linke.patch b/meta-networking/recipes-protocols/openflow/openflow/0001-Makefile.am-Specify-export-dynamic-directly-to-linke.patch new file mode 100644 index 0000000000..27fc05f09d --- /dev/null +++ b/meta-networking/recipes-protocols/openflow/openflow/0001-Makefile.am-Specify-export-dynamic-directly-to-linke.patch @@ -0,0 +1,30 @@ +From 12bba388719c425d9b5cd970d4fabf01edf56aa4 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 7 Feb 2024 22:33:12 -0800 +Subject: [PATCH] Makefile.am: Specify export-dynamic directly to linker + +Fixes build with clang-18+ +| riscv64-yoe-linux-clang: error: unknown argument: '-export-dynamic' + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.am b/Makefile.am +index 97ac1f0..e557fe7 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -23,7 +23,7 @@ if NDEBUG + AM_CPPFLAGS += -DNDEBUG + AM_CFLAGS += -fomit-frame-pointer + else +-AM_LDFLAGS = -export-dynamic ++AM_LDFLAGS = -Wl,--export-dynamic + endif + + CLEANFILES = +-- +2.43.0 + diff --git a/meta-networking/recipes-protocols/openflow/openflow/0001-socket-util-Include-sys-stat.h-for-fchmod.patch b/meta-networking/recipes-protocols/openflow/openflow/0001-socket-util-Include-sys-stat.h-for-fchmod.patch new file mode 100644 index 0000000000..97e3422166 --- /dev/null +++ b/meta-networking/recipes-protocols/openflow/openflow/0001-socket-util-Include-sys-stat.h-for-fchmod.patch @@ -0,0 +1,23 @@ +From b875c6e264eaf7350ad4e4ebf427692d8fd3cd72 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 29 Aug 2022 12:58:53 -0700 +Subject: [PATCH] socket-util: Include sys/stat.h for fchmod + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + lib/socket-util.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lib/socket-util.c b/lib/socket-util.c +index c7b5d6d..5b3d602 100644 +--- a/lib/socket-util.c ++++ b/lib/socket-util.c +@@ -42,6 +42,7 @@ + #include <stdio.h> + #include <string.h> + #include <sys/resource.h> ++#include <sys/stat.h> + #include <sys/un.h> + #include <unistd.h> + #include "fatal-signal.h" diff --git a/meta-networking/recipes-protocols/openflow/openflow/0002-lib-netdev-Adjust-header-include-sequence.patch b/meta-networking/recipes-protocols/openflow/openflow/0002-lib-netdev-Adjust-header-include-sequence.patch index 75180fe32f..9a49f4ef39 100644 --- a/meta-networking/recipes-protocols/openflow/openflow/0002-lib-netdev-Adjust-header-include-sequence.patch +++ b/meta-networking/recipes-protocols/openflow/openflow/0002-lib-netdev-Adjust-header-include-sequence.patch @@ -10,6 +10,8 @@ about double definition in libc headers Signed-off-by: Khem Raj <raj.khem@gmail.com> --- +Upstream-Status: Pending + lib/netdev.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/meta-networking/recipes-protocols/openflow/openflow_1.0.bb b/meta-networking/recipes-protocols/openflow/openflow_1.0.bb deleted file mode 100644 index a7e254dd85..0000000000 --- a/meta-networking/recipes-protocols/openflow/openflow_1.0.bb +++ /dev/null @@ -1,4 +0,0 @@ -include ${BPN}.inc - -SRCREV = "5ccca75a69f99791659bcfbcf35353ab1921320a" -PV = "1.0" diff --git a/meta-networking/recipes-protocols/openflow/openflow_git.bb b/meta-networking/recipes-protocols/openflow/openflow_git.bb index b6cef0730a..41bedcd0cf 100644 --- a/meta-networking/recipes-protocols/openflow/openflow_git.bb +++ b/meta-networking/recipes-protocols/openflow/openflow_git.bb @@ -1,10 +1,70 @@ -include ${BPN}.inc +SUMMARY = "OpenFlow communications protocol" +DESCRIPTION = "\ +Open standard that enables researchers to run experimental protocols in \ +contained networks. OpenFlow is a communications interface between \ +control and forwarding planes of a software-defined networking architecture.\ +" +HOMEPAGE = "http://www.openflow.org" -SRCREV = "c84f33f09d5dbcfc9b489f64cb30475bf36f653a" -PV = "1.0+git${SRCPV}" +SECTION = "net" +LICENSE = "GPL-2.0-only" -SRC_URI += "\ +LIC_FILES_CHKSUM = "file://COPYING;md5=e870c934e2c3d6ccf085fd7cf0a1e2e2" + +SRCREV = "82ad07d997b0b2ee70e1b2c7e82fcc6d0ccf23ea" + +PV = "1.0+git" + +SRC_URI = "git://github.com/mininet/openflow;protocol=https;branch=master \ file://0001-Check-and-use-strlcpy-from-libc-before-defining-own.patch \ file://0002-lib-netdev-Adjust-header-include-sequence.patch \ file://0001-generate-not-static-get_dh-functions.patch \ - " + file://0001-socket-util-Include-sys-stat.h-for-fchmod.patch \ + file://0001-Makefile.am-Specify-export-dynamic-directly-to-linke.patch \ +" +CVE_STATUS[CVE-2015-1611] = "not-applicable-config: Not referred to our implementation of openflow" +CVE_STATUS[CVE-2015-1612] = "not-applicable-config: Not referred to our implementation of openflow" +CVE_STATUS[CVE-2018-1078] = "cpe-incorrect: This CVE is not for this product but cve-check assumes it is \ +because two CPE collides when checking the NVD database" + +PACKAGECONFIG ??= "" +PACKAGECONFIG[openssl] = "--enable-ssl,--disable-ssl, openssl openssl-native, libssl" + +EXTRA_OECONF += " \ + KARCH=${TARGET_ARCH} \ + ${@bb.utils.contains('PACKAGECONFIG', 'openssl', 'SSL_LIBS="-lssl -lcrypto"', '', d)} \ + " + +DEPENDS:append:libc-musl = " libexecinfo" +LDFLAGS:append:libc-musl = " -lexecinfo" + +S = "${WORKDIR}/git" + +inherit autotools-brokensep pkgconfig + +do_configure:prepend() { + ./boot.sh +} + +do_install:append() { + # Remove /var/run as it is created on startup + rm -rf ${D}${localstatedir}/run + + # /var/log/openflow needs to be created in runtime. Use rmdir to catch if + # upstream stops creating /var/log/openflow, or adds something else in + # /var/log. + rmdir ${D}${localstatedir}/log/${BPN} ${D}${localstatedir}/log + rmdir --ignore-fail-on-non-empty ${D}${localstatedir} + + # Create /var/log/openflow in runtime. + if [ "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" ]; then + install -d ${D}${nonarch_libdir}/tmpfiles.d + echo "d ${localstatedir}/log/${BPN} - - - -" > ${D}${nonarch_libdir}/tmpfiles.d/${BPN}.conf + fi + if [ "${@bb.utils.filter('DISTRO_FEATURES', 'sysvinit', d)}" ]; then + install -d ${D}${sysconfdir}/default/volatiles + echo "d root root 0755 ${localstatedir}/log/${BPN} none" > ${D}${sysconfdir}/default/volatiles/99_${BPN} + fi +} + +FILES:${PN} += "${nonarch_libdir}/tmpfiles.d" diff --git a/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-Use-1-instead-of-WAIT_ANY.patch b/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-Use-1-instead-of-WAIT_ANY.patch index d1ee3c5916..8314b5d964 100644 --- a/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-Use-1-instead-of-WAIT_ANY.patch +++ b/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-Use-1-instead-of-WAIT_ANY.patch @@ -8,6 +8,8 @@ e.g. musl do not define this. Signed-off-by: Khem Raj <raj.khem@gmail.com> --- +Upstream-Status: Pending + usl/usl_pid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-l2tp_api-Included-needed-headers.patch b/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-l2tp_api-Included-needed-headers.patch index c50f68e65d..4bdbf458cd 100644 --- a/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-l2tp_api-Included-needed-headers.patch +++ b/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-l2tp_api-Included-needed-headers.patch @@ -7,6 +7,8 @@ These are flagged by musl Signed-off-by: Khem Raj <raj.khem@gmail.com> --- +Upstream-Status: Pending + l2tp_api.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-l2tp_rpc_server.c-Add-missing-prototype-for-l2tp_api.patch b/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-l2tp_rpc_server.c-Add-missing-prototype-for-l2tp_api.patch new file mode 100644 index 0000000000..d9aed8804a --- /dev/null +++ b/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-l2tp_rpc_server.c-Add-missing-prototype-for-l2tp_api.patch @@ -0,0 +1,28 @@ +From ded84ed583e9b0617bc35ab1798032d18b873144 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 29 Aug 2022 23:30:02 -0700 +Subject: [PATCH] l2tp_rpc_server.c: Add missing prototype for + l2tp_api_rpc_check_request + +Upstream-Status: Inappropriate [no upstream] + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + Makefile | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Makefile b/Makefile +index 0815b31..2fa5b2f 100644 +--- a/Makefile ++++ b/Makefile +@@ -236,6 +236,7 @@ endif + -$(RM) $@ $@.tmp + $(RPCGEN) $(RPCGENFLAGS) -m -o $@.tmp $< + cat $@.tmp | sed -e 's/switch (rqstp->rq_proc) {/if (l2tp_api_rpc_check_request(transp) < 0) return; switch (rqstp->rq_proc) {/' > $@ ++ sed -i '21i int l2tp_api_rpc_check_request(SVCXPRT *xprt);' $@ + + %_client.c: %.x + -$(RM) $@ +-- +2.37.2 + diff --git a/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-lex-yacc-Add-missing-function-prototypes.patch b/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-lex-yacc-Add-missing-function-prototypes.patch new file mode 100644 index 0000000000..8c21a742e0 --- /dev/null +++ b/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-lex-yacc-Add-missing-function-prototypes.patch @@ -0,0 +1,45 @@ +From 2bfdd02d288de92ff118bf41b54c135a6a318c19 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 29 Aug 2022 23:42:11 -0700 +Subject: [PATCH] lex/yacc: Add missing function prototypes + +Fixes build with clang15 + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + l2tp_config_parse.y | 3 +++ + l2tp_config_token.l | 3 +++ + 2 files changed, 6 insertions(+) + +diff --git a/l2tp_config_parse.y b/l2tp_config_parse.y +index 4baf1e0..15392d0 100644 +--- a/l2tp_config_parse.y ++++ b/l2tp_config_parse.y +@@ -29,6 +29,9 @@ static struct l2tp_api_session_msg_data session; + + extern void l2tp_log(int level, char *fmt, ...); + extern void yyfatal(const char *s); ++extern const char *l2tp_strerror(int error); ++extern int yylex (void); ++extern void yyerror(const char *s); + + %} + +diff --git a/l2tp_config_token.l b/l2tp_config_token.l +index 9016af6..43b8f0a 100644 +--- a/l2tp_config_token.l ++++ b/l2tp_config_token.l +@@ -15,6 +15,9 @@ + #include "l2tp_config_types.h" + #include "l2tp_config_parse.h" + ++extern void l2tp_log(int level, char *fmt, ...); ++extern const char *l2tp_strerror(int error); ++ + void yyfatal(const char *s); + void yyerror(const char *s); + +-- +2.37.2 + diff --git a/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-test-pppd_dummy.c-Fix-return-value.patch b/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-test-pppd_dummy.c-Fix-return-value.patch index 1f576fa710..42d6f58007 100644 --- a/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-test-pppd_dummy.c-Fix-return-value.patch +++ b/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-test-pppd_dummy.c-Fix-return-value.patch @@ -9,6 +9,8 @@ declaration Signed-off-by: Khem Raj <raj.khem@gmail.com> --- +Upstream-Status: Pending + test/pppd_dummy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meta-networking/recipes-protocols/openl2tp/openl2tp/0002-cli-include-fcntl.h-for-O_CREAT-define.patch b/meta-networking/recipes-protocols/openl2tp/openl2tp/0002-cli-include-fcntl.h-for-O_CREAT-define.patch index 9df32658a0..bad1007e04 100644 --- a/meta-networking/recipes-protocols/openl2tp/openl2tp/0002-cli-include-fcntl.h-for-O_CREAT-define.patch +++ b/meta-networking/recipes-protocols/openl2tp/openl2tp/0002-cli-include-fcntl.h-for-O_CREAT-define.patch @@ -5,6 +5,8 @@ Subject: [PATCH 2/4] cli: include fcntl.h for O_CREAT define Signed-off-by: Khem Raj <raj.khem@gmail.com> --- +Upstream-Status: Pending + cli/cli_readline.c | 1 + 1 file changed, 1 insertion(+) diff --git a/meta-networking/recipes-protocols/openl2tp/openl2tp/0002-user-ipv6-structures.patch b/meta-networking/recipes-protocols/openl2tp/openl2tp/0002-user-ipv6-structures.patch index bd9bcb8f27..6574ba22f0 100644 --- a/meta-networking/recipes-protocols/openl2tp/openl2tp/0002-user-ipv6-structures.patch +++ b/meta-networking/recipes-protocols/openl2tp/openl2tp/0002-user-ipv6-structures.patch @@ -8,6 +8,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> Update for ipv6 address compare Signed-off-by: Changqing Li <changqing.li@windriver.com> --- +Upstream-Status: Pending + l2tp_api.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/meta-networking/recipes-protocols/openl2tp/openl2tp/0003-cli-Define-_GNU_SOURCE-for-getting-sighandler_t.patch b/meta-networking/recipes-protocols/openl2tp/openl2tp/0003-cli-Define-_GNU_SOURCE-for-getting-sighandler_t.patch index e05be1bbb4..5d0c29cb42 100644 --- a/meta-networking/recipes-protocols/openl2tp/openl2tp/0003-cli-Define-_GNU_SOURCE-for-getting-sighandler_t.patch +++ b/meta-networking/recipes-protocols/openl2tp/openl2tp/0003-cli-Define-_GNU_SOURCE-for-getting-sighandler_t.patch @@ -5,6 +5,8 @@ Subject: [PATCH 3/4] cli: Define _GNU_SOURCE for getting sighandler_t Signed-off-by: Khem Raj <raj.khem@gmail.com> --- +Upstream-Status: Pending + cli/cli_readline.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta-networking/recipes-protocols/openl2tp/openl2tp/Makefile-modify-CFLAGS-to-aviod-build-error.patch b/meta-networking/recipes-protocols/openl2tp/openl2tp/Makefile-modify-CFLAGS-to-aviod-build-error.patch index 96dbc7551d..8e9bd1e9ee 100644 --- a/meta-networking/recipes-protocols/openl2tp/openl2tp/Makefile-modify-CFLAGS-to-aviod-build-error.patch +++ b/meta-networking/recipes-protocols/openl2tp/openl2tp/Makefile-modify-CFLAGS-to-aviod-build-error.patch @@ -3,7 +3,7 @@ From: Li xin <lixin.fnst@cn.fujitsu.com> Date: Mon, 1 Dec 2014 01:53:41 +0900 Subject: [PATCH] Makefile:modify CFLAGS to aviod build error. -Upstream-Status: pending +Upstream-Status: Pending Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com> --- diff --git a/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tp-simplify-gcc-warning-hack.patch b/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tp-simplify-gcc-warning-hack.patch index c11a127b81..2a7435963e 100644 --- a/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tp-simplify-gcc-warning-hack.patch +++ b/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tp-simplify-gcc-warning-hack.patch @@ -10,7 +10,7 @@ it in place but remove the #if guard since it is only there to ensure that the l2tp_private.h file is updated if the rpc source file is changed and the two get out of sync. -Upstream-status: pending +Upstream-Status: Pending Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com> --- diff --git a/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-enable-tests.patch b/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-enable-tests.patch index 0bece2f4d7..ad60083d1c 100644 --- a/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-enable-tests.patch +++ b/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-enable-tests.patch @@ -1,3 +1,5 @@ +Upstream-Status: Pending + commit 3e96a6c41bdd26417265a45ed685138d8eed564e Author: Aws Ismail <aws.ismail@windriver.com> Date: Fri Sep 14 02:32:53 2012 -0400 diff --git a/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-initscript-fix-sysconfig.patch b/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-initscript-fix-sysconfig.patch index 3119425e69..c094e3859b 100644 --- a/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-initscript-fix-sysconfig.patch +++ b/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-initscript-fix-sysconfig.patch @@ -2,17 +2,17 @@ commit 6ea3125e2bec15004f312814022335d94cdf7e94 Author: Aws Ismail <aws.ismail@windriver.com> Date: Wed Sep 19 11:34:48 2012 -0400 - Fix openl2tp config script location +Fix openl2tp config script location - Correct the location of the sysconfig - script. Use /etc/default/ instead of - /etc/sysconfig/ +Correct the location of the sysconfig +script. Use /etc/default/ instead of +/etc/sysconfig/ - Signed-off-by: Aws Ismail <aws.ismail@windriver.com> +Signed-off-by: Aws Ismail <aws.ismail@windriver.com> - Upstream-Status: Inappropriate [configuration] +Upstream-Status: Inappropriate [configuration] - Signed-off-by: Jackie Huang <jackie.huang@windriver.com> +Signed-off-by: Jackie Huang <jackie.huang@windriver.com> diff --git a/etc/rc.d/init.d/openl2tpd b/etc/rc.d/init.d/openl2tpd index 7f27bb7..4194f63 100755 diff --git a/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-initscript-fix.patch b/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-initscript-fix.patch index 9ecd4b072f..51bddb8942 100644 --- a/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-initscript-fix.patch +++ b/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-initscript-fix.patch @@ -2,16 +2,16 @@ commit 7c58a1e244ea83a9e7bbd51a6d354cee25cdbd33 Author: Aws Ismail <aws.ismail@windriver.com> Date: Wed Sep 12 23:35:40 2012 -0400 - Fix openl2tpd initscript - - - Correct the location of the retval statement. - - use start-stop-daemon instead of daemon. - - Signed-off-by: Aws Ismail <aws.ismail@windriver.com> +Fix openl2tpd initscript - Upstream-Status: Inappropriate [OE specific] +- Correct the location of the retval statement. +- use start-stop-daemon instead of daemon. - Signed-off-by: Jackie Huang <jackie.huang@windriver.com> +Signed-off-by: Aws Ismail <aws.ismail@windriver.com> + +Upstream-Status: Inappropriate [OE specific] + +Signed-off-by: Jackie Huang <jackie.huang@windriver.com> diff --git a/etc/rc.d/init.d/openl2tpd b/etc/rc.d/init.d/openl2tpd index ce21b50..7f27bb7 100755 diff --git a/meta-networking/recipes-protocols/openl2tp/openl2tp_1.8.bb b/meta-networking/recipes-protocols/openl2tp/openl2tp_1.8.bb index 9c0c28e197..183c0066df 100644 --- a/meta-networking/recipes-protocols/openl2tp/openl2tp_1.8.bb +++ b/meta-networking/recipes-protocols/openl2tp/openl2tp_1.8.bb @@ -9,7 +9,7 @@ HOMEPAGE = "http://www.openl2tp.org/" SECTION = "net" # cli and usl use license LGPL-2.1 -LICENSE = "GPL-2.0 & LGPL-2.1" +LICENSE = "GPL-2.0-only & LGPL-2.1-only" LIC_FILES_CHKSUM = "file://COPYING;md5=e9d9259cbbf00945adc25a470c1d3585 \ file://LICENSE;md5=f8970abd5ea9be701a0deedf5afd77a5 \ file://cli/LICENSE;md5=9c1387a3c5213aa40671438af3e00793 \ @@ -35,13 +35,15 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${PV}/${BP}.tar.gz \ file://run-ptest \ file://fix_linux_4.15_compile.patch \ file://0002-user-ipv6-structures.patch \ + file://0001-l2tp_rpc_server.c-Add-missing-prototype-for-l2tp_api.patch \ + file://0001-lex-yacc-Add-missing-function-prototypes.patch \ " SRC_URI[md5sum] = "e3d08dedfb9e6a9a1e24f6766f6dadd0" SRC_URI[sha256sum] = "1c97704d4b963a87fbc0e741668d4530933991515ae9ab0dffd11b5444f4860f" inherit autotools-brokensep pkgconfig systemd ptest -SYSTEMD_SERVICE_${PN} = "openl2tpd.service" +SYSTEMD_SERVICE:${PN} = "openl2tpd.service" SYSTEMD_AUTO_ENABLE = "disable" DEPENDS += "libtirpc" @@ -52,7 +54,7 @@ LDFLAGS += "-ltirpc" PARALLEL_MAKE = "" EXTRA_OEMAKE = 'CFLAGS="${CFLAGS} -Wno-unused-but-set-variable" CPPFLAGS="${CPPFLAGS}" OPT_CFLAGS="${CFLAGS}"' -do_compile_prepend() { +do_compile:prepend() { sed -i -e "s:SYS_LIBDIR=.*:SYS_LIBDIR=${libdir}:g" \ -e 's:$(CROSS_COMPILE)as:${AS}:g' \ -e 's:$(CROSS_COMPILE)ld:${LD}:g' \ @@ -65,7 +67,7 @@ do_compile_prepend() { ${S}/Makefile } -do_install_append () { +do_install:append () { install -d ${D}${sysconfdir}/init.d install -d ${D}${sysconfdir}/default install -m 0755 ${S}/etc/rc.d/init.d/openl2tpd ${D}${sysconfdir}/init.d/openl2tpd @@ -91,4 +93,4 @@ do_install_ptest () { done } -RDEPENDS_${PN} = "ppp ppp-l2tp bash" +RDEPENDS:${PN} = "ppp ppp-l2tp bash" diff --git a/meta-networking/recipes-protocols/openlldp/files/0001-Fix-musl-libc-build-issue.patch b/meta-networking/recipes-protocols/openlldp/files/0001-Fix-musl-libc-build-issue.patch index 40b082e77a..04ceb6b572 100644 --- a/meta-networking/recipes-protocols/openlldp/files/0001-Fix-musl-libc-build-issue.patch +++ b/meta-networking/recipes-protocols/openlldp/files/0001-Fix-musl-libc-build-issue.patch @@ -9,6 +9,8 @@ to compile when using musl libc. Signed-off-by: Jonathan Richardson <jonathan.richardson@broadcom.com> --- +Upstream-Status: Pending + include/clif.h | 1 + 1 file changed, 1 insertion(+) diff --git a/meta-networking/recipes-protocols/openlldp/files/0001-autotools-Add-include-path-to-generated-version.h.patch b/meta-networking/recipes-protocols/openlldp/files/0001-autotools-Add-include-path-to-generated-version.h.patch index b58fc104d2..f1a3ac3ad2 100644 --- a/meta-networking/recipes-protocols/openlldp/files/0001-autotools-Add-include-path-to-generated-version.h.patch +++ b/meta-networking/recipes-protocols/openlldp/files/0001-autotools-Add-include-path-to-generated-version.h.patch @@ -10,6 +10,8 @@ dir. Include the path to it in AM_CPPFLAGS. Signed-off-by: Jonathan Richardson <jonathan.richardson@broadcom.com> --- +Upstream-Status: Pending + Makefile.am | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta-networking/recipes-protocols/openlldp/files/0001-autotools-Add-option-to-disable-installation-of-syst.patch b/meta-networking/recipes-protocols/openlldp/files/0001-autotools-Add-option-to-disable-installation-of-syst.patch index a26a5299ab..b1d746f8bc 100644 --- a/meta-networking/recipes-protocols/openlldp/files/0001-autotools-Add-option-to-disable-installation-of-syst.patch +++ b/meta-networking/recipes-protocols/openlldp/files/0001-autotools-Add-option-to-disable-installation-of-syst.patch @@ -1,4 +1,4 @@ -From dc3f2250908587710f109c80ddf8a94f0bc40b82 Mon Sep 17 00:00:00 2001 +From 7147add9fedfb28909639ae419f995041d086266 Mon Sep 17 00:00:00 2001 From: Jonathan Richardson <jonathan.richardson@broadcom.com> Date: Fri, 6 Apr 2018 10:49:04 -0700 Subject: [PATCH] autotools: Add option to disable installation of systemd conf @@ -16,15 +16,17 @@ to a hard coded path that couldn't be changed. Signed-off-by: Jonathan Richardson <jonathan.richardson@broadcom.com> --- +Upstream-Status: Pending + Makefile.am | 3 ++- configure.ac | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am -index 292c0fd..0fb9bb0 100644 +index 86174e9..e90e966 100644 --- a/Makefile.am +++ b/Makefile.am -@@ -138,8 +138,9 @@ install-data-hook: installdirs-local +@@ -141,8 +141,9 @@ install-data-hook: installdirs-local pkgconfigdir = ${libdir}/pkgconfig pkgconfig_DATA = lldpad.pc liblldp_clif.pc @@ -36,10 +38,10 @@ index 292c0fd..0fb9bb0 100644 bashcompletiondir = $(sysconfdir)/bash_completion.d dist_bashcompletion_DATA = contrib/bash_completion/lldpad contrib/bash_completion/lldptool diff --git a/configure.ac b/configure.ac -index 0667446..f75f433 100644 +index fa2f3a0..1a038cd 100644 --- a/configure.ac +++ b/configure.ac -@@ -95,6 +95,15 @@ AC_TYPE_UINT16_T +@@ -132,6 +132,15 @@ AC_TYPE_UINT16_T AC_TYPE_UINT32_T AC_TYPE_UINT8_T diff --git a/meta-networking/recipes-protocols/openlldp/files/0004-clif-Include-string.h-for-mem-function-prototypes.patch b/meta-networking/recipes-protocols/openlldp/files/0004-clif-Include-string.h-for-mem-function-prototypes.patch new file mode 100644 index 0000000000..b6d9cf7707 --- /dev/null +++ b/meta-networking/recipes-protocols/openlldp/files/0004-clif-Include-string.h-for-mem-function-prototypes.patch @@ -0,0 +1,23 @@ +From d88aae2230683517b6d5b62cced51da81317a722 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 29 Aug 2022 22:37:14 -0700 +Subject: [PATCH] clif: Include string.h for mem* function prototypes + +Upstream-Status: Submitted [https://github.com/intel/openlldp/pull/86] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + clif.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/clif.c b/clif.c +index cad6f75..0758a7e 100644 +--- a/clif.c ++++ b/clif.c +@@ -32,6 +32,7 @@ + + #include <stdlib.h> + #include <stdio.h> ++#include <string.h> + #include <unistd.h> + #include <sys/types.h> + #include <sys/socket.h> diff --git a/meta-networking/recipes-protocols/openlldp/openlldp_1.0.1.bb b/meta-networking/recipes-protocols/openlldp/openlldp_1.1.1.bb index 5fbf0645e0..010cd5af84 100644 --- a/meta-networking/recipes-protocols/openlldp/openlldp_1.0.1.bb +++ b/meta-networking/recipes-protocols/openlldp/openlldp_1.1.1.bb @@ -2,7 +2,7 @@ SUMMARY = "Open-LLDP" DESCRIPTION = "Link Layer Discovery Protocol for Linux that includes support for DCBX" HOMEPAGE = "http://open-lldp.org/start" -LICENSE = "GPLv2" +LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://COPYING;md5=8c2bc283e65df398ced5f5b747e78162" S = "${WORKDIR}/git" @@ -12,22 +12,21 @@ inherit ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} DEPENDS = "libnl libconfig readline" -SRCREV = "36d729de7ce5b56cf061d94d610cf0510154820c" -SRC_URI = "git://github.com/intel/openlldp.git;protocol=https;branch=master \ +SRCREV = "f1dd9eb961fab06723d2bedb2f7e2b81e45ee9ab" +PV .= "+git" +SRC_URI = "git://github.com/intel/openlldp.git;protocol=https;branch=branch-1.1 \ 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://0004-clif-Include-string.h-for-mem-function-prototypes.patch \ " -# Makefile.am adds -Werror to AM_CFLAGS. There are warnings so disable it. -TARGET_CFLAGS += "-Wno-error" - # Enable install of systemd conf files. EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_system_unitdir}', '', d)}" -SYSTEMD_SERVICE_${PN} = "lldpad.service lldpad.socket" +SYSTEMD_SERVICE:${PN} = "lldpad.service lldpad.socket" # To enable service at boot set to enable in local.conf. SYSTEMD_AUTO_ENABLE ?= "disable" -RRECOMMENDS_${PN} = "iproute2-tc" +RRECOMMENDS:${PN} = "iproute2-tc" diff --git a/meta-networking/recipes-protocols/pptp-linux/pptp-linux_1.10.0.bb b/meta-networking/recipes-protocols/pptp-linux/pptp-linux_1.10.0.bb index 53a79af76d..0d26c338b9 100644 --- a/meta-networking/recipes-protocols/pptp-linux/pptp-linux_1.10.0.bb +++ b/meta-networking/recipes-protocols/pptp-linux/pptp-linux_1.10.0.bb @@ -6,7 +6,7 @@ DESCRIPTION = "PPTP Client is a Linux, FreeBSD, NetBSD \ cable and ADSL internet service providers." HOMEPAGE = "http://pptpclient.sourceforge.net" SECTION = "net" -LICENSE = "GPLv2+" +LICENSE = "GPL-2.0-or-later" LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" inherit perlnative @@ -29,4 +29,4 @@ do_install() { install -m 644 ${WORKDIR}/options.pptp ${D}${sysconfdir}/ppp } -RDEPENDS_${PN} = "ppp" +RDEPENDS:${PN} = "ppp" diff --git a/meta-networking/recipes-protocols/quagga/files/bgpd.service b/meta-networking/recipes-protocols/quagga/files/bgpd.service deleted file mode 100644 index c1021fbd71..0000000000 --- a/meta-networking/recipes-protocols/quagga/files/bgpd.service +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=BGP routing daemon -BindTo=zebra.service -After=zebra.service -ConditionPathExists=@SYSCONFDIR@/quagga/bgpd.conf - -[Service] -Type=forking -EnvironmentFile=-@SYSCONFDIR@/default/quagga -PIDFile=/run/quagga/bgpd.pid -ExecStart=@SBINDIR@/bgpd -d $bgpd_options -f @SYSCONFDIR@/quagga/bgpd.conf -ExecStopPost=@base_bindir@/rm -rf /run/quagga/bgpd.pid -Restart=on-abort - -[Install] -WantedBy=multi-user.target diff --git a/meta-networking/recipes-protocols/quagga/files/isisd.service b/meta-networking/recipes-protocols/quagga/files/isisd.service deleted file mode 100644 index 9bfe7b65ef..0000000000 --- a/meta-networking/recipes-protocols/quagga/files/isisd.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=IS-IS routing daemon -BindTo=zebra.service -After=zebra.service -ConditionPathExists=@SYSCONFDIR@/quagga/isisd.conf - -[Service] -Type=forking -EnvironmentFile=-@SYSCONFDIR@/default/quagga -ExecStart=@SBINDIR@/isisd -d $isisd_options -f /etc/quagga/isisd.conf -Restart=on-abort - -[Install] -WantedBy=multi-user.target diff --git a/meta-networking/recipes-protocols/quagga/files/ospf6d.service b/meta-networking/recipes-protocols/quagga/files/ospf6d.service deleted file mode 100644 index 99d0e6dcaf..0000000000 --- a/meta-networking/recipes-protocols/quagga/files/ospf6d.service +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=OSPF routing daemon for IPv6 -BindTo=zebra.service -After=zebra.service -ConditionPathExists=@SYSCONFDIR@/quagga/ospf6d.conf - -[Service] -Type=forking -EnvironmentFile=-@SYSCONFDIR@/default/quagga -PIDFile=/run/quagga/ospf6d.pid -ExecStart=@SBINDIR@/ospf6d -d $ospf6d_options -f @SYSCONFDIR@/quagga/ospf6d.conf -ExecStopPost=@base_bindir@/rm -rf /run/quagga/ospf6d.pid -Restart=on-abort - -[Install] -WantedBy=multi-user.target diff --git a/meta-networking/recipes-protocols/quagga/files/ospfd.service b/meta-networking/recipes-protocols/quagga/files/ospfd.service deleted file mode 100644 index fe8343be1c..0000000000 --- a/meta-networking/recipes-protocols/quagga/files/ospfd.service +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=OSPF routing daemon -BindTo=zebra.service -After=zebra.service -ConditionPathExists=@SYSCONFDIR@/quagga/ospfd.conf - -[Service] -Type=forking -EnvironmentFile=-@SYSCONFDIR@/default/quagga -PIDFile=/run/quagga/ospfd.pid -ExecStart=@SBINDIR@/ospfd -d $ospfd_options -f @SYSCONFDIR@/quagga/ospfd.conf -ExecStopPost=@base_bindir@/rm -rf /run/quagga/ospfd.pid -Restart=on-abort - -[Install] -WantedBy=multi-user.target diff --git a/meta-networking/recipes-protocols/quagga/files/quagga.default b/meta-networking/recipes-protocols/quagga/files/quagga.default deleted file mode 100644 index 4c4bc23071..0000000000 --- a/meta-networking/recipes-protocols/quagga/files/quagga.default +++ /dev/null @@ -1,12 +0,0 @@ -# If this option is set the /etc/init.d/quagga script automatically loads -# the config via "vtysh -b" when the servers are started. -vtysh_enable=yes - -# Bind all daemons to loopback only by default -zebra_options=" --daemon -A 127.0.0.1" -bgpd_options=" --daemon -A 127.0.0.1" -ospfd_options=" --daemon -A 127.0.0.1" -ospf6d_options="--daemon -A ::1" -ripd_options=" --daemon -A 127.0.0.1" -ripngd_options="--daemon -A ::1" -isisd_options=" --daemon -A 127.0.0.1" diff --git a/meta-networking/recipes-protocols/quagga/files/quagga.init b/meta-networking/recipes-protocols/quagga/files/quagga.init deleted file mode 100644 index df1beb7123..0000000000 --- a/meta-networking/recipes-protocols/quagga/files/quagga.init +++ /dev/null @@ -1,200 +0,0 @@ -#!/bin/sh -# -# /etc/init.d/quagga -- start/stop the Quagga routing daemons -# -# Based on debian version by Endre Hirling <endre@mail.elte.hu> and -# Christian Hammers <ch@debian.org>. -# - -### BEGIN INIT INFO -# Provides: quagga -# Required-Start: $local_fs $network $remote_fs $syslog -# Required-Stop: $local_fs $network $remote_fs $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: start and stop the Quagga routing suite -# Description: Quagga is a routing suite for IP routing protocols like -# BGP, OSPF, RIP and others. This script contols the main -# daemon "quagga" as well as the individual protocol daemons. -### END INIT INFO - -# NOTE: sbin must be before bin so we get the iproute2 ip and not the -# busybox ip command. The busybox one flushes all routes instead of just -# the dynamic routes -PATH=/sbin:/usr/sbin:/bin:/usr/bin:/sbin -D_PATH=/usr/sbin -C_PATH=/etc/quagga - -# Keep zebra first and do not list watchquagga! -DAEMONS="zebra bgpd ripd ripngd ospfd ospf6d isisd" - -# Print the name of the pidfile. -pidfile() -{ - echo "/var/run/quagga/$1.pid" -} - -# Check if daemon is started by using the pidfile. -started() -{ - [ -e `pidfile $1` ] && kill -0 `cat \`pidfile $1\`` 2> /dev/null && return 0 - return 1 -} - -# Loads the config via vtysh -b if configured to do so. -vtysh_b () -{ - # Rember, that all variables have been incremented by 1 in convert_daemon_prios() - if [ "$vtysh_enable" = 2 -a -f $C_PATH/Quagga.conf ]; then - /usr/bin/vtysh -b - fi -} - -# Check if the daemon is activated and if its executable and config files -# are in place. -# params: daemon name -# returns: 0=ok, 1=error -check_daemon() -{ - # If the integrated config file is used the others are not checked. - if [ -r "$C_PATH/Quagga.conf" ]; then - return 0 - fi - - # check for config file - if [ ! -r "$C_PATH/$1.conf" ]; then - return 1 - fi - return 0 -} - -# Starts the server if it's not alrady running according to the pid file. -# The Quagga daemons creates the pidfile when starting. -start() -{ - if ! check_daemon $1; then echo -n " (!$1)"; return; fi - echo -n " $1" - start-stop-daemon \ - --start \ - --pidfile=`pidfile $1` \ - --exec "$D_PATH/$1" \ - -- \ - `eval echo "$""$1""_options"` - -} - -# Stop the daemon given in the parameter, printing its name to the terminal. -stop() -{ - if ! started "$1" ; then - echo -n " (!$1)" - return 0 - else - PIDFILE=`pidfile $1` - PID=`cat $PIDFILE 2>/dev/null` - start-stop-daemon --stop --quiet --exec "$D_PATH/$1" - # - # Now we have to wait until $DAEMON has _really_ stopped. - # - if test -n "$PID" && kill -0 $PID 2>/dev/null; then - echo -n " (waiting) ." - cnt=0 - while kill -0 $PID 2>/dev/null; do - cnt=`expr $cnt + 1` - if [ $cnt -gt 60 ]; then - # Waited 120 secs now, fail. - echo -n "Failed.. " - break - fi - sleep 2 - echo -n "." - done - fi - echo -n " $1" - rm -f `pidfile $1` - fi -} - -stop_all() -{ - local daemon_list - daemon_list=${1:-$DAEMONS} - - echo -n "Stopping Quagga daemons:" - for daemon_name in $daemon_list; do - stop "$daemon_name" - done - echo "." -} - -start_all() -{ - local daemon_list - daemon_list=${1:-$DAEMONS} - - echo -n "Starting Quagga daemons:" - for daemon_name in $daemon_list; do - start "$daemon_name" - done - echo "." -} - -status_all() -{ - local daemon_list - daemon_list=${1:-$DAEMONS} - res=1 - - echo -n "quagga: " - for daemon_name in $daemon_list; do - if started "$daemon_name" ; then - id=`cat \`pidfile $daemon_name\`` - echo -n "$daemon_name (pid $id) " - res=0 - fi - done - if [ $res -eq 0 ]; then - echo "is running..." - else - echo "is stopped..." - fi - exit $res -} - -######################################################### -# Main program # -######################################################### - -# Load configuration -test -f /etc/default/quagga && . /etc/default/quagga - -case "$1" in - start) - cd $C_PATH/ - start_all $2 - vtysh_b - ;; - - stop) - stop_all $2 - echo "Removing all routes made by zebra." - ip route flush proto zebra - ;; - - status) - status_all $2 - ;; - - restart|force-reload) - $0 stop $2 - sleep 1 - $0 start $2 - ;; - - *) - echo "Usage: /etc/init.d/quagga {start|stop|restart|status|force-reload} [daemon]" - exit 1 - ;; -esac - -exit 0 diff --git a/meta-networking/recipes-protocols/quagga/files/ripd.service b/meta-networking/recipes-protocols/quagga/files/ripd.service deleted file mode 100644 index 7af65ca8a3..0000000000 --- a/meta-networking/recipes-protocols/quagga/files/ripd.service +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=RIP routing daemon -BindTo=zebra.service -After=zebra.service -ConditionPathExists=@SYSCONFDIR@/quagga/ripd.conf - -[Service] -Type=forking -EnvironmentFile=-@SYSCONFDIR@/default/quagga -PIDFile=/run/quagga/ripd.pid -ExecStart=@SBINDIR@/ripd -d $ripd_options -f @SYSCONFDIR@/quagga/ripd.conf -ExecStopPost=@base_bindir@/rm -rf /run/quagga/ripd.pid -Restart=on-abort - -[Install] -WantedBy=multi-user.target diff --git a/meta-networking/recipes-protocols/quagga/files/ripngd.service b/meta-networking/recipes-protocols/quagga/files/ripngd.service deleted file mode 100644 index 9305f86be5..0000000000 --- a/meta-networking/recipes-protocols/quagga/files/ripngd.service +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=RIP routing daemon for IPv6 -BindTo=zebra.service -After=zebra.service -ConditionPathExists=@SYSCONFDIR@/quagga/ripngd.conf - -[Service] -Type=forking -EnvironmentFile=-@SYSCONFDIR@/default/quagga -PIDFile=/run/quagga/ripngd.pid -ExecStart=@SBINDIR@/ripngd -d $ripngd_options -f @SYSCONFDIR@/quagga/ripngd.conf -ExecStopPost=@base_bindir@/rm -rf /run/quagga/ripngd.pid -Restart=on-abort - -[Install] -WantedBy=multi-user.target diff --git a/meta-networking/recipes-protocols/quagga/files/volatiles.03_quagga b/meta-networking/recipes-protocols/quagga/files/volatiles.03_quagga deleted file mode 100644 index 1f28c0b24d..0000000000 --- a/meta-networking/recipes-protocols/quagga/files/volatiles.03_quagga +++ /dev/null @@ -1,3 +0,0 @@ -# <type> <owner> <group> <mode> <path> <linksource> -d quagga quagga 0755 /var/run/quagga none -d quagga quagga 0755 /var/log/quagga none diff --git a/meta-networking/recipes-protocols/quagga/files/watchquagga.default b/meta-networking/recipes-protocols/quagga/files/watchquagga.default deleted file mode 100644 index 2d601ec97d..0000000000 --- a/meta-networking/recipes-protocols/quagga/files/watchquagga.default +++ /dev/null @@ -1,12 +0,0 @@ -# Watchquagga configuration -#watch_daemons="zebra bgpd ospfd ospf6d ripd ripngd" -watch_daemons="zebra" - -# To enable restarts when multiple daemons are being used, uncomment this line (but first be sure to edit -# the WATCH_DAEMONS line to reflect the daemons you are actually using): -#watch_options="-Az -b_ -r/etc/init.d/quagga_restart_%s -s/etc/init.d/quagga_start_%s -k/etc/init.d/quagga_stop_%s" - -# Since we are using one quagga daemon for now, use the following line. If using -# multiple daemons, comment the line below and uncoment the line mentioned -# above. -watch_options="-z -b_ -r/etc/init.d/quagga_restart_%s" diff --git a/meta-networking/recipes-protocols/quagga/files/watchquagga.init b/meta-networking/recipes-protocols/quagga/files/watchquagga.init deleted file mode 100644 index 5ddd94a3d6..0000000000 --- a/meta-networking/recipes-protocols/quagga/files/watchquagga.init +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh -# -### BEGIN INIT INFO -# Provides: watchquagga -# Required-Start: $local_fs $network $remote_fs $syslog -# Required-Stop: $local_fs $network $remote_fs $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: start and stop the Quagga watchdog -### END INIT INFO - -PATH=/bin:/usr/bin:/sbin:/usr/sbin - -# Load configuration -test -f /etc/default/watchquagga && . /etc/default/watchquagga - -# Check that there are daemons to be monitored. -[ -z "$watch_daemons" ] && exit 0 - -pidfile="/var/run/quagga/watchquagga.pid" - -case "$1" in - start) - echo -n "Starting quagga watchdog daemon: watchquagga" - start-stop-daemon --start \ - --pidfile $pidfile \ - --exec /usr/sbin/watchquagga \ - -- -d $watch_options $watch_daemons - echo "." - ;; - - stop) - echo -n "Stopping quagga watchdog daemon: watchquagga" - start-stop-daemon --stop --quiet \ - --pidfile $pidfile - echo "." - ;; - - status) - echo -n "watchquagga " - res=1 - [ -e $pidfile ] && kill -0 `cat $pidfile` 2> /dev/null - if [ $? -eq 0 ]; then - echo "(pid `cat $pidfile`) is running..." - res=0 - else - echo "is stopped..." - fi - exit $res - ;; - - restart|force-reload) - $0 stop $2 - sleep 1 - $0 start $2 - ;; - - *) - echo "Usage: /etc/init.d/watchquagga {start|stop|restart|force-reload}" - exit 1 - ;; -esac - -exit 0 diff --git a/meta-networking/recipes-protocols/quagga/files/zebra.service b/meta-networking/recipes-protocols/quagga/files/zebra.service deleted file mode 100644 index e34af72426..0000000000 --- a/meta-networking/recipes-protocols/quagga/files/zebra.service +++ /dev/null @@ -1,17 +0,0 @@ -[Unit] -Description=GNU Zebra routing manager -Wants=network.target -Before=network.target -ConditionPathExists=@SYSCONFDIR@/quagga/zebra.conf - -[Service] -Type=forking -EnvironmentFile=-@SYSCONFDIR@/default/quagga -PIDFile=/run/quagga/zebra.pid -ExecStartPre=@BASE_SBINDIR@/ip route flush proto zebra -ExecStart=@SBINDIR@/zebra -d $zebra_options -f @SYSCONFDIR@/quagga/zebra.conf -ExecStopPost=@base_bindir@/rm -rf /run/quagga/zebra.pid -Restart=on-abort - -[Install] -WantedBy=multi-user.target diff --git a/meta-networking/recipes-protocols/quagga/quagga.inc b/meta-networking/recipes-protocols/quagga/quagga.inc deleted file mode 100644 index 134a33d478..0000000000 --- a/meta-networking/recipes-protocols/quagga/quagga.inc +++ /dev/null @@ -1,237 +0,0 @@ -SUMMARY = "BGP/OSPF/RIP routing daemon" -DESCRIPTION = "Quagga is a routing software suite, providing \ -implementations of OSPFv2, OSPFv3, RIP v1 and v2, RIPv3 and BGPv4 for \ -Unix platforms, particularly FreeBSD, Linux, Solaris and NetBSD. \ -Quagga is a fork of GNU Zebra which was developed by Kunihiro \ -Ishiguro. The Quagga tree aims to build a more involved community \ -around Quagga than the current centralised model of GNU Zebra." -HOMEPAGE = "http://www.nongnu.org/quagga/" -SECTION = "net" - - -LICENSE = "GPL-2.0 & LGPL-2.0" -LIC_FILES_CHKSUM = "file://COPYING;md5=81bcece21748c91ba9992349a91ec11d \ - file://COPYING.LIB;md5=01ef24401ded36cd8e5d18bfe947240c" - -DEPENDS = "readline ncurses perl-native c-ares" -DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'snmp', 'net-snmp', '', d)}" -SNMP_CONF="${@bb.utils.contains('DISTRO_FEATURES', 'snmp', '--enable-snmp', '', d)}" - -# the "ip" command from busybox is not sufficient (flush by protocol flushes all routes) -RDEPENDS_${PN} += "iproute2" - -SRC_URI = "${SAVANNAH_GNU_MIRROR}/quagga/quagga-${PV}.tar.gz; \ - file://quagga.init \ - file://quagga.default \ - file://watchquagga.init \ - file://watchquagga.default \ - file://volatiles.03_quagga \ - file://quagga.pam \ - file://bgpd.service \ - file://isisd.service \ - file://ospf6d.service \ - file://ospfd.service \ - file://ripd.service \ - file://ripngd.service \ - file://zebra.service \ - " - -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 - -SYSTEMD_PACKAGES = "${PN} ${PN}-bgpd ${PN}-isisd ${PN}-ospf6d ${PN}-ospfd ${PN}-ripd ${PN}-ripngd" -SYSTEMD_SERVICE_${PN}-bgpd = "bgpd.service" -SYSTEMD_SERVICE_${PN}-isisd = "isisd.service" -SYSTEMD_SERVICE_${PN}-ospf6d = "ospf6d.service" -SYSTEMD_SERVICE_${PN}-ospfd = "ospfd.service" -SYSTEMD_SERVICE_${PN}-ripd = "ripd.service" -SYSTEMD_SERVICE_${PN}-ripngd = "ripngd.service" -SYSTEMD_SERVICE_${PN} = "zebra.service" - -EXTRA_OECONF = "--sysconfdir=${sysconfdir}/quagga \ - --localstatedir=${localstatedir}/run/quagga \ - --enable-exampledir=${docdir}/quagga/examples/ \ - --enable-vtysh \ - --enable-isisd \ - ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', '--enable-watchquagga', '--disable-watchquagga', d)} \ - --enable-ospfclient=yes \ - --enable-multipath=64 \ - --enable-user=quagga \ - --enable-group=quagga \ - --enable-vty-group=quaggavty \ - --enable-configfile-mask=0640 \ - --enable-logfile-mask=0640 \ - --enable-rtadv \ - --enable-linux24-tcp-md5 \ - ap_cv_cc_pie=no \ - ${SNMP_CONF}" - -CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'" - -do_install () { - # Install init script and default settings - install -m 0755 -d ${D}${sysconfdir}/default ${D}${sysconfdir}/init.d \ - ${D}${sysconfdir}/quagga ${D}${sysconfdir}/default/volatiles - install -m 0644 ${WORKDIR}/quagga.default ${D}${sysconfdir}/default/quagga - install -m 0644 ${WORKDIR}/watchquagga.default ${D}${sysconfdir}/default/watchquagga - install -m 0755 ${WORKDIR}/quagga.init ${D}${sysconfdir}/init.d/quagga - install -m 0755 ${WORKDIR}/watchquagga.init ${D}${sysconfdir}/init.d/watchquagga - install -m 0644 ${WORKDIR}/volatiles.03_quagga ${D}${sysconfdir}/default/volatiles/volatiles.03_quagga - - # Install sample configurations for the daemons - for f in bgpd vtysh isisd ospfd ripngd zebra ripd ospf6d; do - install -m 0640 ${S}/$f/$f.conf.sample ${D}${sysconfdir}/quagga/$f.conf.sample - done - - for f in bgpd vtysh isisd ospfd ripngd zebra ripd ospf6d; do - touch ${D}${sysconfdir}/quagga/$f.conf - done - chown quagga:quaggavty ${D}${sysconfdir}/quagga - chown quagga:quagga ${D}${sysconfdir}/quagga/*.conf - chmod 750 ${D}${sysconfdir}/quagga - chmod 640 ${D}${sysconfdir}/quagga/*.conf - - # Install quagga - oe_runmake install DESTDIR=${D} prefix=${prefix} \ - sbindir=${sbindir} \ - sysconfdir=${sysconfdir}/quagga \ - localstatedir=${localstatedir}/run/quagga - - # Fix hardcoded paths - sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/* - sed -i 's!/usr/bin/!${bindir}/!g' ${D}${sysconfdir}/init.d/quagga - sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/* ${D}${sysconfdir}/default/watchquagga - sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/* ${D}${sysconfdir}/default/volatiles/volatiles.03_quagga - sed -i 's!^PATH=.*!PATH=${base_sbindir}:${sbindir}:${base_bindir}:${bindir}!' ${D}${sysconfdir}/init.d/* - sed -i 's!--with-libtool-sysroot=[^ "]*!!' ${D}${includedir}/quagga/version.h - - oe_multilib_header quagga/version.h - - # For PAM - for feature in ${DISTRO_FEATURES}; do - if [ "$feature" = "pam" ]; then - install -D -m 644 ${WORKDIR}/quagga.pam ${D}/${sysconfdir}/pam.d/quagga - break - fi - done - - if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then - install -d ${D}${nonarch_libdir}/tmpfiles.d - echo "d /run/quagga 0755 quagga quagga -" \ - > ${D}${nonarch_libdir}/tmpfiles.d/${BPN}.conf - fi - - # Remove sysinit script if sysvinit is not in DISTRO_FEATURES - if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'false', 'true', d)}; then - rm -rf ${D}${sysconfdir}/init.d/ - rm -f ${D}${sysconfdir}/default/watchquagga - fi - - install -d ${D}${systemd_unitdir}/system - for i in bgpd isisd ospf6d ospfd ripd ripngd zebra; do - install -m 0644 ${WORKDIR}/$i.service ${D}${systemd_unitdir}/system - done - sed -e 's,@BASE_SBINDIR@,${base_sbindir},g' \ - -e 's,@SYSCONFDIR@,${sysconfdir},g' \ - -e 's,@SBINDIR@,${sbindir},g' \ - -e 's,@base_bindir@,${base_bindir},g' \ - -e 's,@localstatedir@,${localstatedir},g' \ - -i ${D}${systemd_unitdir}/system/*.service -} - -DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd-systemctl-native', '', d)}" -pkg_postinst_${PN} () { - if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd sysvinit', 'true', 'false', d)}; then - if [ -n "$D" ]; then - OPTS="--root=$D" - fi - systemctl $OPTS mask quagga.service - fi -} - -# Split into a main package and separate per-protocol packages -PACKAGE_BEFORE_PN = "${PN}-ospfd ${PN}-ospf6d ${PN}-bgpd \ - ${PN}-ripd ${PN}-ripngd ${PN}-isisd \ - ${PN}-ospfclient ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', '${PN}-watchquagga', '', d)}" - -RDEPENDS_${PN} += "${PN}-bgpd ${PN}-isisd ${PN}-ospf6d ${PN}-ospfd ${PN}-ripd ${PN}-ripngd" - -FILES_${PN}-ospfd = "${sbindir}/ospfd ${libdir}/libospf.so.*" -FILES_${PN}-ospf6d = "${sbindir}/ospf6d" -FILES_${PN}-bgpd = "${sbindir}/bgpd" -FILES_${PN}-ripd = "${sbindir}/ripd" -FILES_${PN}-ripngd = "${sbindir}/ripngd" -FILES_${PN}-isisd = "${sbindir}/isisd" -FILES_${PN}-ospfclient = "${sbindir}/ospfclient ${libdir}/libospfapiclient.so.*" -FILES_${PN}-watchquagga = "${sbindir}/watchquagga ${sysconfdir}/default/watchquagga \ - ${sysconfdir}/init.d/watchquagga" - -FILES_${PN} += "${nonarch_libdir}/tmpfiles.d/*.conf" - -# Indicate that the default files are configuration files -CONFFILES_${PN} = "${sysconfdir}/default/quagga \ - ${sysconfdir}/quagga/bgpd.conf \ - ${sysconfdir}/quagga/vtysh.conf \ - ${sysconfdir}/quagga/isisd.conf \ - ${sysconfdir}/quagga/ospfd.conf \ - ${sysconfdir}/quagga/ripngd.conf \ - ${sysconfdir}/quagga/zebra.conf \ - ${sysconfdir}/quagga/ripd.conf \ - ${sysconfdir}/quagga/ospf6d.conf \ - " -CONFFILES_${PN}-watchquagga = "${sysconfdir}/default/watchquagga" - -# Stop the names being rewritten due to the internal shared libraries -DEBIAN_NOAUTONAME_${PN}-ospfd = "1" -DEBIAN_NOAUTONAME_${PN}-ospfclient = "1" - -# Main init script starts all deamons -# Seperate init script for watchquagga -INITSCRIPT_PACKAGES = "${PN} ${PN}-watchquagga" -INITSCRIPT_NAME_${PN} = "quagga" -INITSCRIPT_PARAMS_${PN} = "defaults 15 85" -INITSCRIPT_NAME_${PN}-watchquagga = "watchquagga" -INITSCRIPT_PARAMS_${PN}-watchquagga = "defaults 90 10" - -# Add quagga's user and group -USERADD_PACKAGES = "${PN}" -GROUPADD_PARAM_${PN} = "--system quagga ; --system quaggavty" -USERADD_PARAM_${PN} = "--system --home ${localstatedir}/run/quagga/ -M -g quagga -G quaggavty --shell /bin/false quagga" - -pkg_postinst_${PN} () { - if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then - ${sysconfdir}/init.d/populate-volatile.sh update - fi -} - -# Stop apps before uninstall -pkg_prerm_${PN} () { - ${sysconfdir}/init.d/quagga stop -} - -pkg_prerm_${PN}-ospfd () { - ${sysconfdir}/init.d/quagga stop ospfd -} - -pkg_prerm_${PN}-ospf6d () { - ${sysconfdir}/init.d/quagga stop ospf6d -} - -pkg_prerm_${PN}-bgpd () { - ${sysconfdir}/init.d/quagga stop bgpd -} - -pkg_prerm_${PN}-ripd () { - ${sysconfdir}/init.d/quagga stop ripd -} - -pkg_prerm_${PN}-ripngd () { - ${sysconfdir}/init.d/quagga stop ripngd -} - -pkg_prerm_${PN}-isisd () { - ${sysconfdir}/init.d/quagga stop isisd -} diff --git a/meta-networking/recipes-protocols/quagga/quagga_1.2.4.bb b/meta-networking/recipes-protocols/quagga/quagga_1.2.4.bb deleted file mode 100644 index a7697a1ae9..0000000000 --- a/meta-networking/recipes-protocols/quagga/quagga_1.2.4.bb +++ /dev/null @@ -1,4 +0,0 @@ -require quagga.inc - -SRC_URI[md5sum] = "eced21b054d71c9e1b7c6ac43286a166" -SRC_URI[sha256sum] = "e364c082c3309910e1eb7b068bf39ee298e2f2f3f31a6431a5c115193bd653d3" diff --git a/meta-networking/recipes-protocols/radiusclient-ng/radiusclient-ng/Modify-configure.in-and-etc-Makefile.am.patch b/meta-networking/recipes-protocols/radiusclient-ng/radiusclient-ng/Modify-configure.in-and-etc-Makefile.am.patch index ecc2d74e74..fd9961b9e8 100644 --- a/meta-networking/recipes-protocols/radiusclient-ng/radiusclient-ng/Modify-configure.in-and-etc-Makefile.am.patch +++ b/meta-networking/recipes-protocols/radiusclient-ng/radiusclient-ng/Modify-configure.in-and-etc-Makefile.am.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Modify configure.in and etc/Makefile.am this patch is from Fedora to fix error: "conftest.c:26:9: error: unknown type name 'not'" -Upstream-Status: pending +Upstream-Status: Pending Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com> --- diff --git a/meta-networking/recipes-protocols/radiusclient-ng/radiusclient-ng_0.5.6.bb b/meta-networking/recipes-protocols/radiusclient-ng/radiusclient-ng_0.5.6.bb index ea3775452b..6baa83e83e 100644 --- a/meta-networking/recipes-protocols/radiusclient-ng/radiusclient-ng_0.5.6.bb +++ b/meta-networking/recipes-protocols/radiusclient-ng/radiusclient-ng_0.5.6.bb @@ -5,11 +5,10 @@ protocol (RFCs 2128 and 2139)." HOMEPAGE = "http://sourceforge.net/projects/radiusclient-ng.berlios/" SECTION = "net" -SRC_URI = "${DEBIAN_MIRROR}/main/r/${BPN}/${BPN}_${PV}.orig.tar.gz \ +SRC_URI = "http://archive.ubuntu.com/ubuntu/pool/universe/r/${BPN}/${BPN}_${PV}.orig.tar.gz \ file://Modify-configure.in-and-etc-Makefile.am.patch \ file://config-site.radiusclient-ng-${PV}" -SRC_URI[md5sum] = "6fb7d4d0aefafaee7385831ac46a8e9c" SRC_URI[sha256sum] = "282a9f1355f190efbb06c0d7c4e062eaa652caf342ed3ad361ac595f72f09f14" LICENSE = "BSD-3-Clause & BSD-2-Clause & HPND" @@ -21,11 +20,11 @@ DEPENDS += "virtual/crypt" EXTRA_OECONF += "--disable-static" -do_configure_prepend () { +do_configure:prepend () { export CONFIG_SITE=./config-site.${P} } -do_compile_prepend() { +do_compile:prepend() { for m in `find . -name "Makefile"` ; do sed -i -e 's:^program_transform_name =.*:program_transform_name =:g' ${m} done diff --git a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe/0001-ppoe-Dont-include-linux-if_ether.h.patch b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe/0001-ppoe-Dont-include-linux-if_ether.h.patch index 7601f0d325..572886a26c 100644 --- a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe/0001-ppoe-Dont-include-linux-if_ether.h.patch +++ b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe/0001-ppoe-Dont-include-linux-if_ether.h.patch @@ -8,6 +8,8 @@ Fixes build with musl Signed-off-by: Khem Raj <raj.khem@gmail.com> --- +Upstream-Status: Pending + src/pppoe.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe/0002-Enable-support-for-the-kernel-module.patch b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe/0002-Enable-support-for-the-kernel-module.patch index 2103b38888..cd9e40d5eb 100644 --- a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe/0002-Enable-support-for-the-kernel-module.patch +++ b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe/0002-Enable-support-for-the-kernel-module.patch @@ -6,6 +6,8 @@ Subject: [PATCH] Enable support for the kernel module Signed-off-by: Khem Raj <raj.khem@gmail.com> --- +Upstream-Status: Pending + src/configure.in | 1 + 1 file changed, 1 insertion(+) diff --git a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe/configure.in-Error-fix.patch b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe/configure.in-Error-fix.patch deleted file mode 100644 index bbd516fde9..0000000000 --- a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe/configure.in-Error-fix.patch +++ /dev/null @@ -1,57 +0,0 @@ -From bdd20b7a584a20504dfabb409a41ee2b9ae41657 Mon Sep 17 00:00:00 2001 -From: Lei Maohui <leimaohui@cn.fujitsu.com> -Date: Wed, 19 Aug 2015 13:52:57 +0900 -Subject: [PATCH] configure.in: Error fix. - -the error is: conftest.c:9:28: fatal error: ac_nonexistent.h: -No such file or directory #include <ac_nonexistent.h> - -Upstream-Status: pending - -Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com> - ---- - src/configure.in | 30 ------------------------------ - 1 file changed, 30 deletions(-) - -diff --git a/src/configure.in b/src/configure.in -index 1714e69..cae0976 100644 ---- a/src/configure.in -+++ b/src/configure.in -@@ -195,36 +195,6 @@ if test "$GCC" = yes; then - CFLAGS="$CFLAGS -fno-strict-aliasing -Wall -Wstrict-prototypes" - fi - --dnl Figure out packing order of structures --AC_CACHE_CHECK([packing order of bit fields],rpppoe_cv_pack_bitfields,[ --if test "${rpppoe_cv_pack_bitfields+set}" != set ; then --AC_TRY_RUN([ --union foo { -- struct bar { -- unsigned int ver:4; -- unsigned int type:4; -- } bb; -- unsigned char baz; --}; -- --int --main(void) --{ -- union foo x; -- x.bb.ver = 1; -- x.bb.type = 2; -- if (x.baz == 0x21) { -- return 1; -- } else if (x.baz == 0x12) { -- return 0; -- } else { -- return 2; -- } --}], rpppoe_cv_pack_bitfields=normal, rpppoe_cv_pack_bitfields=rev, --$ECHO "no defaults for cross-compiling"; exit 1) --fi --]) -- - if test "$rpppoe_cv_pack_bitfields" = "rev" ; then - AC_MSG_RESULT(reversed) - AC_DEFINE([PACK_BITFIELDS_REVERSED], [], [Reversed bitfields]) diff --git a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe/configure.patch b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe/configure.patch index be892803e6..c486716b97 100644 --- a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe/configure.patch +++ b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe/configure.patch @@ -3,6 +3,8 @@ From: Richard Purdie <richard.purdie@linuxfoundation.org> Date: Fri, 18 Jul 2014 08:25:16 +0000 --- +Upstream-Status: Pending + configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe/configure_in_cross.patch b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe/configure_in_cross.patch index 3b945934f6..6e859a354c 100644 --- a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe/configure_in_cross.patch +++ b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe/configure_in_cross.patch @@ -8,13 +8,12 @@ a few target paths, reworks a few tests to be more friendly for cross and drops other tests. Upstream-Status: Inappropriate [build system specific changes] - --- - src/configure.in | 66 ++++++++++++++------------------------------------------ - 1 file changed, 16 insertions(+), 50 deletions(-) + src/configure.in | 62 ++++++++++-------------------------------------- + 1 file changed, 12 insertions(+), 50 deletions(-) diff --git a/src/configure.in b/src/configure.in -index 90a07df..1d30243 100644 +index 4add50c..9dff457 100644 --- a/src/configure.in +++ b/src/configure.in @@ -5,6 +5,13 @@ AC_INIT(pppoe.c) @@ -67,13 +66,15 @@ index 90a07df..1d30243 100644 fi AC_SUBST(LINUX_KERNELMODE_PLUGIN) -@@ -142,15 +149,8 @@ AC_CHECK_SIZEOF(unsigned short) +@@ -142,17 +149,8 @@ AC_CHECK_SIZEOF(unsigned short) AC_CHECK_SIZEOF(unsigned int) AC_CHECK_SIZEOF(unsigned long) +-dnl Check for location of ip +-AC_PATH_PROG(IP, ip, NOTFOUND, $PATH:/bin:/sbin:/usr/bin:/usr/sbin) +- -dnl Check for location of pppd -AC_PATH_PROG(PPPD, pppd, NOTFOUND, $PATH:/sbin:/usr/sbin:/usr/local/sbin) --AC_PATH_PROG(ECHO, echo, echo) - -dnl Check for setsid (probably Linux-specific) -AC_PATH_PROG(SETSID, setsid, "", $PATH:/sbin:/usr/sbin:/usr/local/sbin) @@ -84,7 +85,7 @@ index 90a07df..1d30243 100644 dnl Check for Linux-specific kernel support for PPPoE AC_MSG_CHECKING(for Linux 2.4.X kernel-mode PPPoE support) -@@ -195,44 +195,8 @@ if test "$GCC" = yes; then +@@ -195,42 +193,6 @@ if test "$GCC" = yes; then CFLAGS="$CFLAGS -fno-strict-aliasing -Wall -Wstrict-prototypes" fi @@ -124,30 +125,9 @@ index 90a07df..1d30243 100644 - ;; -esac - - dnl Figure out packing order of structures --AC_MSG_CHECKING([packing order of bit fields]) -+AC_CACHE_CHECK([packing order of bit fields],rpppoe_cv_pack_bitfields,[ - if test "${rpppoe_cv_pack_bitfields+set}" != set ; then - AC_TRY_RUN([ - union foo { -@@ -259,10 +223,11 @@ main(void) - }], rpppoe_cv_pack_bitfields=normal, rpppoe_cv_pack_bitfields=rev, - $ECHO "no defaults for cross-compiling"; exit 0) - fi -+]) - - if test "$rpppoe_cv_pack_bitfields" = "rev" ; then - AC_MSG_RESULT(reversed) -- AC_DEFINE(PACK_BITFIELDS_REVERSED) -+ AC_DEFINE([PACK_BITFIELDS_REVERSED], [], [Reversed bitfields]) - else - AC_MSG_RESULT(normal) - fi -@@ -326,6 +291,7 @@ AC_SUBST(PPPOE_SERVER_DEPS) - AC_SUBST(RDYNAMIC) - AC_SUBST(LIBEVENT) - AC_SUBST(ECHO) -+AC_SUBST(HAVE_STRUCT_SOCKADDR_LL) - AC_SUBST(LDFLAGS) - - datadir_evaluated=`eval echo $datadir` + # Sigh... got to fix this up for tcl + test "x$prefix" = xNONE && prefix=$ac_default_prefix + # Let make expand exec_prefix. +-- +2.34.1 + diff --git a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe/discard-use-of-dnl-in-Makefile.am.patch b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe/discard-use-of-dnl-in-Makefile.am.patch index 9801f6e277..57301f430d 100644 --- a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe/discard-use-of-dnl-in-Makefile.am.patch +++ b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe/discard-use-of-dnl-in-Makefile.am.patch @@ -9,6 +9,8 @@ not introduce a comment. Signed-off-by: Ting Liu <b28495@freescale.com> --- +Upstream-Status: Pending + Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe/dont-swallow-errors.patch b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe/dont-swallow-errors.patch deleted file mode 100644 index 8a857888b3..0000000000 --- a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe/dont-swallow-errors.patch +++ /dev/null @@ -1,26 +0,0 @@ -From a9a7322273c51882af58c35ba288a0fae00ba841 Mon Sep 17 00:00:00 2001 -From: Lei Maohui <leimaohui@cn.fujitsu.com> -Date: Wed, 19 Aug 2015 12:33:41 +0900 -Subject: [PATCH] don't swallow errors - -Further fixup to the configure scripts to not swallow errors - -Upstream-Status: Pending - ---- - src/configure.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/configure.in b/src/configure.in -index 1d30243..1714e69 100644 ---- a/src/configure.in -+++ b/src/configure.in -@@ -221,7 +221,7 @@ main(void) - return 2; - } - }], rpppoe_cv_pack_bitfields=normal, rpppoe_cv_pack_bitfields=rev, --$ECHO "no defaults for cross-compiling"; exit 0) -+$ECHO "no defaults for cross-compiling"; exit 1) - fi - ]) - diff --git a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe_3.13.bb b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe_3.15.bb index 492ade5ae5..4dfdb8fc21 100644 --- a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe_3.13.bb +++ b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe_3.15.bb @@ -1,32 +1,33 @@ SUMMARY = "A user-mode PPPoE client and server suite for Linux" HOMEPAGE = "http://www.roaringpenguin.com/products/pppoe" SECTION = "net" -LICENSE = "GPLv2" +LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://doc/LICENSE;md5=a194eaefae2be54ee3221339b10d0581" -PR = "r10" -SRC_URI = "https://dianne.skoll.ca/projects/rp-pppoe/download/rp-pppoe-${PV}.tar.gz \ +SRC_URI = "https://dianne.skoll.ca/projects/rp-pppoe/download/OLD/rp-pppoe-${PV}.tar.gz \ file://top-autoconf.patch \ file://configure_in_cross.patch \ file://update-config.patch \ - file://dont-swallow-errors.patch \ file://discard-use-of-dnl-in-Makefile.am.patch \ file://configure.patch \ file://pppoe-server.default \ file://pppoe-server.init \ - file://configure.in-Error-fix.patch \ file://pppoe-server.service \ file://0001-ppoe-Dont-include-linux-if_ether.h.patch \ file://0002-Enable-support-for-the-kernel-module.patch \ " -SRC_URI[md5sum] = "ec9dccd9a367a1f71f2dc81069796dd8" -SRC_URI[sha256sum] = "8cd6bc71ba46bd5f6eb4daf60220ccdcd991a8525111dee466501b1b9717e676" +SRC_URI[sha256sum] = "b1f318bc7e4e5b0fd8a8e23e8803f5e6e43165245a5a10a7162a92a6cf17829a" inherit autotools-brokensep update-rc.d systemd -do_install_append() { +CACHED_CONFIGUREVARS += "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'be', 'rpppoe_cv_pack_bitfields=normal', 'rpppoe_cv_pack_bitfields=rev', d)}" + +# Needed for strlcpy() +CFLAGS += "-D_GNU_SOURCE" + +do_install:append() { install -d ${D}${systemd_unitdir}/system install -m 0644 ${WORKDIR}/pppoe-server.service ${D}${systemd_unitdir}/system sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' ${D}${systemd_unitdir}/system/pppoe-server.service @@ -48,29 +49,29 @@ do_install() { } SYSTEMD_PACKAGES = "${PN}-server" -SYSTEMD_SERVICE_${PN}-server = "pppoe-server.service" +SYSTEMD_SERVICE:${PN}-server = "pppoe-server.service" SYSTEMD_AUTO_ENABLE = "disable" # Insert server package before main package PACKAGES = "${PN}-dbg ${PN}-server ${PN}-relay ${PN}-sniff ${PN} ${PN}-doc" -FILES_${PN}-server = "${sysconfdir}/default/pppoe-server \ +FILES:${PN}-server = "${sysconfdir}/default/pppoe-server \ ${sysconfdir}/init.d/pppoe-server \ ${sbindir}/pppoe-server \ ${sysconfdir}/ppp/pppoe-server-options" -FILES_${PN}-relay = "${sbindir}/pppoe-relay" -FILES_${PN}-sniff = "${sbindir}/pppoe-sniff" +FILES:${PN}-relay = "${sbindir}/pppoe-relay" +FILES:${PN}-sniff = "${sbindir}/pppoe-sniff" -CONFFILES_${PN} = "${sysconfdir}/ppp/pppoe.conf \ +CONFFILES:${PN} = "${sysconfdir}/ppp/pppoe.conf \ ${sysconfdir}/ppp/firewall-standalone \ ${sysconfdir}/ppp/firewall-masq" -CONFFILES_${PN}-server = "${sysconfdir}/ppp/pppoe-server-options \ +CONFFILES:${PN}-server = "${sysconfdir}/ppp/pppoe-server-options \ ${sysconfdir}/default/pppoe-server" INITSCRIPT_PACKAGES = "${PN}-server" -INITSCRIPT_NAME_${PN}-server = "pppoe-server" -INITSCRIPT_PARAMS_${PN}-server = "defaults 92 8" +INITSCRIPT_NAME:${PN}-server = "pppoe-server" +INITSCRIPT_PARAMS:${PN}-server = "defaults 92 8" -RDEPENDS_${PN} = "ppp" -RDEPENDS_${PN}-server = "${PN}" -RRECOMMENDS_${PN} = "ppp-oe" +RDEPENDS:${PN} = "ppp" +RDEPENDS:${PN}-server = "${PN}" +RRECOMMENDS:${PN} = "ppp-oe" diff --git a/meta-networking/recipes-protocols/tsocks/tsocks_1.8beta5.bb b/meta-networking/recipes-protocols/tsocks/tsocks_1.8beta5.bb index 725ba189c6..8099fa5c6e 100644 --- a/meta-networking/recipes-protocols/tsocks/tsocks_1.8beta5.bb +++ b/meta-networking/recipes-protocols/tsocks/tsocks_1.8beta5.bb @@ -6,7 +6,7 @@ make to establish network connections and negotating them through a \ SOCKS server as necessary." HOMEPAGE = "http://sourceforge.net/projects/tsocks/" SECTION = "net" -LICENSE = "GPL-2.0" +LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://COPYING;md5=18810669f13b87348459e611d31ab760" SRC_URI = "http://downloads.sourceforge.net/tsocks/tsocks-${PV}.tar.gz \ @@ -18,14 +18,14 @@ SRC_URI[sha256sum] = "849d7ef5af80d03e76cc05ed9fb8fa2bcc2b724b51ebfd1b6be11c7863 inherit autotools-brokensep -LIBS_append_libc-musl = " -lssp_nonshared" -LIBS_append_libc-glibc = " -lc_nonshared" +LIBS:append:libc-musl = " -lssp_nonshared" +LIBS:append:libc-glibc = " -lc_nonshared" S = "${WORKDIR}/tsocks-1.8" -FILES_${PN} = "${libdir}/* ${bindir}/tsocks" -FILES_${PN}-dev = "" -INSANE_SKIP_${PN} = "dev-so" +FILES:${PN} = "${libdir}/* ${bindir}/tsocks" +FILES:${PN}-dev = "" +INSANE_SKIP:${PN} = "dev-so" EXTRA_OEMAKE = "SHCC='${CC} -fPIC ${LDFLAGS}' LIBS='${LIBS}'" diff --git a/meta-networking/recipes-protocols/usrsctp/usrsctp_git.bb b/meta-networking/recipes-protocols/usrsctp/usrsctp_git.bb index 4f8e4d4282..4c18c6aff9 100644 --- a/meta-networking/recipes-protocols/usrsctp/usrsctp_git.bb +++ b/meta-networking/recipes-protocols/usrsctp/usrsctp_git.bb @@ -2,7 +2,7 @@ DESCRIPTION = "This is a userland SCTP stack supporting FreeBSD, Linux, Mac OS X LICENSE = "BSD-3-Clause" LIC_FILES_CHKSUM = "file://LICENSE.md;md5=ffcf846341f3856d79a483eafa18e2a5" -SRCREV = "a10cd498d964508c0e6ec6bd2be9dd4afcbb4d86" +SRCREV = "848eca82f92273af9a79687a90343a2ebcf3481d" SRC_URI = "git://github.com/sctplab/usrsctp;protocol=https;branch=master \ " @@ -23,3 +23,5 @@ PACKAGECONFIG[inet] = "--enable-inet,--disable-inet," PACKAGECONFIG[inet6] = "--enable-inet6,--disable-inet6," EXTRA_OECONF += "--disable-debug" + +CVE_VERSION = "0.9.5.0" diff --git a/meta-networking/recipes-protocols/vsomeip/vsomeip/0001-Fix-pkgconfig-dir-for-multilib.patch b/meta-networking/recipes-protocols/vsomeip/vsomeip/0001-Fix-pkgconfig-dir-for-multilib.patch new file mode 100644 index 0000000000..0ddcb642bc --- /dev/null +++ b/meta-networking/recipes-protocols/vsomeip/vsomeip/0001-Fix-pkgconfig-dir-for-multilib.patch @@ -0,0 +1,28 @@ +From 2f931baf290477b586309189445bf87e3bc5d5ba Mon Sep 17 00:00:00 2001 +From: Yi Zhao <yi.zhao@windriver.com> +Date: Wed, 2 Mar 2022 14:51:13 +0800 +Subject: [PATCH] Fix pkgconfig dir for multilib + +Upstream-Status: Pending + +Signed-off-by: Yi Zhao <yi.zhao@windriver.com> +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ab399a69..beae6eaf 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -637,7 +637,7 @@ endif() + # create pkg-config file + if(NOT WIN32) + configure_file(${VSOMEIP_NAME}.pc.in ${PROJECT_BINARY_DIR}/${VSOMEIP_NAME}.pc @ONLY) +- install(FILES ${PROJECT_BINARY_DIR}/${VSOMEIP_NAME}.pc DESTINATION lib/pkgconfig) ++ install(FILES ${PROJECT_BINARY_DIR}/${VSOMEIP_NAME}.pc DESTINATION ${INSTALL_LIB_DIR}/pkgconfig) + endif() + + ############################################################################## +-- +2.25.1 + diff --git a/meta-networking/recipes-protocols/vsomeip/vsomeip/0002-Install-example-configuration-files-to-etc-vsomeip.patch b/meta-networking/recipes-protocols/vsomeip/vsomeip/0002-Install-example-configuration-files-to-etc-vsomeip.patch new file mode 100644 index 0000000000..bdaf343606 --- /dev/null +++ b/meta-networking/recipes-protocols/vsomeip/vsomeip/0002-Install-example-configuration-files-to-etc-vsomeip.patch @@ -0,0 +1,28 @@ +From ebaa3206ee125741314272cddafa04fa71bd2d1e Mon Sep 17 00:00:00 2001 +From: Yi Zhao <yi.zhao@windriver.com> +Date: Wed, 9 Mar 2022 11:48:44 +0800 +Subject: [PATCH] Install example configuration files to /etc/vsomeip + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Yi Zhao <yi.zhao@windriver.com> +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index beae6eaf..d791c12e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -536,7 +536,7 @@ install(FILES ${PROJECT_BINARY_DIR}/vsomeip.pc DESTINATION lib/pkgconfig) + endif () + + install ( +- FILES ${EXAMPLE_CONFIG_FILES} DESTINATION etc/vsomeip COMPONENT config ++ FILES ${EXAMPLE_CONFIG_FILES} DESTINATION ${DEFAULT_CONFIGURATION_FOLDER} COMPONENT config + ) + + # Add all targets to the build-tree export set +-- +2.25.1 + diff --git a/meta-networking/recipes-protocols/vsomeip/vsomeip/0003-Do-not-build-external-gtest.patch b/meta-networking/recipes-protocols/vsomeip/vsomeip/0003-Do-not-build-external-gtest.patch new file mode 100644 index 0000000000..09dab9a8b0 --- /dev/null +++ b/meta-networking/recipes-protocols/vsomeip/vsomeip/0003-Do-not-build-external-gtest.patch @@ -0,0 +1,187 @@ +From b1bf398015bc090020459954e5cd1ec3b51b8ac3 Mon Sep 17 00:00:00 2001 +From: Yi Zhao <yi.zhao@windriver.com> +Date: Tue, 11 Jul 2023 16:53:46 +0800 +Subject: [PATCH] Do not build external gtest + +We don't need to build external gtest since we already depend on +googletest. + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Yi Zhao <yi.zhao@windriver.com> +--- + CMakeLists.txt | 11 ---- + test/CMakeLists.txt | 22 +------ + test/network_tests/CMakeLists.txt | 99 ------------------------------- + 3 files changed, 3 insertions(+), 129 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d791c12e..f1bcba27 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -18,17 +18,6 @@ set (VSOMEIP_VERSION ${VSOMEIP_MAJOR_VERSION}.${VSOMEIP_MINOR_VERSION}.${VSOMEIP + set (PACKAGE_VERSION ${VSOMEIP_VERSION}) # Used in documentation/doxygen.in + set (CMAKE_VERBOSE_MAKEFILE off) + +-if (NOT GTEST_ROOT) +- if (DEFINED ENV{GTEST_ROOT}) +- set(GTEST_ROOT $ENV{GTEST_ROOT}) +- else() +- include(FetchContent) +- FetchContent_Declare(googletest GIT_REPOSITORY https://github.com/google/googletest.git GIT_TAG v1.14.0) +- FetchContent_Populate(googletest) +- set(GTEST_ROOT ${googletest_SOURCE_DIR}) +- endif() +-endif() +- + ################################################################################################### + # see http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file + ################################################################################################### +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index f66ac5d3..6f09bf40 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -17,27 +17,11 @@ find_package(benchmark) + # remove export symbols from the cxx flags + string(REPLACE "${EXPORTSYMBOLS}" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +-# check for set environment variable +-if(${GTEST_ROOT} STREQUAL "n/a") +- message(STATUS "GTEST_ROOT is not defined. For building the tests the variable +- GTEST_ROOT has to be defined. Tests can not be built.") +- # early exit +- return() # test can not be build -> make commands build_tests and check are not available +-else() +- message(STATUS "GTEST_ROOT is set. gtest root path set to ${GTEST_ROOT}") ++find_package(GTest) ++if (NOT GTest_FOUND) ++ message(WARNING "GTest is not found. Tests can not be built.") + endif() + +-# build google test as static library (always) -> therefore deactivate BUILD_SHARED_LIBS in case it is active +-set(BUILD_SHARED_LIBS_AUTOMATIC_OFF 0) +-if ("${BUILD_SHARED_LIBS}" STREQUAL "ON") +- set(BUILD_SHARED_LIBS OFF) +- set(BUILD_SHARED_LIBS_AUTOMATIC_OFF 1) +-endif() +-add_subdirectory(${GTEST_ROOT} ${CMAKE_CURRENT_BINARY_DIR}/gtest EXCLUDE_FROM_ALL) +-if ("${BUILD_SHARED_LIBS_AUTOMATIC_OFF}" STREQUAL "1") +- set(BUILD_SHARED_LIBS ON) +- set(BUILD_SHARED_LIBS_AUTOMATIC_OFF 0) +-endif() + + ############################################################################## + # build tests +diff --git a/test/network_tests/CMakeLists.txt b/test/network_tests/CMakeLists.txt +index 883cc5cf..9a2a4f5e 100644 +--- a/test/network_tests/CMakeLists.txt ++++ b/test/network_tests/CMakeLists.txt +@@ -4116,105 +4116,6 @@ if(NOT ${TESTS_BAT}) + + endif() + +-############################################################################## +-# Add for every test a dependency to gtest +-############################################################################## +- +-if(NOT ${TESTS_BAT}) +- add_dependencies(${TEST_CONFIGURATION} gtest) +- add_dependencies(${TEST_APPLICATION} gtest) +- add_dependencies(${TEST_APPLICATION_SINGLE_PROCESS_NAME} gtest) +- add_dependencies(${TEST_APPLICATION_AVAILABILITY_NAME} gtest) +- add_dependencies(${TEST_MAGIC_COOKIES_CLIENT} gtest) +- add_dependencies(${TEST_MAGIC_COOKIES_SERVICE} gtest) +- add_dependencies(${TEST_HEADER_FACTORY} gtest) +- add_dependencies(${TEST_HEADER_FACTORY_CLIENT} gtest) +- add_dependencies(${TEST_HEADER_FACTORY_SERVICE} gtest) +- add_dependencies(${TEST_LOCAL_ROUTING_SERVICE} gtest) +- add_dependencies(${TEST_LOCAL_ROUTING_CLIENT} gtest) +- add_dependencies(${TEST_EXTERNAL_LOCAL_ROUTING_SERVICE} gtest) +- add_dependencies(${TEST_PAYLOAD_SERVICE} gtest) +- add_dependencies(${TEST_PAYLOAD_CLIENT} gtest) +- add_dependencies(${TEST_BIG_PAYLOAD_SERVICE} gtest) +- add_dependencies(${TEST_BIG_PAYLOAD_CLIENT} gtest) +- add_dependencies(${TEST_CLIENT_ID_SERVICE} gtest) +- add_dependencies(${TEST_CLIENT_ID_UTILITY} gtest) +- add_dependencies(${TEST_DEBOUNCE_CLIENT} gtest) +- add_dependencies(${TEST_DEBOUNCE_SERVICE} gtest) +- add_dependencies(${TEST_DEBOUNCE_FILTER_CLIENT} gtest) +- add_dependencies(${TEST_DEBOUNCE_FILTER_SERVICE} gtest) +- add_dependencies(${TEST_DEBOUNCE_CALLBACK_CLIENT} gtest) +- add_dependencies(${TEST_DEBOUNCE_CALLBACK_SERVICE} gtest) +- add_dependencies(${TEST_DEBOUNCE_FREQUENCY_CLIENT} gtest) +- add_dependencies(${TEST_DEBOUNCE_FREQUENCY_SERVICE} gtest) +- add_dependencies(${TEST_SUBSCRIBE_NOTIFY_SERVICE} gtest) +- add_dependencies(${TEST_SUBSCRIBE_NOTIFY_ONE_EVENT_TWO_EVENTGROUPS_SERVICE} gtest) +- add_dependencies(${TEST_SUBSCRIBE_NOTIFY_ONE_EVENT_TWO_EVENTGROUPS_CLIENT} gtest) +- add_dependencies(${TEST_SUBSCRIBE_NOTIFY_ONE_SERVICE} gtest) +- add_dependencies(${TEST_CPU_LOAD_SERVICE} gtest) +- add_dependencies(${TEST_CPU_LOAD_CLIENT} gtest) +- add_dependencies(${TEST_INITIAL_EVENT_SERVICE} gtest) +- add_dependencies(${TEST_INITIAL_EVENT_CLIENT} gtest) +- add_dependencies(${TEST_INITIAL_EVENT_AVAILABILITY_CHECKER} gtest) +- add_dependencies(${TEST_INITIAL_EVENT_STOP_SERVICE} gtest) +- add_dependencies(${TEST_OFFER_SERVICE} gtest) +- add_dependencies(${TEST_OFFER_CLIENT} gtest) +- add_dependencies(${TEST_OFFER_SERVICE_EXTERNAL} gtest) +- add_dependencies(${TEST_OFFER_EXTERNAL_SD_MESSAGE_SENDER} gtest) +- add_dependencies(${TEST_OFFERED_SERVICES_INFO_CLIENT} gtest) +- add_dependencies(${TEST_OFFERED_SERVICES_INFO_SERVICE} gtest) +- add_dependencies(${TEST_PENDING_SUBSCRIPTION_SERVICE} gtest) +- add_dependencies(${TEST_PENDING_SUBSCRIPTION_CLIENT} gtest) +- add_dependencies(${TEST_MALICIOUS_DATA_SERVICE} gtest) +- add_dependencies(${TEST_MALICIOUS_DATA_CLIENT} gtest) +- if (${TEST_SECURITY}) +- add_dependencies(${TEST_SECURITY_SERVICE} gtest) +- add_dependencies(${TEST_SECURITY_CLIENT} gtest) +- endif() +- add_dependencies(${TEST_E2E_SERVICE} gtest) +- add_dependencies(${TEST_E2E_CLIENT} gtest) +- if (${TEST_E2E_PROFILE_04}) +- add_dependencies(${TEST_E2E_PROFILE_04_SERVICE} gtest) +- add_dependencies(${TEST_E2E_PROFILE_04_CLIENT} gtest) +- endif() +- if (${TEST_E2E_PROFILE_07}) +- add_dependencies(${TEST_E2E_PROFILE_07_SERVICE} gtest) +- add_dependencies(${TEST_E2E_PROFILE_07_CLIENT} gtest) +- endif() +- add_dependencies(${TEST_EVENT_SERVICE} gtest) +- add_dependencies(${TEST_EVENT_CLIENT} gtest) +- if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "QNX") +- add_dependencies(${TEST_NPDU_SERVICE_ONE} gtest) +- add_dependencies(${TEST_NPDU_SERVICE_TWO} gtest) +- add_dependencies(${TEST_NPDU_SERVICE_THREE} gtest) +- add_dependencies(${TEST_NPDU_SERVICE_FOUR} gtest) +- add_dependencies(${TEST_NPDU_CLIENT_ONE} gtest) +- add_dependencies(${TEST_NPDU_CLIENT_TWO} gtest) +- add_dependencies(${TEST_NPDU_CLIENT_THREE} gtest) +- add_dependencies(${TEST_NPDU_CLIENT_FOUR} gtest) +- add_dependencies(${TEST_NPDU_DAEMON_CLIENT} gtest) +- add_dependencies(${TEST_NPDU_DAEMON_SERVICE} gtest) +- endif() +- add_dependencies(${TEST_SOMEIPTP_CLIENT} gtest) +- add_dependencies(${TEST_SOMEIPTP_SERVICE} gtest) +- if(${TEST_SECOND_ADDRESS}) +- add_dependencies(${TEST_SECOND_ADDRESS_CLIENT} gtest) +- add_dependencies(${TEST_SECOND_ADDRESS_SERVICE} gtest) +- endif() +- add_dependencies(${TEST_SUSPEND_RESUME_CLIENT} gtest) +- add_dependencies(${TEST_SUSPEND_RESUME_SERVICE} gtest) +-else() +- add_dependencies(${TEST_APPLICATION} gtest) +- add_dependencies(${TEST_HEADER_FACTORY} gtest) +- add_dependencies(${TEST_HEADER_FACTORY_CLIENT} gtest) +- add_dependencies(${TEST_HEADER_FACTORY_SERVICE} gtest) +- add_dependencies(${TEST_PAYLOAD_SERVICE} gtest) +- add_dependencies(${TEST_PAYLOAD_CLIENT} gtest) +- add_dependencies(${TEST_BIG_PAYLOAD_SERVICE} gtest) +- add_dependencies(${TEST_BIG_PAYLOAD_CLIENT} gtest) +- add_dependencies(${TEST_LOCAL_ROUTING_SERVICE} gtest) +- add_dependencies(${TEST_LOCAL_ROUTING_CLIENT} gtest) +-endif() + + ############################################################################## + # Add tests to the target build_network_tests +-- +2.25.1 + diff --git a/meta-networking/recipes-protocols/vsomeip/vsomeip/0004-Do-not-specify-PIE-flag-explicitly.patch b/meta-networking/recipes-protocols/vsomeip/vsomeip/0004-Do-not-specify-PIE-flag-explicitly.patch new file mode 100644 index 0000000000..4bb2318555 --- /dev/null +++ b/meta-networking/recipes-protocols/vsomeip/vsomeip/0004-Do-not-specify-PIE-flag-explicitly.patch @@ -0,0 +1,47 @@ +From ec2d36466c9050ee282ea1c3bb1b5f1f61c96ecb Mon Sep 17 00:00:00 2001 +From: Yi Zhao <yi.zhao@windriver.com> +Date: Mon, 17 Jul 2023 14:33:32 +0800 +Subject: [PATCH] Do not specify PIE flag explicitly + +For nodistro distro, packages are built without PIE because +security_flags.inc is not included by default. But in vsomeip, the PIE +flag is explicitly specified in CMAKE_CXX_FLAGS, which will cause +building with PIE even in nodistro, causing an error when linking the +googletest static library: + +TOPDIR/tmp-glibc/work/cortexa53-oe-linux/vsomeip/3.1.20.3-r0/recipe-sysroot-native/usr/bin/aarch64-oe-linux/../../libexec/aarch64-oe-linux/gcc/aarch64-oe-linux/12.2.0/ld: +TOPDIR/tmp-glibc/work/cortexa53-oe-linux/vsomeip/3.1.20.3-r0/recipe-sysroot/usr/lib/libgtest.a(gtest-all.cc.o)(.text+0x4a90): +unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `_ZSt4cerr@@GLIBCXX_3.4' + +Remove PIE flag from CMAKE_CXX_FLAGS and only enable PIE flag by +including security_flags.inc. + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Yi Zhao <yi.zhao@windriver.com> +--- + CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f1bcba27..2653a4df 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -60,12 +60,12 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + # This is only relevant for GCC and causes warnings on Clang + set(EXPORTSYMBOLS "-Wl,-export-dynamic -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exportmap.gcc") +- set(OS_CXX_FLAGS "${OS_CXX_FLAGS} -pie -Wno-tsan -Wl,-z,relro,-z,now") ++ set(OS_CXX_FLAGS "${OS_CXX_FLAGS} -Wno-tsan -Wl,-z,relro,-z,now") + endif() + + set(NO_DEPRECATED "") + set(OPTIMIZE "") +- set(OS_CXX_FLAGS "${OS_CXX_FLAGS} -D_GLIBCXX_USE_NANOSLEEP -pthread -O -Wall -Wextra -Wformat -Wformat-security -Wconversion -fexceptions -fstrict-aliasing -fstack-protector-strong -fasynchronous-unwind-tables -fno-omit-frame-pointer -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Wpedantic -Werror -fPIE") ++ set(OS_CXX_FLAGS "${OS_CXX_FLAGS} -D_GLIBCXX_USE_NANOSLEEP -pthread -O -Wall -Wextra -Wformat -Wformat-security -Wconversion -fexceptions -fstrict-aliasing -fstack-protector-strong -fasynchronous-unwind-tables -fno-omit-frame-pointer -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Wpedantic") + + # force all use of std::mutex and std::recursive_mutex to use runtime init + # instead of static initialization so mutexes can be hooked to enable PI as needed +-- +2.25.1 + diff --git a/meta-networking/recipes-protocols/vsomeip/vsomeip/0005-test-common-CMakeLists.txt-add-missing-link-with-dlt.patch b/meta-networking/recipes-protocols/vsomeip/vsomeip/0005-test-common-CMakeLists.txt-add-missing-link-with-dlt.patch new file mode 100644 index 0000000000..25d66514f8 --- /dev/null +++ b/meta-networking/recipes-protocols/vsomeip/vsomeip/0005-test-common-CMakeLists.txt-add-missing-link-with-dlt.patch @@ -0,0 +1,41 @@ +From 8676ef287bb25b49668be4336387bdf83a0cae5c Mon Sep 17 00:00:00 2001 +From: Yi Zhao <yi.zhao@windriver.com> +Date: Mon, 1 Jan 2024 17:02:41 +0800 +Subject: [PATCH] test/common/CMakeLists.txt: add missing link with dlt + +The libvsomeip_utilities library uses functions e.g. +dlt_check_library_version/dlt_register_app/dlt_unregister_app which are +provided by dlt therefore add it to linker flags. + +Fixes: +x86_64-poky-linux-ld.lld: error: undefined reference due to --no-allow-shlib-undefined: dlt_check_library_version +>>> referenced by test/common/libvsomeip_utilities.so + +x86_64-poky-linux-ld.lld: error: undefined reference due to --no-allow-shlib-undefined: dlt_register_app +>>> referenced by test/common/libvsomeip_utilities.so + +x86_64-poky-linux-ld.lld: error: undefined reference due to --no-allow-shlib-undefined: dlt_unregister_app +>>> referenced by test/common/libvsomeip_utilities.so + +Upstream-Status: Submitted [https://github.com/COVESA/vsomeip/pull/602] + +Signed-off-by: Yi Zhao <yi.zhao@windriver.com> +--- + test/common/CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/test/common/CMakeLists.txt b/test/common/CMakeLists.txt +index d4d14534..afc8c2d6 100644 +--- a/test/common/CMakeLists.txt ++++ b/test/common/CMakeLists.txt +@@ -27,6 +27,7 @@ TARGET_LINK_LIBRARIES ( + ${Boost_LIBRARIES} + ${DL_LIBRARY} + ${TEST_LINK_LIBRARIES} ++ ${DLT_LIBRARIES} + ) + + # ---------------------------------------------------------------------------- +-- +2.25.1 + diff --git a/meta-networking/recipes-protocols/vsomeip/vsomeip_3.4.10.bb b/meta-networking/recipes-protocols/vsomeip/vsomeip_3.4.10.bb new file mode 100644 index 0000000000..4c38970205 --- /dev/null +++ b/meta-networking/recipes-protocols/vsomeip/vsomeip_3.4.10.bb @@ -0,0 +1,75 @@ +SUMMARY = "The implementation of SOME/IP" +DESCRIPTION = "The vsomeip stack implements the http://some-ip.com/ \ +(Scalable service-Oriented MiddlewarE over IP (SOME/IP)) protocol." +HOMEPAGE = "https://github.com/COVESA/vsomeip" +SECTION = "net" + +LICENSE = "MPL-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=9741c346eef56131163e13b9db1241b3" + +SRC_URI = "git://github.com/GENIVI/${BPN}.git;branch=master;protocol=https;name=vsomeip \ + file://0001-Fix-pkgconfig-dir-for-multilib.patch \ + file://0002-Install-example-configuration-files-to-etc-vsomeip.patch \ + file://0003-Do-not-build-external-gtest.patch \ + file://0004-Do-not-specify-PIE-flag-explicitly.patch \ + file://0005-test-common-CMakeLists.txt-add-missing-link-with-dlt.patch \ + " + +SRCREV = "02c199dff8aba814beebe3ca417fd991058fe90c" + +COMPATIBLE_HOST:mips = "null" +COMPATIBLE_HOST:mips64 = "null" +COMPATIBLE_HOST:powerpc = "null" +COMPATIBLE_HOST:libc-musl = 'null' + +DEPENDS = "boost dlt-daemon googletest" + +S = "${WORKDIR}/git" + +inherit cmake pkgconfig + +EXTRA_OECMAKE = "-DINSTALL_LIB_DIR:PATH=${baselib} \ + -DINSTALL_CMAKE_DIR:PATH=${baselib}/cmake/vsomeip3 \ + " + +# For vsomeip-test +EXTRA_OECMAKE += "-DTEST_IP_MASTER=10.0.3.1 \ + -DTEST_IP_SLAVE=10.0.3.2 \ + -DTEST_IP_SLAVE_SECOND=10.0.3.3 \ + -DTEST_UID=1000 -DTEST_GID=1000 \ + " + +RDEPENDS:${PN}-test = "bash lsof" + +do_compile:append() { + cmake_runcmake_build --target examples + cmake_runcmake_build --target build_tests +} + +do_install:append() { + install -d ${D}/opt/${PN}-test/examples + install -m 0755 ${B}/examples/*-sample ${D}/opt/${PN}-test/examples + install -d ${D}/opt/${PN}-test/examples/routingmanagerd + install -m 0755 ${B}/examples/routingmanagerd/routingmanagerd \ + ${D}/opt/${PN}-test/examples/routingmanagerd + + install -d ${D}/opt/${PN}-test/test/test/common + cp -rf ${S}/test/common/examples_policies \ + ${D}/opt/${PN}-test/test/test/common/ + install -m 0755 ${B}/test/common/libvsomeip_utilities.so \ + ${D}/opt/${PN}-test/test/test/common/ + + for d in unit_tests network_tests; do + install -d ${D}/opt/${PN}-test/test/$d + cp -f ${B}/test/$d/*test* ${D}/opt/${PN}-test/test/$d + done +} + +PACKAGES += "${PN}-test" + +FILES:${PN}-dbg += " \ + /opt/${PN}-test/.debug/* \ + " +FILES:${PN}-test = " \ + /opt/${PN}-test \ + " diff --git a/meta-networking/recipes-protocols/xl2tpd/xl2tpd_1.3.14.bb b/meta-networking/recipes-protocols/xl2tpd/xl2tpd_1.3.16.bb index b02e183db7..08bab4a338 100644 --- a/meta-networking/recipes-protocols/xl2tpd/xl2tpd_1.3.14.bb +++ b/meta-networking/recipes-protocols/xl2tpd/xl2tpd_1.3.16.bb @@ -5,11 +5,13 @@ DEPENDS = "ppp virtual/kernel" PACKAGE_ARCH = "${MACHINE_ARCH}" -LICENSE = "GPLv2" +LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263" -SRC_URI = "git://github.com/xelerance/xl2tpd.git" -SRCREV = "ba619c79c4790c78c033df0abde4a9a5de744a08" +SRC_URI = "git://github.com/xelerance/xl2tpd.git;branch=master;protocol=https" +SRCREV = "1ef2a025981223c1e16fc833bef226c86ff8c295" + +UPSTREAM_CHECK_URI = "https://github.com/xelerance/xl2tpd/releases" S = "${WORKDIR}/git" @@ -34,7 +36,7 @@ do_install () { install -m 0644 debian/xl2tpd.default ${D}${sysconfdir}/default/xl2tpd } -CONFFILES_${PN} += "${sysconfdir}/xl2tpd.conf ${sysconfdir}/default/xl2tpd" +CONFFILES:${PN} += "${sysconfdir}/xl2tpd.conf ${sysconfdir}/default/xl2tpd" INITSCRIPT_PACKAGES = "${PN}" -INITSCRIPT_NAME_${PN} = "xl2tpd" +INITSCRIPT_NAME:${PN} = "xl2tpd" diff --git a/meta-networking/recipes-protocols/zeroconf/zeroconf/0001-zeroconf-Rename-arp_op-to-avoid-namespace-conflicts-.patch b/meta-networking/recipes-protocols/zeroconf/zeroconf/0001-zeroconf-Rename-arp_op-to-avoid-namespace-conflicts-.patch index b4d6d94b06..92b581416f 100644 --- a/meta-networking/recipes-protocols/zeroconf/zeroconf/0001-zeroconf-Rename-arp_op-to-avoid-namespace-conflicts-.patch +++ b/meta-networking/recipes-protocols/zeroconf/zeroconf/0001-zeroconf-Rename-arp_op-to-avoid-namespace-conflicts-.patch @@ -12,6 +12,8 @@ and causes the conflict Signed-off-by: Khem Raj <raj.khem@gmail.com> --- +Upstream-Status: Pending + zeroconf.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/meta-networking/recipes-protocols/zeroconf/zeroconf_0.9.bb b/meta-networking/recipes-protocols/zeroconf/zeroconf_0.9.bb index 753d832982..61f6b79dd7 100644 --- a/meta-networking/recipes-protocols/zeroconf/zeroconf_0.9.bb +++ b/meta-networking/recipes-protocols/zeroconf/zeroconf_0.9.bb @@ -7,14 +7,12 @@ These addresses are allocated from the 169.254.0.0/16 address range and \ are normally attached to each Ethernet device in your computer. \ Addresses are assigned randomly by each host and, in case of collision, \ both hosts (are supposed to) renumber." -AUTHOR = "Anand Kumria <wildfire@progsoc.uts.edu.au>" HOMEPAGE = "http://www.progsoc.org/~wildfire/zeroconf/" -LICENSE = "GPLv2+" +LICENSE = "GPL-2.0-or-later" LIC_FILES_CHKSUM = "file://COPYING;md5=4325afd396febcb659c36b49533135d4 \ file://zeroconf.c;beginline=1;endline=13;md5=a5bada96e1e34b08eb7446b28e2630b2" SECTION = "net" -PR = "r1" SRC_URI = "http://www.progsoc.org/~wildfire/zeroconf/download/${BPN}-${PV}.tar.gz \ file://compilefix.patch \ @@ -27,6 +25,8 @@ SRC_URI = "http://www.progsoc.org/~wildfire/zeroconf/download/${BPN}-${PV}.tar.g SRC_URI[md5sum] = "bdafb16b008ebb5633e4e581f77821d2" SRC_URI[sha256sum] = "a8c74df127753e2310fa1e072f3c9ca44a404bb0bbce9cfec7a84c6dff8bec7b" +EXTRA_OEMAKE += "CPPFLAGS='${CFLAGS}'" + do_install () { install -d ${D}${sbindir} install -d ${D}${sysconfdir}/network/if-up.d |