added my Recipes
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
SUMMARY = "Babel is a loop-avoiding distance-vector routing protocol"
|
||||
DESCRIPTION = "\
|
||||
Babel is a loop-avoiding distance-vector routing protocol for IPv6 and \
|
||||
IPv4 with fast convergence properties. It is based on the ideas in DSDV, AODV \
|
||||
and Cisco's EIGRP, but is designed to work well not only in wired networks \
|
||||
but also in wireless mesh networks, and has been extended with support \
|
||||
for overlay networks. Babel is in the process of becoming an IETF Standard. \
|
||||
"
|
||||
HOMEPAGE = "https://www.irif.fr/~jch/software/babel/"
|
||||
SECTION = "net"
|
||||
|
||||
LICENSE = "MIT"
|
||||
LIC_FILES_CHKSUM = "file://LICENCE;md5=411a48ac3c2e9e0911b8dd9aed26f754"
|
||||
|
||||
SRC_URI = "gitsm://github.com/jech/babeld.git;protocol=https;branch=master"
|
||||
SRCREV = "916d3d9aa65683ddf8b96f7f0b466b24cb9d7087"
|
||||
|
||||
UPSTREAM_CHECK_GITTAGREGEX = "babeld-(?P<pver>\d+(\.\d+)+)"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
do_compile () {
|
||||
oe_runmake babeld
|
||||
}
|
||||
|
||||
do_install () {
|
||||
oe_runmake install.minimal TARGET=${D} PREFIX=${root_prefix}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
SECTION = "console/utils"
|
||||
SUMMARY = "A free SOCKS server"
|
||||
DESCRIPTION = "Dante consists of a SOCKS server and a SOCKS client,\
|
||||
implementing RFC 1928 and related standards. It is a flexible product\
|
||||
that can be used to provide convenient and secure network\
|
||||
connectivity. Once installed, Dante can in most cases be made\
|
||||
transparent to clients, providing functionality somewhat similar to\
|
||||
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=edd508404db7339042dfc861a3a690ad"
|
||||
|
||||
SRC_URI = "https://www.inet.no/dante/files/dante-${PV}.tar.gz \
|
||||
"
|
||||
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.
|
||||
# --with-gssapi-path=PATH specify gssapi path
|
||||
# --without-gssapi disable gssapi support
|
||||
# --enable-release build prerelease as full release
|
||||
EXTRA_OECONF += "--without-gssapi --sbindir=${bindir}"
|
||||
|
||||
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 ??= ""
|
||||
|
||||
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"
|
||||
|
||||
INSANE_SKIP:${PN}-libdsocks = "dev-elf"
|
||||
@@ -0,0 +1,97 @@
|
||||
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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,223 @@
|
||||
Replace murmurhash algorithm with Robert Jenkin's hash algorithm
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
From test result, murmurhash algorithm does not work in big endian
|
||||
processor, so replace it with Robert Jenkin's hash which has worked
|
||||
in linux kernel for many years and has more adaptability.
|
||||
|
||||
Signed-off-by: Roy.Li <rongqing.li@windriver.com>
|
||||
---
|
||||
libfdproto/ostr.c | 192 +++++++++++++++++++++--------------------------------
|
||||
1 file changed, 74 insertions(+), 118 deletions(-)
|
||||
|
||||
diff --git a/libfdproto/ostr.c b/libfdproto/ostr.c
|
||||
index 8f29b48..ce1f4dd 100644
|
||||
--- a/libfdproto/ostr.c
|
||||
+++ b/libfdproto/ostr.c
|
||||
@@ -430,128 +430,84 @@ after_proto:
|
||||
|
||||
|
||||
/********************************************************************************************************/
|
||||
-/* Hash function -- credits to Austin Appleby, thank you ^^ */
|
||||
-/* See http://murmurhash.googlepages.com for more information on this function */
|
||||
-
|
||||
-/* the strings are NOT always aligned properly (ex: received in RADIUS message), so we use the aligned MurmurHash2 function as needed */
|
||||
-#define _HASH_MIX(h,k,m) { k *= m; k ^= k >> r; k *= m; h *= m; h ^= k; }
|
||||
-uint32_t fd_os_hash ( uint8_t * string, size_t len )
|
||||
+/*
|
||||
+ * Robert Jenkin's hash function.
|
||||
+ * http://burtleburtle.net/bob/hash/evahash.html
|
||||
+ * This is in the public domain.
|
||||
+ */
|
||||
+#define mix(a, b, c) \
|
||||
+ do { \
|
||||
+ a = a - b; a = a - c; a = a ^ (c >> 13); \
|
||||
+ b = b - c; b = b - a; b = b ^ (a << 8); \
|
||||
+ c = c - a; c = c - b; c = c ^ (b >> 13); \
|
||||
+ a = a - b; a = a - c; a = a ^ (c >> 12); \
|
||||
+ b = b - c; b = b - a; b = b ^ (a << 16); \
|
||||
+ c = c - a; c = c - b; c = c ^ (b >> 5); \
|
||||
+ a = a - b; a = a - c; a = a ^ (c >> 3); \
|
||||
+ b = b - c; b = b - a; b = b ^ (a << 10); \
|
||||
+ c = c - a; c = c - b; c = c ^ (b >> 15); \
|
||||
+ } while (0)
|
||||
+
|
||||
+unsigned hash_rjenkins(const char *str, unsigned length)
|
||||
{
|
||||
- uint32_t hash = len;
|
||||
- uint8_t * data = string;
|
||||
-
|
||||
- const unsigned int m = 0x5bd1e995;
|
||||
- const int r = 24;
|
||||
- int align = (long)string & 3;
|
||||
-
|
||||
- if (!align || (len < 4)) {
|
||||
- /* In case data is aligned, MurmurHash2 function */
|
||||
- while(len >= 4)
|
||||
- {
|
||||
- /* Mix 4 bytes at a time into the hash */
|
||||
- uint32_t k = *(uint32_t *)data; /* We don't care about the byte order */
|
||||
-
|
||||
- _HASH_MIX(hash, k, m);
|
||||
-
|
||||
- data += 4;
|
||||
- len -= 4;
|
||||
- }
|
||||
-
|
||||
- /* Handle the last few bytes of the input */
|
||||
- switch(len) {
|
||||
- case 3: hash ^= data[2] << 16;
|
||||
- case 2: hash ^= data[1] << 8;
|
||||
- case 1: hash ^= data[0];
|
||||
- hash *= m;
|
||||
- }
|
||||
-
|
||||
- } else {
|
||||
- /* Unaligned data, use alignment-safe slower version */
|
||||
-
|
||||
- /* Pre-load the temp registers */
|
||||
- uint32_t t = 0, d = 0;
|
||||
- switch(align)
|
||||
- {
|
||||
- case 1: t |= data[2] << 16;
|
||||
- case 2: t |= data[1] << 8;
|
||||
- case 3: t |= data[0];
|
||||
- }
|
||||
- t <<= (8 * align);
|
||||
-
|
||||
- data += 4-align;
|
||||
- len -= 4-align;
|
||||
-
|
||||
- /* From this point, "data" can be read by chunks of 4 bytes */
|
||||
-
|
||||
- int sl = 8 * (4-align);
|
||||
- int sr = 8 * align;
|
||||
-
|
||||
- /* Mix */
|
||||
- while(len >= 4)
|
||||
- {
|
||||
- uint32_t k;
|
||||
-
|
||||
- d = *(unsigned int *)data;
|
||||
- k = (t >> sr) | (d << sl);
|
||||
-
|
||||
- _HASH_MIX(hash, k, m);
|
||||
-
|
||||
- t = d;
|
||||
-
|
||||
- data += 4;
|
||||
- len -= 4;
|
||||
- }
|
||||
-
|
||||
- /* Handle leftover data in temp registers */
|
||||
- d = 0;
|
||||
- if(len >= align)
|
||||
- {
|
||||
- uint32_t k;
|
||||
-
|
||||
- switch(align)
|
||||
- {
|
||||
- case 3: d |= data[2] << 16;
|
||||
- case 2: d |= data[1] << 8;
|
||||
- case 1: d |= data[0];
|
||||
- }
|
||||
-
|
||||
- k = (t >> sr) | (d << sl);
|
||||
- _HASH_MIX(hash, k, m);
|
||||
-
|
||||
- data += align;
|
||||
- len -= align;
|
||||
-
|
||||
- /* Handle tail bytes */
|
||||
-
|
||||
- switch(len)
|
||||
- {
|
||||
- case 3: hash ^= data[2] << 16;
|
||||
- case 2: hash ^= data[1] << 8;
|
||||
- case 1: hash ^= data[0];
|
||||
- hash *= m;
|
||||
- };
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- switch(len)
|
||||
- {
|
||||
- case 3: d |= data[2] << 16;
|
||||
- case 2: d |= data[1] << 8;
|
||||
- case 1: d |= data[0];
|
||||
- case 0: hash ^= (t >> sr) | (d << sl);
|
||||
- hash *= m;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
+ const unsigned char *k = (const unsigned char *)str;
|
||||
+ uint32_t a, b, c; /* the internal state */
|
||||
+ uint32_t len; /* how many key bytes still need mixing */
|
||||
+
|
||||
+ /* Set up the internal state */
|
||||
+ len = length;
|
||||
+ a = 0x9e3779b9; /* the golden ratio; an arbitrary value */
|
||||
+ b = a;
|
||||
+ c = 0; /* variable initialization of internal state */
|
||||
+
|
||||
+ /* handle most of the key */
|
||||
+ while (len >= 12) {
|
||||
+ a = a + (k[0] + ((uint32_t)k[1] << 8) + ((uint32_t)k[2] << 16) +
|
||||
+ ((uint32_t)k[3] << 24));
|
||||
+ b = b + (k[4] + ((uint32_t)k[5] << 8) + ((uint32_t)k[6] << 16) +
|
||||
+ ((uint32_t)k[7] << 24));
|
||||
+ c = c + (k[8] + ((uint32_t)k[9] << 8) + ((uint32_t)k[10] << 16) +
|
||||
+ ((uint32_t)k[11] << 24));
|
||||
+ mix(a, b, c);
|
||||
+ k = k + 12;
|
||||
+ len = len - 12;
|
||||
+ }
|
||||
|
||||
+ /* handle the last 11 bytes */
|
||||
+ c = c + length;
|
||||
+ switch (len) { /* all the case statements fall through */
|
||||
+ case 11:
|
||||
+ c = c + ((uint32_t)k[10] << 24);
|
||||
+ case 10:
|
||||
+ c = c + ((uint32_t)k[9] << 16);
|
||||
+ case 9:
|
||||
+ c = c + ((uint32_t)k[8] << 8);
|
||||
+ /* the first byte of c is reserved for the length */
|
||||
+ case 8:
|
||||
+ b = b + ((uint32_t)k[7] << 24);
|
||||
+ case 7:
|
||||
+ b = b + ((uint32_t)k[6] << 16);
|
||||
+ case 6:
|
||||
+ b = b + ((uint32_t)k[5] << 8);
|
||||
+ case 5:
|
||||
+ b = b + k[4];
|
||||
+ case 4:
|
||||
+ a = a + ((uint32_t)k[3] << 24);
|
||||
+ case 3:
|
||||
+ a = a + ((uint32_t)k[2] << 16);
|
||||
+ case 2:
|
||||
+ a = a + ((uint32_t)k[1] << 8);
|
||||
+ case 1:
|
||||
+ a = a + k[0];
|
||||
+ /* case 0: nothing left to add */
|
||||
}
|
||||
+ mix(a, b, c);
|
||||
|
||||
- /* Do a few final mixes of the hash to ensure the last few
|
||||
- bytes are well-incorporated. */
|
||||
- hash ^= hash >> 13;
|
||||
- hash *= m;
|
||||
- hash ^= hash >> 15;
|
||||
+ return c;
|
||||
+}
|
||||
|
||||
- return hash;
|
||||
+uint32_t fd_os_hash ( uint8_t * string, size_t len )
|
||||
+{
|
||||
+ return hash_rjenkins(string, len);
|
||||
}
|
||||
|
||||
--
|
||||
1.7.10.4
|
||||
|
||||
@@ -0,0 +1,250 @@
|
||||
# This is a sample configuration file for freeDiameter daemon.
|
||||
|
||||
# Most of the options can be omitted, as they default to reasonable values.
|
||||
# Only TLS-related options must be configured properly in usual setups.
|
||||
|
||||
# It is possible to use "include" keyword to import additional files
|
||||
# e.g.: include "/etc/freeDiameter.d/*.conf"
|
||||
# This is exactly equivalent as copy & paste the content of the included file(s)
|
||||
# where the "include" keyword is found.
|
||||
|
||||
|
||||
##############################################################
|
||||
## Peer identity and realm
|
||||
|
||||
# The Diameter Identity of this daemon.
|
||||
# This must be a valid FQDN that resolves to the local host.
|
||||
# Default: hostname's FQDN
|
||||
#Identity = "aaa.koganei.freediameter.net";
|
||||
|
||||
# The Diameter Realm of this daemon.
|
||||
# Default: the domain part of Identity (after the first dot).
|
||||
#Realm = "koganei.freediameter.net";
|
||||
|
||||
##############################################################
|
||||
## Transport protocol configuration
|
||||
|
||||
# The port this peer is listening on for incoming connections (TCP and SCTP).
|
||||
# Default: 3868. Use 0 to disable.
|
||||
#Port = 3868;
|
||||
|
||||
# The port this peer is listening on for incoming TLS-protected connections (TCP and SCTP).
|
||||
# See TLS_old_method for more information about TLS flavours.
|
||||
# Note: we use TLS/SCTP instead of DTLS/SCTP at the moment. This will change in future version of freeDiameter.
|
||||
# Default: 5868. Use 0 to disable.
|
||||
#SecPort = 5868;
|
||||
|
||||
# Use RFC3588 method for TLS protection, where TLS is negociated after CER/CEA exchange is completed
|
||||
# on the unsecure connection. The alternative is RFC6733 mechanism, where TLS protects also the
|
||||
# CER/CEA exchange on a dedicated secure port.
|
||||
# This parameter only affects outgoing connections.
|
||||
# The setting can be also defined per-peer (see Peers configuration section).
|
||||
# Default: use RFC6733 method with separate port for TLS.
|
||||
#TLS_old_method;
|
||||
|
||||
# Disable use of TCP protocol (only listen and connect over SCTP)
|
||||
# Default : TCP enabled
|
||||
#No_TCP;
|
||||
|
||||
# Disable use of SCTP protocol (only listen and connect over TCP)
|
||||
# Default : SCTP enabled
|
||||
#No_SCTP;
|
||||
# This option is ignored if freeDiameter is compiled with DISABLE_SCTP option.
|
||||
|
||||
# Prefer TCP instead of SCTP for establishing new connections.
|
||||
# This setting may be overwritten per peer in peer configuration blocs.
|
||||
# Default : SCTP is attempted first.
|
||||
#Prefer_TCP;
|
||||
|
||||
# Default number of streams per SCTP associations.
|
||||
# This setting may be overwritten per peer basis.
|
||||
# Default : 30 streams
|
||||
#SCTP_streams = 30;
|
||||
|
||||
##############################################################
|
||||
## Endpoint configuration
|
||||
|
||||
# Disable use of IP addresses (only IPv6)
|
||||
# Default : IP enabled
|
||||
#No_IP;
|
||||
|
||||
# Disable use of IPv6 addresses (only IP)
|
||||
# Default : IPv6 enabled
|
||||
#No_IPv6;
|
||||
|
||||
# Specify local addresses the server must bind to
|
||||
# Default : listen on all addresses available.
|
||||
#ListenOn = "202.249.37.5";
|
||||
#ListenOn = "2001:200:903:2::202:1";
|
||||
#ListenOn = "fe80::21c:5ff:fe98:7d62%eth0";
|
||||
|
||||
|
||||
##############################################################
|
||||
## Server configuration
|
||||
|
||||
# How many Diameter peers are allowed to be connecting at the same time ?
|
||||
# This parameter limits the number of incoming connections from the time
|
||||
# the connection is accepted until the first CER is received.
|
||||
# Default: 5 unidentified clients in paralel.
|
||||
#ThreadsPerServer = 5;
|
||||
|
||||
##############################################################
|
||||
## TLS Configuration
|
||||
|
||||
# TLS is managed by the GNUTLS library in the freeDiameter daemon.
|
||||
# You may find more information about parameters and special behaviors
|
||||
# in the relevant documentation.
|
||||
# http://www.gnu.org/software/gnutls/manual/
|
||||
|
||||
# Credentials of the local peer
|
||||
# The X509 certificate and private key file to use for the local peer.
|
||||
# The files must contain PKCS-1 encoded RSA key, in PEM format.
|
||||
# (These parameters are passed to gnutls_certificate_set_x509_key_file function)
|
||||
# Default : NO DEFAULT
|
||||
#TLS_Cred = "<x509 certif file.PEM>" , "<x509 private key file.PEM>";
|
||||
#TLS_Cred = "/etc/ssl/certs/freeDiameter.pem", "/etc/ssl/private/freeDiameter.key";
|
||||
|
||||
# Certificate authority / trust anchors
|
||||
# The file containing the list of trusted Certificate Authorities (PEM list)
|
||||
# (This parameter is passed to gnutls_certificate_set_x509_trust_file function)
|
||||
# The directive can appear several times to specify several files.
|
||||
# Default : GNUTLS default behavior
|
||||
#TLS_CA = "<file.PEM>";
|
||||
|
||||
# Certificate Revocation List file
|
||||
# The information about revoked certificates.
|
||||
# The file contains a list of trusted CRLs in PEM format. They should have been verified before.
|
||||
# (This parameter is passed to gnutls_certificate_set_x509_crl_file function)
|
||||
# Note: openssl CRL format might have interoperability issue with GNUTLS format.
|
||||
# Default : GNUTLS default behavior
|
||||
#TLS_CRL = "<file.PEM>";
|
||||
|
||||
# GNU TLS Priority string
|
||||
# This string allows to configure the behavior of GNUTLS key exchanges
|
||||
# algorithms. See gnutls_priority_init function documentation for information.
|
||||
# You should also refer to the Diameter required TLS support here:
|
||||
# http://tools.ietf.org/html/rfc6733#section-13.1
|
||||
# Default : "NORMAL"
|
||||
# Example: TLS_Prio = "NONE:+VERS-TLS1.1:+AES-128-CBC:+RSA:+SHA1:+COMP-NULL";
|
||||
#TLS_Prio = "NORMAL";
|
||||
|
||||
# Diffie-Hellman parameters size
|
||||
# Set the number of bits for generated DH parameters
|
||||
# Valid value should be 768, 1024, 2048, 3072 or 4096.
|
||||
# (This parameter is passed to gnutls_dh_params_generate2 function,
|
||||
# it usually should match RSA key size)
|
||||
# Default : 1024
|
||||
#TLS_DH_Bits = 1024;
|
||||
|
||||
# Alternatively, you can specify a file to load the PKCS#3 encoded
|
||||
# DH parameters directly from. This accelerates the daemon start
|
||||
# but is slightly less secure. If this file is provided, the
|
||||
# TLS_DH_Bits parameters has no effect.
|
||||
# Default : no default.
|
||||
#TLS_DH_File = "<file.PEM>";
|
||||
|
||||
|
||||
##############################################################
|
||||
## Timers configuration
|
||||
|
||||
# The Tc timer of this peer.
|
||||
# It is the delay before a new attempt is made to reconnect a disconnected peer.
|
||||
# The value is expressed in seconds. The recommended value is 30 seconds.
|
||||
# Default: 30
|
||||
#TcTimer = 30;
|
||||
|
||||
# The Tw timer of this peer.
|
||||
# It is the delay before a watchdog message is sent, as described in RFC 3539.
|
||||
# The value is expressed in seconds. The default value is 30 seconds. Value must
|
||||
# be greater or equal to 6 seconds. See details in the RFC.
|
||||
# Default: 30
|
||||
#TwTimer = 30;
|
||||
|
||||
##############################################################
|
||||
## Applications configuration
|
||||
|
||||
# Disable the relaying of Diameter messages?
|
||||
# For messages not handled locally, the default behavior is to forward the
|
||||
# message to another peer if any is available, according to the routing
|
||||
# algorithms. In addition the "0xffffff" application is advertised in CER/CEA
|
||||
# exchanges.
|
||||
# Default: Relaying is enabled.
|
||||
#NoRelay;
|
||||
|
||||
# Number of server threads that can handle incoming messages at the same time.
|
||||
# Default: 4
|
||||
#AppServThreads = 4;
|
||||
|
||||
# Other applications are configured by loaded extensions.
|
||||
|
||||
##############################################################
|
||||
## Extensions configuration
|
||||
|
||||
# The freeDiameter framework merely provides support for
|
||||
# Diameter Base Protocol. The specific application behaviors,
|
||||
# as well as advanced functions, are provided
|
||||
# by loadable extensions (plug-ins).
|
||||
# These extensions may in addition receive the name of a
|
||||
# configuration file, the format of which is extension-specific.
|
||||
#
|
||||
# Format:
|
||||
#LoadExtension = "/path/to/extension" [ : "/optional/configuration/file" ] ;
|
||||
#
|
||||
# Examples:
|
||||
#LoadExtension = "extensions/sample.fdx";
|
||||
#LoadExtension = "extensions/sample.fdx":"conf/sample.conf";
|
||||
|
||||
# Extensions are named as follow:
|
||||
# dict_* for extensions that add content to the dictionary definitions.
|
||||
# dbg_* for extensions useful only to retrieve more information on the framework execution.
|
||||
# acl_* : Access control list, to control which peers are allowed to connect.
|
||||
# rt_* : routing extensions that impact how messages are forwarded to other peers.
|
||||
# app_* : applications, these extensions usually register callbacks to handle specific messages.
|
||||
# test_* : dummy extensions that are useful only in testing environments.
|
||||
|
||||
|
||||
# The dbg_msg_dump.fdx extension allows you to tweak the way freeDiameter displays some
|
||||
# information about some events. This extension does not actually use a configuration file
|
||||
# but receives directly a parameter in the string passed to the extension. Here are some examples:
|
||||
## LoadExtension = "dbg_msg_dumps.fdx" : "0x1111"; # Removes all default hooks, very quiet even in case of errors.
|
||||
## LoadExtension = "dbg_msg_dumps.fdx" : "0x2222"; # Display all events with few details.
|
||||
## LoadExtension = "dbg_msg_dumps.fdx" : "0x0080"; # Dump complete information about sent and received messages.
|
||||
# The four digits respectively control: connections, routing decisions, sent/received messages, errors.
|
||||
# The values for each digit are:
|
||||
# 0 - default - keep the default behavior
|
||||
# 1 - quiet - remove any specific log
|
||||
# 2 - compact - display only a summary of the information
|
||||
# 4 - full - display the complete information on a single long line
|
||||
# 8 - tree - display the complete information in an easier to read format spanning several lines.
|
||||
|
||||
|
||||
##############################################################
|
||||
## Peers configuration
|
||||
|
||||
# The local server listens for incoming connections. By default,
|
||||
# all unknown connecting peers are rejected. Extensions can override this behavior (e.g., acl_wl).
|
||||
#
|
||||
# In addition to incoming connections, the local peer can
|
||||
# be configured to establish and maintain connections to some
|
||||
# Diameter nodes and allow connections from these nodes.
|
||||
# This is achieved with the ConnectPeer directive described below.
|
||||
#
|
||||
# Note that the configured Diameter Identity MUST match
|
||||
# the information received inside CEA, or the connection will be aborted.
|
||||
#
|
||||
# Format:
|
||||
#ConnectPeer = "diameterid" [ { parameter1; parameter2; ...} ] ;
|
||||
# Parameters that can be specified in the peer's parameter list:
|
||||
# No_TCP; No_SCTP; No_IP; No_IPv6; Prefer_TCP; TLS_old_method;
|
||||
# No_TLS; # assume transparent security instead of TLS. DTLS is not supported yet (will change in future versions).
|
||||
# Port = 5868; # The port to connect to
|
||||
# TcTimer = 30;
|
||||
# TwTimer = 30;
|
||||
# ConnectTo = "202.249.37.5";
|
||||
# ConnectTo = "2001:200:903:2::202:1";
|
||||
# TLS_Prio = "NORMAL";
|
||||
# Realm = "realm.net"; # Reject the peer if it does not advertise this realm.
|
||||
# Examples:
|
||||
#ConnectPeer = "aaa.wide.ad.jp";
|
||||
#ConnectPeer = "old.diameter.serv" { TcTimer = 60; TLS_old_method; No_SCTP; Port=3868; } ;
|
||||
##############################################################
|
||||
@@ -0,0 +1,72 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: freediameter
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Required-Start: $remote_fs $syslog
|
||||
# Required-Stop: $remote_fs $syslog
|
||||
# Short-Description: Start freeDiameter daemon at boot time
|
||||
# Description: Start the freeDiameter daemon at boot time.
|
||||
# freeDiameter is an extensible implementation of the Diameter protocol,
|
||||
# designed for Authentication, Authorization and Accounting. Diameter is
|
||||
# an evolution of the RADIUS protocol.
|
||||
### END INIT INFO#
|
||||
DAEMON=/usr/bin/freeDiameterd
|
||||
CONF=/etc/freeDiameter/freeDiameter.conf
|
||||
NAME=freediameter
|
||||
DESC="freeDiameter daemon"
|
||||
|
||||
. /etc/init.d/functions
|
||||
start() {
|
||||
[ -x $DAEMON ] || exit 5
|
||||
echo -n $"Starting $DAEMON: "
|
||||
start-stop-daemon -S -b -x ${DAEMON} && success || failure
|
||||
retval=$?
|
||||
echo ""
|
||||
return $retval
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo -n $"Stopping $prog: "
|
||||
start-stop-daemon -K -x $DAEMON
|
||||
retval=$?
|
||||
echo ""
|
||||
return $retval
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
sleep 3
|
||||
start
|
||||
}
|
||||
|
||||
rh_status() {
|
||||
status $DAEMON
|
||||
}
|
||||
|
||||
rh_status_q() {
|
||||
rh_status > /dev/null 2>&1
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
rh_status_q && exit 0
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
rh_status_q || exit 0
|
||||
stop
|
||||
;;
|
||||
restart)
|
||||
restart
|
||||
;;
|
||||
status)
|
||||
rh_status
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $prog {start|stop|status|restart}"
|
||||
exit 2
|
||||
esac
|
||||
|
||||
exit $?
|
||||
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=freediameter daemon
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
PIDFile=/run/freediameter.pid
|
||||
ExecStart=@BINDIR@/freeDiameterd
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,22 @@
|
||||
CMakeLists: add an option to install tests
|
||||
|
||||
Upstream-Status: Inappropriate [OE ptest specific]
|
||||
|
||||
Original author: Yao Zhao <yao.zhao@windriver.com>
|
||||
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
|
||||
|
||||
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
|
||||
index da8da1b..de04059 100644
|
||||
--- a/tests/CMakeLists.txt
|
||||
+++ b/tests/CMakeLists.txt
|
||||
@@ -113,4 +113,9 @@ ENDFOREACH( TEST )
|
||||
####
|
||||
## INSTALL section ##
|
||||
|
||||
-# we do not install the tests
|
||||
+# install the tests
|
||||
+SET(INSTALL_TEST_SUFFIX /opt/${FD_PROJECT_NAME}-tests CACHE PATH "Directory where the test binary is installed.")
|
||||
+
|
||||
+INSTALL(TARGETS ${TEST_LIST}
|
||||
+ RUNTIME DESTINATION ${INSTALL_TEST_SUFFIX}
|
||||
+ COMPONENT freeDiameter-common)
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
if ! lsmod | grep -q sctp && ! modprobe sctp 2>/dev/null; then
|
||||
echo "Couldn't load kernel module sctp."
|
||||
echo "Test cases testsctp and testcnx will fail."
|
||||
echo
|
||||
fi
|
||||
|
||||
cmake -E cmake_echo_color --cyan "Running tests..."
|
||||
ctest --force-new-ctest-process
|
||||
@@ -0,0 +1,141 @@
|
||||
SUMMARY = "An open source implementation of the diameter protocol"
|
||||
DESCRIPTION = "\
|
||||
freeDiameter is an open source Diameter protocol implementation \
|
||||
(RFC3588). It provides an extensible platform for deploying a \
|
||||
Diameter network for your Authentication, Authorization and \
|
||||
Accounting needs."
|
||||
|
||||
HOMEPAGE = "http://www.freediameter.net"
|
||||
|
||||
DEPENDS = "flex bison cmake-native libgcrypt gnutls libidn 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 \
|
||||
file://Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch \
|
||||
file://freediameter.service \
|
||||
file://freediameter.init \
|
||||
${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'file://install_test.patch file://run-ptest file://0001-tests-use-EXTENSIONS_DIR.patch', '', d)} \
|
||||
file://freeDiameter.conf \
|
||||
file://0001-libfdcore-sctp.c-update-the-old-sctp-api-check.patch \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "7a537401bd110c606594b7c6be71b993f0ccc73ae151ad68040979286ba4e50e"
|
||||
|
||||
S = "${WORKDIR}/${fd_pkgname}-${PV}"
|
||||
|
||||
LICENSE = "BSD-3-Clause"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=69bdc1d97648a2d35914563fcbbb361a"
|
||||
|
||||
PTEST_PATH = "${libdir}/${fd_pkgname}/ptest"
|
||||
|
||||
inherit cmake pkgconfig update-rc.d ptest systemd
|
||||
|
||||
EXTRA_OECMAKE = " \
|
||||
-DDEFAULT_CONF_PATH:PATH=${sysconfdir}/${fd_pkgname} \
|
||||
-DBUILD_DBG_MONITOR:BOOL=ON \
|
||||
-DBUILD_TEST_APP:BOOL=ON \
|
||||
-DBUILD_TESTING:BOOL=ON \
|
||||
-DBUILD_APP_RADGW:BOOL=ON \
|
||||
-DBUILD_APP_REDIRECT:BOOL=ON \
|
||||
-DBUILD_TEST_ACCT:BOOL=ON \
|
||||
-DBUILD_TEST_NETEMUL:BOOL=ON \
|
||||
-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 \
|
||||
"
|
||||
# INSTALL_LIBRARY_SUFFIX is relative to CMAKE_INSTALL_PREFIX
|
||||
# specify it on cmd line will fix the SET bug in CMakeList.txt
|
||||
|
||||
# -DBUILD_APP_ACCT:BOOL=ON This needs POSTGRESQL support
|
||||
|
||||
# -DBUILD_APP_DIAMEAP:BOOL=ON -DBUILD_APP_SIP:BOOL=ON -DBUILD_TEST_SIP:BOOL=ON
|
||||
# These need MySQL support
|
||||
|
||||
# -DBUILD_DBG_INTERACTIVE:BOOL=ON This needs SWIG support
|
||||
|
||||
# -DALL_EXTENSIONS=ON will enable all
|
||||
|
||||
FD_KEY ?="${BPN}.key"
|
||||
FD_PEM ?= "${BPN}.pem"
|
||||
FD_CA ?= "${BPN}.pem"
|
||||
FD_DH_PEM ?= "${BPN}-dh.pem"
|
||||
FD_HOSTNAME ?= "${MACHINE}"
|
||||
FD_REALM ?= "openembedded.org"
|
||||
|
||||
do_install:append() {
|
||||
# install the sample configuration files
|
||||
install -d -m 0755 ${D}${sysconfdir}/${fd_pkgname}
|
||||
for i in ${S}/doc/*.conf.sample; do
|
||||
install -m 0644 $i ${D}${sysconfdir}/${fd_pkgname}/
|
||||
done
|
||||
mv ${D}${sysconfdir}/${fd_pkgname}/freediameter.conf.sample \
|
||||
${D}${sysconfdir}/${fd_pkgname}/freeDiameter.conf.sample
|
||||
install -d ${D}${sysconfdir}/freeDiameter
|
||||
install ${WORKDIR}/freeDiameter.conf ${D}${sysconfdir}/${fd_pkgname}/freeDiameter.conf
|
||||
|
||||
# install daemon init related files
|
||||
install -d -m 0755 ${D}${sysconfdir}/default
|
||||
install -d -m 0755 ${D}${sysconfdir}/init.d
|
||||
install -m 0644 ${S}/contrib/debian/freediameter-daemon.default \
|
||||
${D}${sysconfdir}/default/${BPN}
|
||||
install -m 0755 ${WORKDIR}/freediameter.init ${D}${sysconfdir}/init.d/${BPN}
|
||||
|
||||
# install for systemd
|
||||
install -d ${D}${systemd_system_unitdir}
|
||||
install -m 0644 ${WORKDIR}/freediameter.service ${D}${systemd_system_unitdir}
|
||||
sed -i -e 's,@BINDIR@,${bindir},g' ${D}${systemd_system_unitdir}/*.service
|
||||
|
||||
cat >> ${D}${sysconfdir}/freeDiameter/freeDiameter.conf <<EOF
|
||||
## OE specific ##
|
||||
#Identity="${FD_HOSTNAME}";
|
||||
Identity = "${FD_HOSTNAME}.${FD_REALM}";
|
||||
Realm = "${FD_REALM}";
|
||||
Port = 30868;
|
||||
SecPort = 30869;
|
||||
TLS_Cred = "/etc/freeDiameter/${FD_PEM}" , "/etc/freeDiameter/${FD_KEY}";
|
||||
TLS_CA = "/etc/freeDiameter/${FD_CA}";
|
||||
TLS_DH_File = "/etc/freeDiameter/${FD_DH_PEM}";
|
||||
EOF
|
||||
|
||||
# create self cert
|
||||
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() {
|
||||
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/*"
|
||||
|
||||
# include the extensions in main package
|
||||
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"
|
||||
|
||||
INITSCRIPT_PACKAGES = "${PN}"
|
||||
INITSCRIPT_NAME:${PN} = "${BPN}"
|
||||
INITSCRIPT_PARAMS:${PN} = "start 30 . stop 70 0 1 2 3 4 5 6 ."
|
||||
|
||||
SYSTEMD_SERVICE:${PN} = "freediameter.service"
|
||||
SYSTEMD_AUTO_ENABLE = "disable"
|
||||
|
||||
CONFFILES:${PN} = "${sysconfdir}/freediameter.conf"
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
From a82d704b1ec6ece47b01d12e0e067d4b62b10894 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Kanavin <alex@linutronix.de>
|
||||
Date: Wed, 9 Nov 2022 20:24:45 +0100
|
||||
Subject: [PATCH] m4/ax_python.m4: check for python-x.y-emded.pc, not
|
||||
python-x.y.pc
|
||||
|
||||
Only the embed version includes necessary linker flags to link
|
||||
with libpython.
|
||||
|
||||
Upstream-Status: Backport
|
||||
[https://github.com/FRRouting/frr/commit/a82d704b1ec6ece47b01d12e0e067d4b62b10894]
|
||||
|
||||
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
|
||||
---
|
||||
m4/ax_python.m4 | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/m4/ax_python.m4 b/m4/ax_python.m4
|
||||
index 91d12b99b..f5e603b96 100644
|
||||
--- a/m4/ax_python.m4
|
||||
+++ b/m4/ax_python.m4
|
||||
@@ -206,7 +206,7 @@ AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
||||
AC_MSG_CHECKING([whether pkg-config python-${tryver} is available])
|
||||
unset PYTHON_CFLAGS
|
||||
unset PYTHON_LIBS
|
||||
- pkg="python-${tryver}"
|
||||
+ pkg="python-${tryver}-embed"
|
||||
pkg="${pkg%-}"
|
||||
_PKG_CONFIG([PYTHON_CFLAGS], [cflags], [${pkg}])
|
||||
_PKG_CONFIG([PYTHON_LIBS], [libs], [${pkg}])
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
#
|
||||
# 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
|
||||
# /etc/shadow entries.
|
||||
auth include common-auth
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
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://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
|
||||
file://COPYING-LGPLv2.1;md5=4fbd65380cdd255951079008b364516c"
|
||||
|
||||
SRC_URI = "git://github.com/FRRouting/frr.git;protocol=https;branch=stable/8.4 \
|
||||
file://frr.pam \
|
||||
file://0001-m4-ax_python.m4-check-for-python-x.y-emded.pc-not-py.patch \
|
||||
"
|
||||
|
||||
SRCREV = "45e36c0c00a517ad1606135b18c5753e210cfc0d"
|
||||
|
||||
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"
|
||||
|
||||
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=${libdir}/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'"
|
||||
|
||||
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"
|
||||
|
||||
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 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
|
||||
}
|
||||
|
||||
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"
|
||||
@@ -0,0 +1,61 @@
|
||||
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 1/8] Create subroutine for cleaning recent interfaces
|
||||
|
||||
Moves functionality for cleaning the list of recent
|
||||
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 0a7c3dfa2475..fe7242d83599 100644
|
||||
--- a/mDNSPosix/mDNSPosix.c
|
||||
+++ b/mDNSPosix/mDNSPosix.c
|
||||
@@ -1322,6 +1322,19 @@ mDNSlocal int SetupSocket(struct sockaddr *intfAddr, mDNSIPPort port, int interf
|
||||
return err;
|
||||
}
|
||||
|
||||
+// Clean up any interfaces that have been hanging around on the RecentInterfaces list for more than a minute
|
||||
+mDNSlocal void CleanRecentInterfaces(void)
|
||||
+{
|
||||
+ PosixNetworkInterface **ri = &gRecentInterfaces;
|
||||
+ const mDNSs32 utc = mDNSPlatformUTC();
|
||||
+ while (*ri)
|
||||
+ {
|
||||
+ PosixNetworkInterface *pi = *ri;
|
||||
+ if (utc - pi->LastSeen < 60) ri = (PosixNetworkInterface **)&pi->coreIntf.next;
|
||||
+ 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,
|
||||
@@ -1559,16 +1572,7 @@ mDNSlocal int SetupInterfaceList(mDNS *const m)
|
||||
|
||||
// Clean up.
|
||||
if (intfList != NULL) freeifaddrs(intfList);
|
||||
-
|
||||
- // Clean up any interfaces that have been hanging around on the RecentInterfaces list for more than a minute
|
||||
- PosixNetworkInterface **ri = &gRecentInterfaces;
|
||||
- const mDNSs32 utc = mDNSPlatformUTC();
|
||||
- while (*ri)
|
||||
- {
|
||||
- PosixNetworkInterface *pi = *ri;
|
||||
- if (utc - pi->LastSeen < 60) ri = (PosixNetworkInterface **)&pi->coreIntf.next;
|
||||
- else { *ri = (PosixNetworkInterface *)pi->coreIntf.next; mdns_free(pi); }
|
||||
- }
|
||||
+ CleanRecentInterfaces();
|
||||
|
||||
return err;
|
||||
}
|
||||
--
|
||||
2.35.1
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
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(+)
|
||||
|
||||
diff --git a/mDNSPosix/nss_mdns.c b/mDNSPosix/nss_mdns.c
|
||||
index afadb3c6c33b..84c312759463 100644
|
||||
--- a/mDNSPosix/nss_mdns.c
|
||||
+++ b/mDNSPosix/nss_mdns.c
|
||||
@@ -89,6 +89,9 @@
|
||||
|
||||
#include <dns_sd.h>
|
||||
|
||||
+#if !defined(NETDB_INTERNAL)
|
||||
+# define NETDB_INTERNAL (-1)
|
||||
+#endif
|
||||
|
||||
//----------
|
||||
// Public functions
|
||||
--
|
||||
2.35.1
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
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 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 fe7242d83599..a32a880c0ce5 100644
|
||||
--- a/mDNSPosix/mDNSPosix.c
|
||||
+++ b/mDNSPosix/mDNSPosix.c
|
||||
@@ -1043,6 +1043,19 @@ mDNSlocal void FreePosixNetworkInterface(PosixNetworkInterface *intf)
|
||||
gRecentInterfaces = intf;
|
||||
}
|
||||
|
||||
+mDNSlocal void TearDownInterface(mDNS *const m, PosixNetworkInterface *intf)
|
||||
+{
|
||||
+ mDNS_DeregisterInterface(m, &intf->coreIntf, NormalActivation);
|
||||
+ if (gMDNSPlatformPosixVerboseLevel > 0) fprintf(stderr, "Deregistered interface %s\n", intf->intfName);
|
||||
+ FreePosixNetworkInterface(intf);
|
||||
+
|
||||
+ num_registered_interfaces--;
|
||||
+ if (num_registered_interfaces == 0) {
|
||||
+ num_pkts_accepted = 0;
|
||||
+ num_pkts_rejected = 0;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
// Grab the first interface, deregister it, free it, and repeat until done.
|
||||
mDNSlocal void ClearInterfaceList(mDNS *const m)
|
||||
{
|
||||
@@ -1051,13 +1064,10 @@ mDNSlocal void ClearInterfaceList(mDNS *const m)
|
||||
while (m->HostInterfaces)
|
||||
{
|
||||
PosixNetworkInterface *intf = (PosixNetworkInterface*)(m->HostInterfaces);
|
||||
- mDNS_DeregisterInterface(m, &intf->coreIntf, NormalActivation);
|
||||
- if (gMDNSPlatformPosixVerboseLevel > 0) fprintf(stderr, "Deregistered interface %s\n", intf->intfName);
|
||||
- FreePosixNetworkInterface(intf);
|
||||
+ TearDownInterface(m, intf);
|
||||
}
|
||||
- num_registered_interfaces = 0;
|
||||
- num_pkts_accepted = 0;
|
||||
- num_pkts_rejected = 0;
|
||||
+
|
||||
+ assert(num_registered_interfaces == 0);
|
||||
}
|
||||
|
||||
mDNSlocal int SetupIPv6Socket(int fd)
|
||||
--
|
||||
2.35.1
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
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(-)
|
||||
|
||||
diff --git a/mDNSPosix/Makefile b/mDNSPosix/Makefile
|
||||
index 802a13dd70b6..5e74193c0e89 100755
|
||||
--- a/mDNSPosix/Makefile
|
||||
+++ b/mDNSPosix/Makefile
|
||||
@@ -276,7 +276,7 @@ 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 $(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
|
||||
--
|
||||
2.35.1
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
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 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 a32a880c0ce5..9a5b4d7ea4cb 100644
|
||||
--- a/mDNSPosix/mDNSPosix.c
|
||||
+++ b/mDNSPosix/mDNSPosix.c
|
||||
@@ -1415,6 +1415,7 @@ mDNSlocal int SetupOneInterface(mDNS *const m, struct sockaddr *intfAddr, struct
|
||||
// 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->multicastSocket4 = -1;
|
||||
#if HAVE_IPV6
|
||||
intf->multicastSocket6 = -1;
|
||||
diff --git a/mDNSPosix/mDNSPosix.h b/mDNSPosix/mDNSPosix.h
|
||||
index 9675591b0434..dd7864cd0d5e 100644
|
||||
--- a/mDNSPosix/mDNSPosix.h
|
||||
+++ b/mDNSPosix/mDNSPosix.h
|
||||
@@ -19,6 +19,7 @@
|
||||
#define __mDNSPlatformPosix_h
|
||||
|
||||
#include <signal.h>
|
||||
+#include <sys/socket.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -40,6 +41,7 @@ struct PosixNetworkInterface
|
||||
char * intfName;
|
||||
PosixNetworkInterface * aliasIntf;
|
||||
int index;
|
||||
+ sa_family_t sa_family;
|
||||
int multicastSocket4;
|
||||
#if HAVE_IPV6
|
||||
int multicastSocket6;
|
||||
--
|
||||
2.35.1
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
From 4c0954f77ba05d77192ee1519929a39fbc978321 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Kiernan <alex.kiernan@gmail.com>
|
||||
Date: Mon, 5 Dec 2022 15:14:22 +0000
|
||||
Subject: [PATCH 3/6] mDNSShared: Drop MacOS specific __block qualifier
|
||||
|
||||
Support for this extension only exists in MacOS/Clang, also it's not
|
||||
actually used here, so we can just drop it.
|
||||
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
|
||||
---
|
||||
mDNSShared/uds_daemon.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/mDNSShared/uds_daemon.c b/mDNSShared/uds_daemon.c
|
||||
index 9ae5f78542d6..8c006b71a4ea 100644
|
||||
--- a/mDNSShared/uds_daemon.c
|
||||
+++ b/mDNSShared/uds_daemon.c
|
||||
@@ -2912,7 +2912,7 @@ exit:
|
||||
mDNSlocal mStatus add_domain_to_browser(request_state *info, const domainname *d)
|
||||
{
|
||||
browser_t *b, *p;
|
||||
- __block mStatus err;
|
||||
+ mStatus err;
|
||||
|
||||
for (p = info->u.browser.browsers; p; p = p->next)
|
||||
{
|
||||
--
|
||||
2.35.1
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
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(-)
|
||||
|
||||
diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c
|
||||
index 9a5b4d7ea4cb..02a19b438e03 100644
|
||||
--- a/mDNSPosix/mDNSPosix.c
|
||||
+++ b/mDNSPosix/mDNSPosix.c
|
||||
@@ -1348,7 +1348,7 @@ 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 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 *const m, struct sockaddr *intfAddr, struct
|
||||
|
||||
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 *const m)
|
||||
}
|
||||
#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 *const m)
|
||||
// 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.
|
||||
--
|
||||
2.35.1
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
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(-)
|
||||
|
||||
diff --git a/mDNSPosix/Makefile b/mDNSPosix/Makefile
|
||||
index 5e74193c0e89..b4313c36b035 100755
|
||||
--- a/mDNSPosix/Makefile
|
||||
+++ b/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
|
||||
|
||||
--
|
||||
2.35.1
|
||||
|
||||
@@ -0,0 +1,169 @@
|
||||
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 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
|
||||
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 | 58 ++++++++++++++++++++++++++++++++-----------
|
||||
1 file changed, 43 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c
|
||||
index 02a19b438e03..e20adda92229 100644
|
||||
--- a/mDNSPosix/mDNSPosix.c
|
||||
+++ b/mDNSPosix/mDNSPosix.c
|
||||
@@ -74,6 +74,14 @@ struct IfChangeRec
|
||||
};
|
||||
typedef struct IfChangeRec IfChangeRec;
|
||||
|
||||
+// Used to build a list of network interface indices
|
||||
+struct NetworkInterfaceIndex
|
||||
+{
|
||||
+ int if_index;
|
||||
+ struct NetworkInterfaceIndex *Next;
|
||||
+};
|
||||
+typedef struct NetworkInterfaceIndex NetworkInterfaceIndex;
|
||||
+
|
||||
// Note that static data is initialized to zero in (modern) C.
|
||||
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 *pFD)
|
||||
return err;
|
||||
}
|
||||
|
||||
+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;
|
||||
+ }
|
||||
+
|
||||
+ item = mdns_malloc(sizeof *item);
|
||||
+ if (item == NULL) return;
|
||||
+
|
||||
+ item->if_index = if_index;
|
||||
+ item->Next = NULL;
|
||||
+ AddToTail(list, item);
|
||||
+}
|
||||
+
|
||||
#if MDNS_DEBUGMSGS
|
||||
mDNSlocal void PrintNetLinkMsg(const struct nlmsghdr *pNLMsg)
|
||||
{
|
||||
@@ -1648,14 +1673,13 @@ mDNSlocal void PrintNetLinkMsg(const struct nlmsghdr *pNLMsg)
|
||||
}
|
||||
#endif
|
||||
|
||||
-mDNSlocal mDNSu32 ProcessRoutingNotification(int sd)
|
||||
+mDNSlocal void ProcessRoutingNotification(int sd, GenLinkedList *changedInterfaces)
|
||||
// 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.
|
||||
{
|
||||
ssize_t readCount;
|
||||
char buff[4096];
|
||||
struct nlmsghdr *pNLMsg = (struct nlmsghdr*) buff;
|
||||
- mDNSu32 result = 0;
|
||||
|
||||
// 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
|
||||
@@ -1691,9 +1715,9 @@ mDNSlocal mDNSu32 ProcessRoutingNotification(int sd)
|
||||
|
||||
// Process the NetLink message
|
||||
if (pNLMsg->nlmsg_type == RTM_GETLINK || pNLMsg->nlmsg_type == RTM_NEWLINK)
|
||||
- result |= 1 << ((struct ifinfomsg*) NLMSG_DATA(pNLMsg))->ifi_index;
|
||||
+ AddInterfaceIndexToList(changedInterfaces, ((struct ifinfomsg*) NLMSG_DATA(pNLMsg))->ifi_index);
|
||||
else if (pNLMsg->nlmsg_type == RTM_DELADDR || pNLMsg->nlmsg_type == RTM_NEWADDR)
|
||||
- result |= 1 << ((struct ifaddrmsg*) NLMSG_DATA(pNLMsg))->ifa_index;
|
||||
+ AddInterfaceIndexToList(changedInterfaces, ((struct ifaddrmsg*) NLMSG_DATA(pNLMsg))->ifa_index);
|
||||
|
||||
// Advance pNLMsg to the next message in the buffer
|
||||
if ((pNLMsg->nlmsg_flags & NLM_F_MULTI) != 0 && pNLMsg->nlmsg_type != NLMSG_DONE)
|
||||
@@ -1704,8 +1728,6 @@ mDNSlocal mDNSu32 ProcessRoutingNotification(int sd)
|
||||
else
|
||||
break; // all done!
|
||||
}
|
||||
-
|
||||
- return result;
|
||||
}
|
||||
|
||||
#else // USES_NETLINK
|
||||
@@ -1737,14 +1759,13 @@ mDNSlocal void PrintRoutingSocketMsg(const struct ifa_msghdr *pRSMsg)
|
||||
}
|
||||
#endif
|
||||
|
||||
-mDNSlocal mDNSu32 ProcessRoutingNotification(int sd)
|
||||
+mDNSlocal void ProcessRoutingNotification(int sd, GenLinkedList *changedInterfaces)
|
||||
// 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.
|
||||
{
|
||||
ssize_t readCount;
|
||||
char buff[4096];
|
||||
struct ifa_msghdr *pRSMsg = (struct ifa_msghdr*) buff;
|
||||
- mDNSu32 result = 0;
|
||||
|
||||
readCount = read(sd, buff, sizeof buff);
|
||||
if (readCount < (ssize_t) sizeof(struct ifa_msghdr))
|
||||
@@ -1759,12 +1780,10 @@ mDNSlocal mDNSu32 ProcessRoutingNotification(int sd)
|
||||
pRSMsg->ifam_type == RTM_IFINFO)
|
||||
{
|
||||
if (pRSMsg->ifam_type == RTM_IFINFO)
|
||||
- result |= 1 << ((struct if_msghdr*) pRSMsg)->ifm_index;
|
||||
+ AddInterfaceIndexToList(changedInterfaces, ((struct if_msghdr*) pRSMsg)->ifm_index);
|
||||
else
|
||||
- result |= 1 << pRSMsg->ifam_index;
|
||||
+ AddInterfaceIndexToList(changedInterfaces, pRSMsg->ifam_index);
|
||||
}
|
||||
-
|
||||
- return result;
|
||||
}
|
||||
|
||||
#endif // USES_NETLINK
|
||||
@@ -1774,7 +1793,8 @@ mDNSlocal void InterfaceChangeCallback(int fd, void *context)
|
||||
{
|
||||
IfChangeRec *pChgRec = (IfChangeRec*) context;
|
||||
fd_set readFDs;
|
||||
- mDNSu32 changedInterfaces = 0;
|
||||
+ GenLinkedList changedInterfaces;
|
||||
+ NetworkInterfaceIndex *changedInterface;
|
||||
struct timeval zeroTimeout = { 0, 0 };
|
||||
|
||||
(void)fd; // Unused
|
||||
@@ -1782,17 +1802,25 @@ mDNSlocal void InterfaceChangeCallback(int fd, void *context)
|
||||
FD_ZERO(&readFDs);
|
||||
FD_SET(pChgRec->NotifySD, &readFDs);
|
||||
|
||||
+ InitLinkedList(&changedInterfaces, offsetof(NetworkInterfaceIndex, Next));
|
||||
+
|
||||
do
|
||||
{
|
||||
- changedInterfaces |= ProcessRoutingNotification(pChgRec->NotifySD);
|
||||
+ ProcessRoutingNotification(pChgRec->NotifySD, &changedInterfaces);
|
||||
}
|
||||
while (0 < select(pChgRec->NotifySD + 1, &readFDs, (fd_set*) NULL, (fd_set*) NULL, &zeroTimeout));
|
||||
|
||||
// Currently we rebuild the entire interface list whenever any interface change is
|
||||
// detected. If this ever proves to be a performance issue in a multi-homed
|
||||
// configuration, more care should be paid to changedInterfaces.
|
||||
- if (changedInterfaces)
|
||||
+ if (changedInterfaces.Head != NULL)
|
||||
mDNSPlatformPosixRefreshInterfaceList(pChgRec->mDNS);
|
||||
+
|
||||
+ while ((changedInterface = (NetworkInterfaceIndex*)changedInterfaces.Head) != NULL)
|
||||
+ {
|
||||
+ RemoveFromList(&changedInterfaces, changedInterface);
|
||||
+ mdns_free(changedInterface);
|
||||
+ }
|
||||
}
|
||||
|
||||
// Register with either a Routing Socket or RtNetLink to listen for interface changes.
|
||||
--
|
||||
2.35.1
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
From 60533a8947af714cc593bae6b20d47f3a4828589 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 5/6] mDNSCore: Fix broken debug parameter
|
||||
|
||||
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
|
||||
---
|
||||
mDNSCore/mDNS.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/mDNSCore/mDNS.c b/mDNSCore/mDNS.c
|
||||
index 66979587ee82..e0a982fa1762 100644
|
||||
--- a/mDNSCore/mDNS.c
|
||||
+++ b/mDNSCore/mDNS.c
|
||||
@@ -9831,7 +9831,7 @@ mDNSlocal void mDNSCoreReceiveNoUnicastAnswers(mDNS *const m, const DNSMessage *
|
||||
#else
|
||||
const DNSServRef dnsserv = qptr->qDNSServer;
|
||||
#endif
|
||||
- debugf("mDNSCoreReceiveNoUnicastAnswers making negative cache entry TTL %d for %##s (%s)", negttl, name->c, DNSTypeName(q.qtype));
|
||||
+ debugf("mDNSCoreReceiveNoUnicastAnswers making negative cache entry TTL %d for %##s (%s)", negttl, currentQName->c, DNSTypeName(q.qtype));
|
||||
// Create a negative record for the current name in the CNAME chain.
|
||||
MakeNegativeCacheRecord(m, &m->rec.r, currentQName, currentQNameHash, q.qtype, q.qclass, negttl, mDNSInterface_Any,
|
||||
dnsserv, response->h.flags);
|
||||
--
|
||||
2.35.1
|
||||
|
||||
@@ -0,0 +1,252 @@
|
||||
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 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
|
||||
the following problems:
|
||||
|
||||
1) Applications are informed that all of the services they are
|
||||
tracking have been removed.
|
||||
2) Increases network load because the client must re-query for
|
||||
all records it is interested in.
|
||||
|
||||
This changes netlink notification handling by:
|
||||
|
||||
1) Always comparing with the latest interface list returned
|
||||
by the OS.
|
||||
2) Confirming that the interface has been changed in a way
|
||||
that we care about.
|
||||
|
||||
Upstream-Status: Submitted [dts@apple.com]
|
||||
|
||||
Signed-off-by: Nate Karstens <nate.karstens@garmin.com>
|
||||
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
|
||||
---
|
||||
mDNSPosix/mDNSPosix.c | 182 +++++++++++++++++++++++++++++++++++++++---
|
||||
1 file changed, 172 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c
|
||||
index e20adda92229..5d52de31f79b 100644
|
||||
--- a/mDNSPosix/mDNSPosix.c
|
||||
+++ b/mDNSPosix/mDNSPosix.c
|
||||
@@ -1788,14 +1788,43 @@ mDNSlocal void ProcessRoutingNotification(int sd, GenLinkedList *change
|
||||
|
||||
#endif // USES_NETLINK
|
||||
|
||||
+// 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_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->ifa_addr, &ip, NULL);
|
||||
+ SockAddrTomDNSAddr(ifi->ifa_netmask, &mask, NULL);
|
||||
+
|
||||
+ match = mDNSSameAddress(&intf->coreIntf.ip, &ip) &&
|
||||
+ mDNSSameAddress(&intf->coreIntf.mask, &mask);
|
||||
+ }
|
||||
+
|
||||
+ return match;
|
||||
+}
|
||||
+
|
||||
// Called when data appears on interface change notification socket
|
||||
mDNSlocal void InterfaceChangeCallback(int fd, void *context)
|
||||
{
|
||||
IfChangeRec *pChgRec = (IfChangeRec*) context;
|
||||
+ mDNS *m = pChgRec->mDNS;
|
||||
fd_set readFDs;
|
||||
GenLinkedList changedInterfaces;
|
||||
NetworkInterfaceIndex *changedInterface;
|
||||
struct timeval zeroTimeout = { 0, 0 };
|
||||
+ struct ifaddrs *ifa_list, **ifi, *ifa_loop4 = NULL;
|
||||
+ PosixNetworkInterface *intf, *intfNext;
|
||||
+ mDNSBool found, foundav4;
|
||||
|
||||
(void)fd; // Unused
|
||||
|
||||
@@ -1810,12 +1839,149 @@ mDNSlocal void InterfaceChangeCallback(int fd, void *context)
|
||||
}
|
||||
while (0 < select(pChgRec->NotifySD + 1, &readFDs, (fd_set*) NULL, (fd_set*) NULL, &zeroTimeout));
|
||||
|
||||
- // Currently we rebuild the entire interface list whenever any interface change is
|
||||
- // detected. If this ever proves to be a performance issue in a multi-homed
|
||||
- // configuration, more care should be paid to changedInterfaces.
|
||||
- if (changedInterfaces.Head != NULL)
|
||||
- mDNSPlatformPosixRefreshInterfaceList(pChgRec->mDNS);
|
||||
+ CleanRecentInterfaces();
|
||||
+
|
||||
+ if (changedInterfaces.Head == NULL) goto cleanup;
|
||||
+
|
||||
+ if (getifaddrs(&ifa_list) < 0) goto cleanup;
|
||||
+
|
||||
+ for (intf = (PosixNetworkInterface*)(m->HostInterfaces); intf != NULL; intf = intfNext)
|
||||
+ {
|
||||
+ intfNext = (PosixNetworkInterface*)(intf->coreIntf.next);
|
||||
+
|
||||
+ // Loopback interface(s) are handled later
|
||||
+ if (intf->coreIntf.Loopback) continue;
|
||||
+
|
||||
+ found = mDNSfalse;
|
||||
+ for (ifi = &ifa_list; *ifi != NULL; ifi = &(*ifi)->ifa_next)
|
||||
+ {
|
||||
+ if (InterfacesMatch(intf, *ifi))
|
||||
+ {
|
||||
+ found = mDNStrue;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // Removes changed and old interfaces from m->HostInterfaces
|
||||
+ if (!found) TearDownInterface(m, intf);
|
||||
+ }
|
||||
+
|
||||
+ // Add new and changed interfaces in ifa_list
|
||||
+ // Save off loopback interface in case it is needed later
|
||||
+ for (ifi = &ifa_list; *ifi != NULL; ifi = &(*ifi)->ifa_next)
|
||||
+ {
|
||||
+ 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))
|
||||
+ {
|
||||
+ ifa_loop4 = *ifi;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if ( (((*ifi)->ifa_addr->sa_family == AF_INET)
|
||||
+#if HAVE_IPV6
|
||||
+ || ((*ifi)->ifa_addr->sa_family == AF_INET6)
|
||||
+#endif
|
||||
+ ) && ((*ifi)->ifa_flags & IFF_UP)
|
||||
+ && !((*ifi)->ifa_flags & IFF_POINTOPOINT)
|
||||
+ && !((*ifi)->ifa_flags & IFF_LOOPBACK))
|
||||
+ {
|
||||
+ 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);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // Determine if there is at least one non-loopback IPv4 interface. This is to work around issues
|
||||
+ // with multicast loopback on IPv6 interfaces -- see corresponding logic in SetupInterfaceList().
|
||||
+ foundav4 = mDNSfalse;
|
||||
+ for (intf = (PosixNetworkInterface*)(m->HostInterfaces); intf != NULL; intf = (PosixNetworkInterface*)(intf->coreIntf.next))
|
||||
+ {
|
||||
+ if (intf->sa_family == AF_INET && !intf->coreIntf.Loopback)
|
||||
+ {
|
||||
+ foundav4 = mDNStrue;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (foundav4)
|
||||
+ {
|
||||
+ for (intf = (PosixNetworkInterface*)(m->HostInterfaces); intf != NULL; intf = intfNext)
|
||||
+ {
|
||||
+ intfNext = (PosixNetworkInterface*)(intf->coreIntf.next);
|
||||
+ if (intf->coreIntf.Loopback) TearDownInterface(m, intf);
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ found = mDNSfalse;
|
||||
+
|
||||
+ for (intf = (PosixNetworkInterface*)(m->HostInterfaces); intf != NULL; intf = (PosixNetworkInterface*)(intf->coreIntf.next))
|
||||
+ {
|
||||
+ if (intf->coreIntf.Loopback)
|
||||
+ {
|
||||
+ found = mDNStrue;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (!found && (ifa_loop4 != NULL))
|
||||
+ {
|
||||
+ 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 (ifa_list != NULL) freeifaddrs(ifa_list);
|
||||
|
||||
+cleanup:
|
||||
while ((changedInterface = (NetworkInterfaceIndex*)changedInterfaces.Head) != NULL)
|
||||
{
|
||||
RemoveFromList(&changedInterfaces, changedInterface);
|
||||
@@ -1947,15 +2113,11 @@ mDNSexport void mDNSPlatformClose(mDNS *const m)
|
||||
#endif
|
||||
}
|
||||
|
||||
-// This is used internally by InterfaceChangeCallback.
|
||||
-// It's also exported so that the Standalone Responder (mDNSResponderPosix)
|
||||
+// This is exported so that the Standalone Responder (mDNSResponderPosix)
|
||||
// can call it in response to a SIGHUP (mainly for debugging purposes).
|
||||
mDNSexport mStatus mDNSPlatformPosixRefreshInterfaceList(mDNS *const m)
|
||||
{
|
||||
int err;
|
||||
- // This is a pretty heavyweight way to process interface changes --
|
||||
- // destroying the entire interface list and then making fresh one from scratch.
|
||||
- // We should make it like the OS X version, which leaves unchanged interfaces alone.
|
||||
ClearInterfaceList(m);
|
||||
err = SetupInterfaceList(m);
|
||||
return PosixErrorToStatus(err);
|
||||
--
|
||||
2.35.1
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
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
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
new file mode 100644
|
||||
index 000000000000..feb6ac67ef47
|
||||
--- /dev/null
|
||||
+++ b/Makefile
|
||||
@@ -0,0 +1,2 @@
|
||||
+all clean:
|
||||
+ cd mDNSPosix && $(MAKE) $@
|
||||
--
|
||||
2.35.1
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
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 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-
|
||||
mentation (http://www.infradead.org/~tgr/libnl/doc/route.html)
|
||||
RTM_DELLINK can be sent by the kernel, but RTM_GETLINK cannot.
|
||||
There was likely a mixup in the original implementation, so this
|
||||
change replaces handling for RTM_GETLINK with RTM_DELLINK.
|
||||
|
||||
Testing and Verification Instructions:
|
||||
1. Use ip-link to add and remove a VLAN interface and verify
|
||||
that mDNSResponder handles the deleted link.
|
||||
|
||||
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 5d52de31f79b..77d982f4c50b 100644
|
||||
--- a/mDNSPosix/mDNSPosix.c
|
||||
+++ b/mDNSPosix/mDNSPosix.c
|
||||
@@ -1714,7 +1714,7 @@ mDNSlocal void ProcessRoutingNotification(int sd, GenLinkedList *change
|
||||
#endif
|
||||
|
||||
// Process the NetLink message
|
||||
- if (pNLMsg->nlmsg_type == RTM_GETLINK || pNLMsg->nlmsg_type == RTM_NEWLINK)
|
||||
+ if (pNLMsg->nlmsg_type == RTM_DELLINK || pNLMsg->nlmsg_type == RTM_NEWLINK)
|
||||
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.35.1
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
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 8/8] Handle errors from socket calls
|
||||
|
||||
Adds handling for socket() or read() returning a
|
||||
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 77d982f4c50b..cab512160afb 100644
|
||||
--- a/mDNSPosix/mDNSPosix.c
|
||||
+++ b/mDNSPosix/mDNSPosix.c
|
||||
@@ -1677,7 +1677,7 @@ mDNSlocal void ProcessRoutingNotification(int sd, GenLinkedList *change
|
||||
// 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.
|
||||
{
|
||||
- ssize_t readCount;
|
||||
+ ssize_t readVal, readCount;
|
||||
char buff[4096];
|
||||
struct nlmsghdr *pNLMsg = (struct nlmsghdr*) buff;
|
||||
|
||||
@@ -1686,7 +1686,10 @@ mDNSlocal void ProcessRoutingNotification(int sd, GenLinkedList *change
|
||||
// enough to hold all pending data and so avoid message fragmentation.
|
||||
// (Note that FIONREAD is not supported on AF_NETLINK.)
|
||||
|
||||
- readCount = read(sd, buff, sizeof buff);
|
||||
+ readVal = read(sd, buff, sizeof buff);
|
||||
+ if (readVal < 0) return;
|
||||
+ readCount = readVal;
|
||||
+
|
||||
while (1)
|
||||
{
|
||||
// Make sure we've got an entire nlmsghdr in the buffer, and payload, too.
|
||||
@@ -1702,7 +1705,9 @@ mDNSlocal void ProcessRoutingNotification(int sd, GenLinkedList *change
|
||||
pNLMsg = (struct nlmsghdr*) buff;
|
||||
|
||||
// read more data
|
||||
- readCount += read(sd, buff + readCount, sizeof buff - readCount);
|
||||
+ readVal = read(sd, buff + readCount, sizeof buff - readCount);
|
||||
+ if (readVal < 0) return;
|
||||
+ readCount += readVal;
|
||||
continue; // spin around and revalidate with new readCount
|
||||
}
|
||||
else
|
||||
@@ -2017,6 +2022,7 @@ mDNSlocal mDNSBool mDNSPlatformInit_CanReceiveUnicast(void)
|
||||
int err;
|
||||
int s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
||||
struct sockaddr_in s5353;
|
||||
+ if (s < 0) return mDNSfalse;
|
||||
s5353.sin_family = AF_INET;
|
||||
s5353.sin_port = MulticastDNSPort.NotAnInteger;
|
||||
s5353.sin_addr.s_addr = 0;
|
||||
--
|
||||
2.35.1
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
[Unit]
|
||||
Description=Zero-configuration networking
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
ExecStartPre=/bin/rm -f /var/run/mdnsd.pid
|
||||
ExecStart=/usr/sbin/mdnsd
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
PIDFile=/var/run/mdnsd.pid
|
||||
Restart=always
|
||||
RestartSec=10s
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,134 @@
|
||||
SUMMARY = "Publishes & browses available services on a link according to the Zeroconf / Bonjour protocol"
|
||||
DESCRIPTION = "Bonjour, also known as zero-configuration networking, enables automatic discovery of computers, devices, and services on IP networks."
|
||||
HOMEPAGE = "http://developer.apple.com/networking/bonjour/"
|
||||
LICENSE = "Apache-2.0 & BSD-3-Clause"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=31c50371921e0fb731003bbc665f29bf"
|
||||
|
||||
DEPENDS:append:libc-musl = " musl-nscd"
|
||||
|
||||
SRC_URI = "git://github.com/apple-oss-distributions/mDNSResponder;protocol=https;branch=rel/mDNSResponder-1790 \
|
||||
file://0001-dns-sd-Include-missing-headers.patch \
|
||||
file://0002-make-Set-libdns_sd.so-soname-correctly.patch \
|
||||
file://0003-mDNSShared-Drop-MacOS-specific-__block-qualifier.patch \
|
||||
file://0004-make-Separate-TLS-targets-from-libraries.patch \
|
||||
file://0005-mDNSCore-Fix-broken-debug-parameter.patch \
|
||||
file://0006-make-Add-top-level-Makefile.patch \
|
||||
file://0001-Create-subroutine-for-cleaning-recent-interfaces.patch \
|
||||
file://0002-Create-subroutine-for-tearing-down-an-interface.patch \
|
||||
file://0003-Track-interface-socket-family.patch \
|
||||
file://0004-Indicate-loopback-interface-to-mDNS-core.patch \
|
||||
file://0005-Use-list-for-changed-interfaces.patch \
|
||||
file://0006-Handle-noisy-netlink-sockets.patch \
|
||||
file://0007-Mark-deleted-interfaces-as-being-changed.patch \
|
||||
file://0008-Handle-errors-from-socket-calls.patch \
|
||||
file://mdns.service \
|
||||
"
|
||||
SRCREV = "8769ab51605e465425d33d757f602ce5905ca639"
|
||||
|
||||
# We install a stub Makefile in the top directory so that the various checks
|
||||
# in base.bbclass pass their tests for a Makefile, this ensures (that amongst
|
||||
# other things) the sstate checks will clean the build directory when the
|
||||
# task hashes changes.
|
||||
#
|
||||
# We can't use the approach of setting ${S} to mDNSPosix as we need
|
||||
# DEBUG_PREFIX_MAP to cover files which come from the Clients directory too.
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
inherit github-releases manpages systemd update-rc.d
|
||||
|
||||
PACKAGECONFIG ?= "tls \
|
||||
${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
|
||||
PACKAGECONFIG[debug] = "DEBUG=1,DEBUG=0"
|
||||
PACKAGECONFIG[ipv6] = "HAVE_IPV6=1,HAVE_IPV6=0"
|
||||
PACKAGECONFIG[manpages] = ""
|
||||
PACKAGECONFIG[tls] = ",tls=no,mbedtls"
|
||||
|
||||
CVE_PRODUCT = "apple:mdnsresponder"
|
||||
|
||||
# CVE-2007-0613 is not applicable as it only 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
|
||||
CVE_CHECK_IGNORE += "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"
|
||||
66
meta-openembedded/meta-networking/recipes-protocols/net-snmp/files/init
Executable file
66
meta-openembedded/meta-networking/recipes-protocols/net-snmp/files/init
Executable file
@@ -0,0 +1,66 @@
|
||||
#! /bin/sh
|
||||
# /etc/init.d/snmpd: start snmp daemon.
|
||||
|
||||
. /etc/init.d/functions
|
||||
|
||||
# Defaults
|
||||
export MIBDIRS=/usr/share/snmp/mibs
|
||||
SNMPDRUN=yes
|
||||
SNMPDOPTS='-Lsd -Lf /dev/null -p /var/run/snmpd.pid'
|
||||
TRAPDRUN=no
|
||||
TRAPDOPTS='-Lsd -p /var/run/snmptrapd.pid'
|
||||
PIDFILE=/var/run/snmpd.pid
|
||||
SPIDFILE=/var/run/snmptrapd.pid
|
||||
|
||||
# Reads config file if exists (will override defaults above)
|
||||
[ -r /etc/default/snmpd ] && . /etc/default/snmpd
|
||||
|
||||
[ "$SNMPDRUN" = "yes" ] && { test -x /usr/sbin/snmpd || exit 0; }
|
||||
[ "$TRAPDRUN" = "yes" ] && { test -x /usr/sbin/snmptrapd || exit 0; }
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting network management services:"
|
||||
if [ "$SNMPDRUN" = "yes" -a -f /etc/snmp/snmpd.conf -a ! -f "$PIDFILE" ]; then
|
||||
start-stop-daemon -o --start --quiet --name snmpd --pidfile "$PIDFILE" \
|
||||
--exec /usr/sbin/snmpd -- $SNMPDOPTS
|
||||
echo -n " snmpd"
|
||||
fi
|
||||
if [ "$TRAPDRUN" = "yes" -a -f /etc/snmp/snmptrapd.conf -a ! -f "$SPIDFILE" ]; then
|
||||
start-stop-daemon -o --start --quiet --name snmptrapd --pidfile "$SPIDFILE" \
|
||||
--exec /usr/sbin/snmptrapd -- $TRAPDOPTS
|
||||
echo -n " snmptrapd"
|
||||
fi
|
||||
echo "."
|
||||
|
||||
test ! -x /sbin/restorecon || /sbin/restorecon -FR /var/lib/net-snmp
|
||||
;;
|
||||
stop)
|
||||
echo -n "Stopping network management services:"
|
||||
if [ -f "$PIDFILE" ] ; then
|
||||
start-stop-daemon -o --stop --quiet --pidfile $PIDFILE --name snmpd
|
||||
fi
|
||||
echo -n " snmpd"
|
||||
if [ -f "$SPIDFILE" ] ; then
|
||||
start-stop-daemon -o --stop --quiet --pidfile $SPIDFILE --name snmptrapd
|
||||
rm -rf $SPIDFILE
|
||||
fi
|
||||
echo -n " snmptrapd"
|
||||
echo "."
|
||||
;;
|
||||
status)
|
||||
status /usr/sbin/snmpd;
|
||||
exit $?
|
||||
;;
|
||||
restart|reload|force-reload)
|
||||
$0 stop
|
||||
# Allow the daemons time to exit completely.
|
||||
sleep 2
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: /etc/init.d/snmpd {start|stop|status|restart|reload|force-reload}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,422 @@
|
||||
###############################################################################
|
||||
#
|
||||
# EXAMPLE.conf:
|
||||
# An example configuration file for configuring the ucd-snmp snmpd agent.
|
||||
#
|
||||
###############################################################################
|
||||
#
|
||||
# This file is intended to only be an example. If, however, you want
|
||||
# to use it, it should be placed in /etc/snmp/snmpd.conf.
|
||||
# When the snmpd agent starts up, this is where it will look for it.
|
||||
#
|
||||
# You might be interested in generating your own snmpd.conf file using
|
||||
# the "snmpconf" program (perl script) instead. It's a nice menu
|
||||
# based interface to writing well commented configuration files. Try it!
|
||||
#
|
||||
# Note: This file is automatically generated from EXAMPLE.conf.def.
|
||||
# Do NOT read the EXAMPLE.conf.def file! Instead, after you have run
|
||||
# configure & make, and then make sure you read the EXAMPLE.conf file
|
||||
# instead, as it will tailor itself to your configuration.
|
||||
|
||||
# All lines beginning with a '#' are comments and are intended for you
|
||||
# to read. All other lines are configuration commands for the agent.
|
||||
|
||||
#
|
||||
# PLEASE: read the snmpd.conf(5) manual page as well!
|
||||
#
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Access Control
|
||||
###############################################################################
|
||||
|
||||
# YOU SHOULD CHANGE THE "COMMUNITY" TOKEN BELOW TO A NEW KEYWORD ONLY
|
||||
# KNOWN AT YOUR SITE. YOU *MUST* CHANGE THE NETWORK TOKEN BELOW TO
|
||||
# SOMETHING REFLECTING YOUR LOCAL NETWORK ADDRESS SPACE.
|
||||
|
||||
# By far, the most common question I get about the agent is "why won't
|
||||
# it work?", when really it should be "how do I configure the agent to
|
||||
# allow me to access it?"
|
||||
#
|
||||
# By default, the agent responds to the "public" community for read
|
||||
# only access, if run out of the box without any configuration file in
|
||||
# place. The following examples show you other ways of configuring
|
||||
# the agent so that you can change the community names, and give
|
||||
# yourself write access as well.
|
||||
#
|
||||
# The following lines change the access permissions of the agent so
|
||||
# that the COMMUNITY string provides read-only access to your entire
|
||||
# NETWORK (EG: 10.10.10.0/24), and read/write access to only the
|
||||
# localhost (127.0.0.1, not its real ipaddress).
|
||||
#
|
||||
# For more information, read the FAQ as well as the snmpd.conf(5)
|
||||
# manual page.
|
||||
|
||||
####
|
||||
# First, map the community name (COMMUNITY) into a security name
|
||||
# (local and mynetwork, depending on where the request is coming
|
||||
# from):
|
||||
|
||||
# sec.name source community
|
||||
com2sec paranoid default public
|
||||
#com2sec readonly default public
|
||||
#com2sec readwrite default private
|
||||
|
||||
####
|
||||
# Second, map the security names into group names:
|
||||
|
||||
# sec.model sec.name
|
||||
group MyROSystem v1 paranoid
|
||||
group MyROSystem v2c paranoid
|
||||
group MyROSystem usm paranoid
|
||||
group MyROGroup v1 readonly
|
||||
group MyROGroup v2c readonly
|
||||
group MyROGroup usm readonly
|
||||
group MyRWGroup v1 readwrite
|
||||
group MyRWGroup v2c readwrite
|
||||
group MyRWGroup usm readwrite
|
||||
|
||||
####
|
||||
# Third, create a view for us to let the groups have rights to:
|
||||
|
||||
# incl/excl subtree mask
|
||||
view all included .1 80
|
||||
view system included .iso.org.dod.internet.mgmt.mib-2.system
|
||||
|
||||
####
|
||||
# Finally, grant the 2 groups access to the 1 view with different
|
||||
# write permissions:
|
||||
|
||||
# context sec.model sec.level match read write notif
|
||||
access MyROSystem "" any noauth exact system none none
|
||||
access MyROGroup "" any noauth exact all none none
|
||||
access MyRWGroup "" any noauth exact all all none
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
###############################################################################
|
||||
# System contact information
|
||||
#
|
||||
|
||||
# It is also possible to set the sysContact and sysLocation system
|
||||
# variables through the snmpd.conf file. **PLEASE NOTE** that setting
|
||||
# the value of these objects here makes these objects READ-ONLY
|
||||
# (regardless of any access control settings). Any attempt to set the
|
||||
# value of an object whose value is given here will fail with an error
|
||||
# status of notWritable.
|
||||
|
||||
syslocation Unknown (configure /etc/snmp/snmpd.local.conf)
|
||||
syscontact Root <root@localhost> (configure /etc/snmp/snmpd.local.conf)
|
||||
|
||||
# Example output of snmpwalk:
|
||||
# % snmpwalk -v 1 -c public localhost system
|
||||
# system.sysDescr.0 = "SunOS name sun4c"
|
||||
# system.sysObjectID.0 = OID: enterprises.ucdavis.ucdSnmpAgent.sunos4
|
||||
# system.sysUpTime.0 = Timeticks: (595637548) 68 days, 22:32:55
|
||||
# system.sysContact.0 = "Me <me@somewhere.org>"
|
||||
# system.sysName.0 = "name"
|
||||
# system.sysLocation.0 = "Right here, right now."
|
||||
# system.sysServices.0 = 72
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Process checks.
|
||||
#
|
||||
# The following are examples of how to use the agent to check for
|
||||
# processes running on the host. The syntax looks something like:
|
||||
#
|
||||
# proc NAME [MAX=0] [MIN=0]
|
||||
#
|
||||
# NAME: the name of the process to check for. It must match
|
||||
# exactly (ie, http will not find httpd processes).
|
||||
# MAX: the maximum number allowed to be running. Defaults to 0.
|
||||
# MIN: the minimum number to be running. Defaults to 0.
|
||||
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
|
||||
# Make sure mountd is running
|
||||
#proc mountd
|
||||
|
||||
# Make sure there are no more than 4 ntalkds running, but 0 is ok too.
|
||||
#proc ntalkd 4
|
||||
|
||||
# Make sure at least one sendmail, but less than or equal to 10 are running.
|
||||
#proc sendmail 10 1
|
||||
|
||||
# A snmpwalk of the prTable would look something like this:
|
||||
#
|
||||
# % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.2
|
||||
# enterprises.ucdavis.procTable.prEntry.prIndex.1 = 1
|
||||
# enterprises.ucdavis.procTable.prEntry.prIndex.2 = 2
|
||||
# enterprises.ucdavis.procTable.prEntry.prIndex.3 = 3
|
||||
# enterprises.ucdavis.procTable.prEntry.prNames.1 = "mountd"
|
||||
# enterprises.ucdavis.procTable.prEntry.prNames.2 = "ntalkd"
|
||||
# enterprises.ucdavis.procTable.prEntry.prNames.3 = "sendmail"
|
||||
# enterprises.ucdavis.procTable.prEntry.prMin.1 = 0
|
||||
# enterprises.ucdavis.procTable.prEntry.prMin.2 = 0
|
||||
# enterprises.ucdavis.procTable.prEntry.prMin.3 = 1
|
||||
# enterprises.ucdavis.procTable.prEntry.prMax.1 = 0
|
||||
# enterprises.ucdavis.procTable.prEntry.prMax.2 = 4
|
||||
# enterprises.ucdavis.procTable.prEntry.prMax.3 = 10
|
||||
# enterprises.ucdavis.procTable.prEntry.prCount.1 = 0
|
||||
# enterprises.ucdavis.procTable.prEntry.prCount.2 = 0
|
||||
# enterprises.ucdavis.procTable.prEntry.prCount.3 = 1
|
||||
# enterprises.ucdavis.procTable.prEntry.prErrorFlag.1 = 1
|
||||
# enterprises.ucdavis.procTable.prEntry.prErrorFlag.2 = 0
|
||||
# enterprises.ucdavis.procTable.prEntry.prErrorFlag.3 = 0
|
||||
# enterprises.ucdavis.procTable.prEntry.prErrMessage.1 = "No mountd process running."
|
||||
# enterprises.ucdavis.procTable.prEntry.prErrMessage.2 = ""
|
||||
# enterprises.ucdavis.procTable.prEntry.prErrMessage.3 = ""
|
||||
# enterprises.ucdavis.procTable.prEntry.prErrFix.1 = 0
|
||||
# enterprises.ucdavis.procTable.prEntry.prErrFix.2 = 0
|
||||
# enterprises.ucdavis.procTable.prEntry.prErrFix.3 = 0
|
||||
#
|
||||
# Note that the errorFlag for mountd is set to 1 because one is not
|
||||
# running (in this case an rpc.mountd is, but thats not good enough),
|
||||
# and the ErrMessage tells you what's wrong. The configuration
|
||||
# imposed in the snmpd.conf file is also shown.
|
||||
#
|
||||
# Special Case: When the min and max numbers are both 0, it assumes
|
||||
# you want a max of infinity and a min of 1.
|
||||
#
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Executables/scripts
|
||||
#
|
||||
|
||||
#
|
||||
# You can also have programs run by the agent that return a single
|
||||
# line of output and an exit code. Here are two examples.
|
||||
#
|
||||
# exec NAME PROGRAM [ARGS ...]
|
||||
#
|
||||
# NAME: A generic name.
|
||||
# PROGRAM: The program to run. Include the path!
|
||||
# ARGS: optional arguments to be passed to the program
|
||||
|
||||
# a simple hello world
|
||||
#exec echotest /bin/echo hello world
|
||||
|
||||
# Run a shell script containing:
|
||||
#
|
||||
# #!/bin/sh
|
||||
# echo hello world
|
||||
# echo hi there
|
||||
# exit 35
|
||||
#
|
||||
# Note: this has been specifically commented out to prevent
|
||||
# accidental security holes due to someone else on your system writing
|
||||
# a /tmp/shtest before you do. Uncomment to use it.
|
||||
#
|
||||
#exec shelltest /bin/sh /tmp/shtest
|
||||
|
||||
# Then,
|
||||
# % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.8
|
||||
# enterprises.ucdavis.extTable.extEntry.extIndex.1 = 1
|
||||
# enterprises.ucdavis.extTable.extEntry.extIndex.2 = 2
|
||||
# enterprises.ucdavis.extTable.extEntry.extNames.1 = "echotest"
|
||||
# enterprises.ucdavis.extTable.extEntry.extNames.2 = "shelltest"
|
||||
# enterprises.ucdavis.extTable.extEntry.extCommand.1 = "/bin/echo hello world"
|
||||
# enterprises.ucdavis.extTable.extEntry.extCommand.2 = "/bin/sh /tmp/shtest"
|
||||
# enterprises.ucdavis.extTable.extEntry.extResult.1 = 0
|
||||
# enterprises.ucdavis.extTable.extEntry.extResult.2 = 35
|
||||
# enterprises.ucdavis.extTable.extEntry.extOutput.1 = "hello world."
|
||||
# enterprises.ucdavis.extTable.extEntry.extOutput.2 = "hello world."
|
||||
# enterprises.ucdavis.extTable.extEntry.extErrFix.1 = 0
|
||||
# enterprises.ucdavis.extTable.extEntry.extErrFix.2 = 0
|
||||
|
||||
# Note that the second line of the /tmp/shtest shell script is cut
|
||||
# off. Also note that the exit status of 35 was returned.
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
###############################################################################
|
||||
# disk checks
|
||||
#
|
||||
|
||||
# The agent can check the amount of available disk space, and make
|
||||
# sure it is above a set limit.
|
||||
|
||||
# disk PATH [MIN=DEFDISKMINIMUMSPACE]
|
||||
#
|
||||
# PATH: mount path to the disk in question.
|
||||
# MIN: Disks with space below this value will have the Mib's errorFlag set.
|
||||
# Default value = DEFDISKMINIMUMSPACE.
|
||||
|
||||
# Check the / partition and make sure it contains at least 10 megs.
|
||||
|
||||
#disk / 10000
|
||||
|
||||
# % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.9
|
||||
# enterprises.ucdavis.diskTable.dskEntry.diskIndex.1 = 0
|
||||
# enterprises.ucdavis.diskTable.dskEntry.diskPath.1 = "/" Hex: 2F
|
||||
# enterprises.ucdavis.diskTable.dskEntry.diskDevice.1 = "/dev/dsk/c201d6s0"
|
||||
# enterprises.ucdavis.diskTable.dskEntry.diskMinimum.1 = 10000
|
||||
# enterprises.ucdavis.diskTable.dskEntry.diskTotal.1 = 837130
|
||||
# enterprises.ucdavis.diskTable.dskEntry.diskAvail.1 = 316325
|
||||
# enterprises.ucdavis.diskTable.dskEntry.diskUsed.1 = 437092
|
||||
# enterprises.ucdavis.diskTable.dskEntry.diskPercent.1 = 58
|
||||
# enterprises.ucdavis.diskTable.dskEntry.diskErrorFlag.1 = 0
|
||||
# enterprises.ucdavis.diskTable.dskEntry.diskErrorMsg.1 = ""
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
###############################################################################
|
||||
# load average checks
|
||||
#
|
||||
|
||||
# load [1MAX=DEFMAXLOADAVE] [5MAX=DEFMAXLOADAVE] [15MAX=DEFMAXLOADAVE]
|
||||
#
|
||||
# 1MAX: If the 1 minute load average is above this limit at query
|
||||
# time, the errorFlag will be set.
|
||||
# 5MAX: Similar, but for 5 min average.
|
||||
# 15MAX: Similar, but for 15 min average.
|
||||
|
||||
# Check for loads:
|
||||
#load 12 14 14
|
||||
|
||||
# % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.10
|
||||
# enterprises.ucdavis.loadTable.laEntry.loadaveIndex.1 = 1
|
||||
# enterprises.ucdavis.loadTable.laEntry.loadaveIndex.2 = 2
|
||||
# enterprises.ucdavis.loadTable.laEntry.loadaveIndex.3 = 3
|
||||
# enterprises.ucdavis.loadTable.laEntry.loadaveNames.1 = "Load-1"
|
||||
# enterprises.ucdavis.loadTable.laEntry.loadaveNames.2 = "Load-5"
|
||||
# enterprises.ucdavis.loadTable.laEntry.loadaveNames.3 = "Load-15"
|
||||
# enterprises.ucdavis.loadTable.laEntry.loadaveLoad.1 = "0.49" Hex: 30 2E 34 39
|
||||
# enterprises.ucdavis.loadTable.laEntry.loadaveLoad.2 = "0.31" Hex: 30 2E 33 31
|
||||
# enterprises.ucdavis.loadTable.laEntry.loadaveLoad.3 = "0.26" Hex: 30 2E 32 36
|
||||
# enterprises.ucdavis.loadTable.laEntry.loadaveConfig.1 = "12.00"
|
||||
# enterprises.ucdavis.loadTable.laEntry.loadaveConfig.2 = "14.00"
|
||||
# enterprises.ucdavis.loadTable.laEntry.loadaveConfig.3 = "14.00"
|
||||
# enterprises.ucdavis.loadTable.laEntry.loadaveErrorFlag.1 = 0
|
||||
# enterprises.ucdavis.loadTable.laEntry.loadaveErrorFlag.2 = 0
|
||||
# enterprises.ucdavis.loadTable.laEntry.loadaveErrorFlag.3 = 0
|
||||
# enterprises.ucdavis.loadTable.laEntry.loadaveErrMessage.1 = ""
|
||||
# enterprises.ucdavis.loadTable.laEntry.loadaveErrMessage.2 = ""
|
||||
# enterprises.ucdavis.loadTable.laEntry.loadaveErrMessage.3 = ""
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Extensible sections.
|
||||
#
|
||||
|
||||
# This alleviates the multiple line output problem found in the
|
||||
# previous executable mib by placing each mib in its own mib table:
|
||||
|
||||
# Run a shell script containing:
|
||||
#
|
||||
# #!/bin/sh
|
||||
# echo hello world
|
||||
# echo hi there
|
||||
# exit 35
|
||||
#
|
||||
# Note: this has been specifically commented out to prevent
|
||||
# accidental security holes due to someone else on your system writing
|
||||
# a /tmp/shtest before you do. Uncomment to use it.
|
||||
#
|
||||
# exec .1.3.6.1.4.1.2021.50 shelltest /bin/sh /tmp/shtest
|
||||
|
||||
# % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.50
|
||||
# enterprises.ucdavis.50.1.1 = 1
|
||||
# enterprises.ucdavis.50.2.1 = "shelltest"
|
||||
# enterprises.ucdavis.50.3.1 = "/bin/sh /tmp/shtest"
|
||||
# enterprises.ucdavis.50.100.1 = 35
|
||||
# enterprises.ucdavis.50.101.1 = "hello world."
|
||||
# enterprises.ucdavis.50.101.2 = "hi there."
|
||||
# enterprises.ucdavis.50.102.1 = 0
|
||||
|
||||
# Now the Output has grown to two lines, and we can see the 'hi
|
||||
# there.' output as the second line from our shell script.
|
||||
#
|
||||
# Note that you must alter the mib.txt file to be correct if you want
|
||||
# the .50.* outputs above to change to reasonable text descriptions.
|
||||
|
||||
# Other ideas:
|
||||
#
|
||||
# exec .1.3.6.1.4.1.2021.51 ps /bin/ps
|
||||
# exec .1.3.6.1.4.1.2021.52 top /usr/local/bin/top
|
||||
# exec .1.3.6.1.4.1.2021.53 mailq /usr/bin/mailq
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Pass through control.
|
||||
#
|
||||
|
||||
# Usage:
|
||||
# pass MIBOID EXEC-COMMAND
|
||||
#
|
||||
# This will pass total control of the mib underneath the MIBOID
|
||||
# portion of the mib to the EXEC-COMMAND.
|
||||
#
|
||||
# Note: You'll have to change the path of the passtest script to your
|
||||
# source directory or install it in the given location.
|
||||
#
|
||||
# Example: (see the script for details)
|
||||
# (commented out here since it requires that you place the
|
||||
# script in the right location. (its not installed by default))
|
||||
|
||||
# pass .1.3.6.1.4.1.2021.255 /bin/sh /usr/local/passtest
|
||||
|
||||
# % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.255
|
||||
# enterprises.ucdavis.255.1 = "life the universe and everything"
|
||||
# enterprises.ucdavis.255.2.1 = 42
|
||||
# enterprises.ucdavis.255.2.2 = OID: 42.42.42
|
||||
# enterprises.ucdavis.255.3 = Timeticks: (363136200) 42 days, 0:42:42
|
||||
# enterprises.ucdavis.255.4 = IpAddress: 127.0.0.1
|
||||
# enterprises.ucdavis.255.5 = 42
|
||||
# enterprises.ucdavis.255.6 = Gauge: 42
|
||||
#
|
||||
# % snmpget -v 1 -c public localhost .1.3.6.1.4.1.2021.255.5
|
||||
# enterprises.ucdavis.255.5 = 42
|
||||
#
|
||||
# % snmpset -v 1 -c public localhost .1.3.6.1.4.1.2021.255.1 s "New string"
|
||||
# enterprises.ucdavis.255.1 = "New string"
|
||||
#
|
||||
|
||||
# For specific usage information, see the man/snmpd.conf.5 manual page
|
||||
# as well as the local/passtest script used in the above example.
|
||||
|
||||
###############################################################################
|
||||
# Subagent control
|
||||
#
|
||||
|
||||
# The agent can support subagents using a number of extension mechanisms.
|
||||
# From the 4.2.1 release, AgentX support is being compiled in by default.
|
||||
# However, this is still experimental code, so should not be used on
|
||||
# critical production systems.
|
||||
# Please see the file README.agentx for more details.
|
||||
#
|
||||
# If having read, marked, learnt and inwardly digested this information,
|
||||
# you decide that you do wish to make use of this mechanism, simply
|
||||
# uncomment the following directive.
|
||||
#
|
||||
# master agentx
|
||||
#
|
||||
# I repeat - this is *NOT* regarded as suitable for front-line production
|
||||
# systems, though it is probably stable enough for day-to-day use.
|
||||
# Probably.
|
||||
#
|
||||
# No refunds will be given.
|
||||
|
||||
###############################################################################
|
||||
# Further Information
|
||||
#
|
||||
# See the snmpd.conf manual page, and the output of "snmpd -H".
|
||||
# MUCH more can be done with the snmpd.conf than is shown as an
|
||||
# example here.
|
||||
@@ -0,0 +1,18 @@
|
||||
###############################################################################
|
||||
#
|
||||
# EXAMPLE.conf:
|
||||
# An example configuration file for configuring the ucd-snmp snmptrapd agent.
|
||||
#
|
||||
###############################################################################
|
||||
#
|
||||
# This file is intended to only be an example. If, however, you want
|
||||
# to use it, it should be placed in /etc/snmp/snmptrapd.conf.
|
||||
# When the snmptrapd agent starts up, this is where it will look for it.
|
||||
#
|
||||
# All lines beginning with a '#' are comments and are intended for you
|
||||
# to read. All other lines are configuration commands for the agent.
|
||||
|
||||
#
|
||||
# PLEASE: read the snmptrapd.conf(5) manual page as well!
|
||||
#
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
From 5719f40db65a72624a0b0f08e546d12bf823bd1e Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Wed, 18 Jan 2023 14:38:44 -0800
|
||||
Subject: [PATCH] Add noreturn attribute to netsnmp_pci_error()
|
||||
|
||||
Fixes build with clang16
|
||||
| mibgroup/if-mib/data_access/interface_linux.c:152:23: error: incompatible function pointer types assigning to 'void (*)(char *, ...) __attribute__((noreturn))' from 'void (char *, ...)' [-Wincompatible-function-pointer-types]
|
||||
| pci_access->error = netsnmp_pci_error;
|
||||
| ^ ~~~~~~~~~~~~~~~~~
|
||||
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
agent/mibgroup/if-mib/data_access/interface_linux.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/agent/mibgroup/if-mib/data_access/interface_linux.c b/agent/mibgroup/if-mib/data_access/interface_linux.c
|
||||
index c6cc54e..12eb865 100644
|
||||
--- a/agent/mibgroup/if-mib/data_access/interface_linux.c
|
||||
+++ b/agent/mibgroup/if-mib/data_access/interface_linux.c
|
||||
@@ -31,7 +31,7 @@ static struct pci_access *pci_access;
|
||||
/* Avoid letting libpci call exit(1) when no PCI bus is available. */
|
||||
static int do_longjmp =0;
|
||||
static jmp_buf err_buf;
|
||||
-static void
|
||||
+__attribute__((noreturn)) static void
|
||||
netsnmp_pci_error(char *msg, ...)
|
||||
{
|
||||
va_list args;
|
||||
--
|
||||
2.39.1
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
From 98c62e24fdd05d7e8bd8149840bad8eb0feb3fb1 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"
|
||||
@@ -0,0 +1,35 @@
|
||||
From e86d5fd52f19b85da0b7cce660c6e65ec4c0f9bb 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
|
||||
|
||||
ERROR: This autoconf log indicates errors, it looked at host include
|
||||
and/or library paths while determining system capabilities.
|
||||
cc1: warning: include location "/usr/local/include" is unsafe for cross-compilation [-Wpoison-system-directories]
|
||||
conftest.c:168:17: fatal error: pkg.h: No such file or directory
|
||||
#include <pkg.h>
|
||||
^
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
|
||||
|
||||
---
|
||||
configure.d/config_os_headers | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/configure.d/config_os_headers b/configure.d/config_os_headers
|
||||
index 01c3376..6edd85f 100644
|
||||
--- a/configure.d/config_os_headers
|
||||
+++ b/configure.d/config_os_headers
|
||||
@@ -395,8 +395,8 @@ then
|
||||
unset ac_cv_header_pkg_h
|
||||
netsnmp_save_CPPFLAGS="$CPPFLAGS"
|
||||
netsnmp_save_LDFLAGS="$LDFLAGS"
|
||||
- CPPFLAGS="$CPPFLAGS -I/usr/local/include"
|
||||
- LDFLAGS="$LDFLAGS -L/usr/local/lib"
|
||||
+ CPPFLAGS="$CPPFLAGS"
|
||||
+ LDFLAGS="$LDFLAGS"
|
||||
AC_CHECK_HEADERS(pkg.h,
|
||||
NETSNMP_SEARCH_LIBS(pkg_init, pkg,
|
||||
AC_DEFINE(HAVE_LIBPKG, 1, [define if you have BSD pkg-ng])))
|
||||
@@ -0,0 +1,27 @@
|
||||
From 8097734b27fd146f358a4edd0d1a0d28309bd9a4 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
|
||||
|
||||
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 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 @@
|
||||
#include <net-snmp/output_api.h>
|
||||
|
||||
#include <ctype.h>
|
||||
+#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
@@ -0,0 +1,34 @@
|
||||
From f4e1acd4f509dd26cf88da872bd5adcf884f4a5f 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>
|
||||
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
|
||||
|
||||
---
|
||||
snmplib/keytools.c | 5 +----
|
||||
1 file changed, 1 insertion(+), 4 deletions(-)
|
||||
|
||||
diff --git a/snmplib/keytools.c b/snmplib/keytools.c
|
||||
index 14a452a..fb1694b 100644
|
||||
--- a/snmplib/keytools.c
|
||||
+++ b/snmplib/keytools.c
|
||||
@@ -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)) {
|
||||
- rval = SNMPERR_GENERR;
|
||||
- goto generate_Ku_quit;
|
||||
- }
|
||||
+ EVP_MD_CTX_init(ctx);
|
||||
#endif
|
||||
if (!EVP_DigestInit(ctx, hashfn)) {
|
||||
rval = SNMPERR_GENERR;
|
||||
@@ -0,0 +1,28 @@
|
||||
From 6d655ba677563ac9d62d4d8eee59fdb39d486c02 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] 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 f1cbbf5..1545be3 100644
|
||||
--- a/Makefile.in
|
||||
+++ b/Makefile.in
|
||||
@@ -173,7 +173,7 @@ OTHERCLEANTODOS=perlclean @PYTHONCLEANTARGS@ cleanfeatures perlcleanfeatures pyt
|
||||
#
|
||||
# override LD_RUN_PATH to avoid dependencies on the build directory
|
||||
perlmodules: perlmakefiles subdirs
|
||||
- @(cd perl ; $(MAKE) LD_RUN_PATH="$(libdir):`$(PERL) -e 'use Config; print qq($$Config{archlibexp}/CORE);'`") ; \
|
||||
+ @(cd perl ; $(MAKE) LD_RUN_PATH="$(libdir):`$(PERL) -e 'use Config; print qq($$Config{installprivlib}/CORE);'`") ; \
|
||||
if test $$? != 0 ; then \
|
||||
exit 1 ; \
|
||||
fi
|
||||
@@ -0,0 +1,121 @@
|
||||
From d13302656d9ff0807c5defe18623adc947f43a2b Mon Sep 17 00:00:00 2001
|
||||
From: Narpat Mali <narpat.mali@windriver.com>
|
||||
Date: Wed, 8 Feb 2023 13:15:39 +0000
|
||||
Subject: [PATCH] agent: Disallow SET requests with any NULL varbind Merge pull
|
||||
request #490 from fenner/set-null
|
||||
|
||||
fixes: #474 and #475
|
||||
|
||||
CVE: CVE-2022-44792, CVE-2022-44793
|
||||
|
||||
Upstream-Status: Backport [https://github.com/net-snmp/net-snmp/commit/be804106fd0771a7d05236cff36e199af077af57]
|
||||
|
||||
Signed-off-by: Narpat Mali <narpat.mali@windriver.com>
|
||||
---
|
||||
agent/snmp_agent.c | 32 +++++++++++++++++++
|
||||
apps/snmpset.c | 1 +
|
||||
.../default/T0142snmpv2csetnull_simple | 31 ++++++++++++++++++
|
||||
3 files changed, 64 insertions(+)
|
||||
create mode 100644 testing/fulltests/default/T0142snmpv2csetnull_simple
|
||||
|
||||
diff --git a/agent/snmp_agent.c b/agent/snmp_agent.c
|
||||
index 867d0c1..3f678fe 100644
|
||||
--- a/agent/snmp_agent.c
|
||||
+++ b/agent/snmp_agent.c
|
||||
@@ -3719,12 +3719,44 @@ netsnmp_handle_request(netsnmp_agent_session *asp, int status)
|
||||
return 1;
|
||||
}
|
||||
|
||||
+static int
|
||||
+check_set_pdu_for_null_varbind(netsnmp_agent_session *asp)
|
||||
+{
|
||||
+ int i;
|
||||
+ netsnmp_variable_list *v = NULL;
|
||||
+
|
||||
+ for (i = 1, v = asp->pdu->variables; v != NULL; i++, v = v->next_variable) {
|
||||
+ if (v->type == ASN_NULL) {
|
||||
+ /*
|
||||
+ * Protect SET implementations that do not protect themselves
|
||||
+ * against wrong type.
|
||||
+ */
|
||||
+ DEBUGMSGTL(("snmp_agent", "disallowing SET with NULL var for varbind %d\n", i));
|
||||
+ asp->index = i;
|
||||
+ return SNMP_ERR_WRONGTYPE;
|
||||
+ }
|
||||
+ }
|
||||
+ return SNMP_ERR_NOERROR;
|
||||
+}
|
||||
+
|
||||
int
|
||||
handle_pdu(netsnmp_agent_session *asp)
|
||||
{
|
||||
int status, inclusives = 0;
|
||||
netsnmp_variable_list *v = NULL;
|
||||
|
||||
+#ifndef NETSNMP_NO_WRITE_SUPPORT
|
||||
+ /*
|
||||
+ * Check for ASN_NULL in SET request
|
||||
+ */
|
||||
+ if (asp->pdu->command == SNMP_MSG_SET) {
|
||||
+ status = check_set_pdu_for_null_varbind(asp);
|
||||
+ if (status != SNMP_ERR_NOERROR) {
|
||||
+ return status;
|
||||
+ }
|
||||
+ }
|
||||
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
|
||||
+
|
||||
/*
|
||||
* for illegal requests, mark all nodes as ASN_NULL
|
||||
*/
|
||||
diff --git a/apps/snmpset.c b/apps/snmpset.c
|
||||
index 48e14bd..d542713 100644
|
||||
--- a/apps/snmpset.c
|
||||
+++ b/apps/snmpset.c
|
||||
@@ -182,6 +182,7 @@ main(int argc, char *argv[])
|
||||
case 'x':
|
||||
case 'd':
|
||||
case 'b':
|
||||
+ case 'n': /* undocumented */
|
||||
#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
|
||||
case 'I':
|
||||
case 'U':
|
||||
diff --git a/testing/fulltests/default/T0142snmpv2csetnull_simple b/testing/fulltests/default/T0142snmpv2csetnull_simple
|
||||
new file mode 100644
|
||||
index 0000000..0f1b8f3
|
||||
--- /dev/null
|
||||
+++ b/testing/fulltests/default/T0142snmpv2csetnull_simple
|
||||
@@ -0,0 +1,31 @@
|
||||
+#!/bin/sh
|
||||
+
|
||||
+. ../support/simple_eval_tools.sh
|
||||
+
|
||||
+HEADER SNMPv2c set of system.sysContact.0 with NULL varbind
|
||||
+
|
||||
+SKIPIF NETSNMP_DISABLE_SET_SUPPORT
|
||||
+SKIPIF NETSNMP_NO_WRITE_SUPPORT
|
||||
+SKIPIF NETSNMP_DISABLE_SNMPV2C
|
||||
+SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE
|
||||
+
|
||||
+#
|
||||
+# Begin test
|
||||
+#
|
||||
+
|
||||
+# standard V2C configuration: testcomunnity
|
||||
+snmp_write_access='all'
|
||||
+. ./Sv2cconfig
|
||||
+STARTAGENT
|
||||
+
|
||||
+CAPTURE "snmpget -On $SNMP_FLAGS -c testcommunity -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.4.0"
|
||||
+
|
||||
+CHECK ".1.3.6.1.2.1.1.4.0 = STRING:"
|
||||
+
|
||||
+CAPTURE "snmpset -On $SNMP_FLAGS -c testcommunity -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.4.0 n x"
|
||||
+
|
||||
+CHECK "Reason: wrongType"
|
||||
+
|
||||
+STOPAGENT
|
||||
+
|
||||
+FINISHED
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
From ab1d77c52e84746e75506a2870783806bc77f396 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"
|
||||
|
||||
LIB_LDCONFIG_CMD failed since it is using a host dir $(libdir)
|
||||
which is /usr/lib64 does not exist on host when compile 64bit
|
||||
image.
|
||||
|
||||
In fact, configuring dynamic linker run-time bindings is meaningless
|
||||
at this step, If it is needed, Poky would write ldconfig scripts to
|
||||
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 a962c54..1ba5607 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) @LD_NO_UNDEFINED@ -o
|
||||
LIB_EXTENSION = la
|
||||
LIB_VERSION =
|
||||
-LIB_LDCONFIG_CMD = $(LIBTOOL) --mode=finish $(INSTALL_PREFIX)$(libdir)
|
||||
+LIB_LDCONFIG_CMD = echo "do not ldconfig\n"
|
||||
LINK = $(LIBTOOL) --mode=link $(LINKCC)
|
||||
# RANLIB = @RANLIB@
|
||||
RANLIB = :
|
||||
@@ -0,0 +1,44 @@
|
||||
From 5ad4eab43c1ea63ff343bba64d576440e8783e75 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 90de12d..1ccc4db 100644
|
||||
--- a/agent/snmpd.c
|
||||
+++ b/agent/snmpd.c
|
||||
@@ -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 7b1746b..4a17e0d 100644
|
||||
--- a/snmplib/snmpv3.c
|
||||
+++ b/snmplib/snmpv3.c
|
||||
@@ -1059,9 +1059,9 @@ init_snmpv3_post_config(int majorid, int minorid, void *serverarg,
|
||||
/*
|
||||
* if our engineID has changed at all, the boots record must be set to 1
|
||||
*/
|
||||
- if (engineIDLen != oldEngineIDLength ||
|
||||
+ if (oldEngineIDLength != (size_t)0 && (engineIDLen != oldEngineIDLength ||
|
||||
oldEngineID == NULL || c_engineID == NULL ||
|
||||
- memcmp(oldEngineID, c_engineID, engineIDLen) != 0) {
|
||||
+ memcmp(oldEngineID, c_engineID, engineIDLen) != 0)) {
|
||||
engineBoots = 1;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
From ad65b106d3cb3c6e595381be1c45a73c1ef6eb5e Mon Sep 17 00:00:00 2001
|
||||
From: Chong Lu <Chong.Lu@windriver.com>
|
||||
Date: Thu, 28 May 2020 09:46:34 -0500
|
||||
Subject: [PATCH] net-snmp: add knob whether nlist.h are checked
|
||||
|
||||
Previously, it still was checked when there was no nlish.h in sysroots directory.
|
||||
Add knob to decide whether nlist.h are checked or not.
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
|
||||
|
||||
---
|
||||
configure.d/config_os_headers | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/configure.d/config_os_headers b/configure.d/config_os_headers
|
||||
index b9c8c31..01c3376 100644
|
||||
--- a/configure.d/config_os_headers
|
||||
+++ b/configure.d/config_os_headers
|
||||
@@ -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
|
||||
[
|
||||
@@ -44,6 +45,7 @@ AC_INCLUDES_DEFAULT
|
||||
#define LIBBSD_DISABLE_DEPRECATED 1
|
||||
#endif
|
||||
]])
|
||||
+fi
|
||||
|
||||
# Library:
|
||||
AC_CHECK_HEADERS([crt_externs.h ] dnl
|
||||
@@ -0,0 +1,30 @@
|
||||
From b1b9980853b1083f0c8b9f628f8b4c3a484d4f91 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
|
||||
|
||||
Include des.h only if it's found in openssl so that
|
||||
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 54fdd5c..0f7e931 100644
|
||||
--- a/snmplib/scapi.c
|
||||
+++ b/snmplib/scapi.c
|
||||
@@ -85,7 +85,9 @@ netsnmp_feature_child_of(usm_scapi, usm_support);
|
||||
#include <openssl/hmac.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/rand.h>
|
||||
+#ifdef HAVE_OPENSSL_DES_H
|
||||
#include <openssl/des.h>
|
||||
+#endif
|
||||
#ifdef HAVE_AES
|
||||
#include <openssl/aes.h>
|
||||
#endif
|
||||
@@ -0,0 +1,35 @@
|
||||
From 36a5656db7ea75dd15f35a6c1728937c6e2b901c 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
|
||||
|
||||
Upstream-Status: Inappropriate [OE specific]
|
||||
|
||||
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
|
||||
|
||||
---
|
||||
testing/RUNTESTS | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/testing/RUNTESTS b/testing/RUNTESTS
|
||||
index 6715831..a2b6fb8 100755
|
||||
--- a/testing/RUNTESTS
|
||||
+++ b/testing/RUNTESTS
|
||||
@@ -17,13 +17,17 @@ failed_count=0
|
||||
rm -f failed_tests
|
||||
for i in "${srcdir}"/testing/fulltests/default/T*$1*; do
|
||||
echo "RUNNING $i"
|
||||
+ test_name=`basename $i`
|
||||
${srcdir}/testing/fulltests/support/simple_run $i
|
||||
if [ $? = 0 ]; then
|
||||
+ echo "PASS: $test_name"
|
||||
success_count=`expr $success_count + 1`
|
||||
else
|
||||
+ echo "FAIL: $test_name"
|
||||
failed_count=`expr $failed_count + 1`
|
||||
echo "$i" >> failed_tests
|
||||
fi
|
||||
+ echo
|
||||
done
|
||||
|
||||
if [ -f failed_tests ]; then
|
||||
@@ -0,0 +1,30 @@
|
||||
From b923cd38e2503b86aedf66b767fd7f51c9f25645 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.
|
||||
|
||||
---
|
||||
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 b6864d9..07ca922 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
|
||||
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
workdir=$(dirname `realpath $0`)
|
||||
cd ${workdir}/testing
|
||||
./RUNTESTS
|
||||
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Simple Network Management Protocol (SNMP) Daemon.
|
||||
After=syslog.target network.target
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
Environment=OPTIONS="-Ls0-6d"
|
||||
EnvironmentFile=-/etc/default/snmpd
|
||||
ExecStart=/usr/sbin/snmpd $OPTIONS -a -f
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Simple Network Management Protocol (SNMP) Trap Daemon.
|
||||
After=syslog.target network.target
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
Environment=OPTIONS="-Lsd"
|
||||
EnvironmentFile=-/etc/default/snmptrapd
|
||||
ExecStart=/usr/sbin/snmptrapd $OPTIONS -f
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,294 @@
|
||||
SUMMARY = "Various tools relating to the Simple Network Management Protocol"
|
||||
HOMEPAGE = "http://www.net-snmp.org/"
|
||||
SECTION = "net"
|
||||
LICENSE = "BSD-3-Clause & MIT"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=9d100a395a38584f2ec18a8275261687"
|
||||
|
||||
DEPENDS = "openssl"
|
||||
DEPENDS:append:class-target = " pciutils"
|
||||
|
||||
SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.tar.gz \
|
||||
file://init \
|
||||
file://snmpd.conf \
|
||||
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://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://0001-ac_add_search_path.m4-keep-consistent-between-32bit.patch \
|
||||
file://0001-Add-noreturn-attribute-to-netsnmp_pci_error.patch \
|
||||
file://CVE-2022-44792-CVE-2022-44793.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "2097f29b7e1bf3f1300b4bae52fa2308d0bb8d5d3998dbe02f9462a413a2ef0a"
|
||||
|
||||
UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/net-snmp/files/net-snmp/"
|
||||
UPSTREAM_CHECK_REGEX = "/net-snmp/(?P<pver>\d+(\.\d+)+)/"
|
||||
|
||||
inherit autotools-brokensep update-rc.d siteinfo systemd pkgconfig perlnative ptest multilib_script multilib_header
|
||||
|
||||
EXTRA_OEMAKE = "INSTALL_PREFIX=${D} OTHERLDFLAGS='${LDFLAGS}' HOST_CPPFLAGS='${BUILD_CPPFLAGS}'"
|
||||
|
||||
PARALLEL_MAKE = ""
|
||||
CCACHE = ""
|
||||
CLEANBROKEN = "1"
|
||||
|
||||
TARGET_CC_ARCH += "${LDFLAGS}"
|
||||
|
||||
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[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}' \
|
||||
"
|
||||
|
||||
MIB_MODULES = ""
|
||||
MIB_MODULES:append = " ${@bb.utils.filter('PACKAGECONFIG', 'smux', d)}"
|
||||
|
||||
CACHED_CONFIGUREVARS = " \
|
||||
ac_cv_header_valgrind_valgrind_h=no \
|
||||
ac_cv_header_valgrind_memcheck_h=no \
|
||||
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= \
|
||||
"
|
||||
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() {
|
||||
sed -i -e "s|I/usr/include|I${STAGING_INCDIR}|g" \
|
||||
"${S}"/configure \
|
||||
"${S}"/configure.d/config_os_libs2
|
||||
|
||||
if [ "${HAS_PERL}" = "1" ]; then
|
||||
# this may need to be changed when package perl has any change.
|
||||
cp -f ${STAGING_DIR_TARGET}/usr/lib*/perl?/*/Config.pm ${WORKDIR}/
|
||||
cp -f ${STAGING_DIR_TARGET}/usr/lib*/perl?/*/*/Config_heavy.pl ${WORKDIR}/
|
||||
sed -e "s@libpth => '/usr/lib.*@libpth => '${STAGING_DIR_TARGET}/${libdir} ${STAGING_DIR_TARGET}/${base_libdir}',@g" \
|
||||
-e "s@privlibexp => '/usr@privlibexp => '${STAGING_DIR_TARGET}/usr@g" \
|
||||
-e "s@scriptdir => '/usr@scriptdir => '${STAGING_DIR_TARGET}/usr@g" \
|
||||
-e "s@sitearchexp => '/usr@sitearchexp => '${STAGING_DIR_TARGET}/usr@g" \
|
||||
-e "s@sitelibexp => '/usr@sitearchexp => '${STAGING_DIR_TARGET}/usr@g" \
|
||||
-e "s@vendorarchexp => '/usr@vendorarchexp => '${STAGING_DIR_TARGET}/usr@g" \
|
||||
-e "s@vendorlibexp => '/usr@vendorlibexp => '${STAGING_DIR_TARGET}/usr@g" \
|
||||
-i ${WORKDIR}/Config.pm
|
||||
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() {
|
||||
install -d ${D}${sysconfdir}/snmp
|
||||
install -d ${D}${sysconfdir}/init.d
|
||||
install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/snmpd
|
||||
install -m 644 ${WORKDIR}/snmpd.conf ${D}${sysconfdir}/snmp/
|
||||
install -m 644 ${WORKDIR}/snmptrapd.conf ${D}${sysconfdir}/snmp/
|
||||
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" \
|
||||
-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' \
|
||||
-e 's@[^ ]*--with-libtool-sysroot=[^ "]*@@g' \
|
||||
-e 's@[^ ]*--with-install-prefix=[^ "]*@@g' \
|
||||
-e 's@[^ ]*PKG_CONFIG_PATH=[^ "]*@@g' \
|
||||
-e 's@[^ ]*PKG_CONFIG_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
|
||||
|
||||
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() {
|
||||
install -d ${D}${PTEST_PATH}
|
||||
for i in ${S}/dist ${S}/include ${B}/include ${S}/mibs ${S}/configure \
|
||||
${B}/net-snmp-config ${S}/testing; do
|
||||
if [ -e "$i" ]; then
|
||||
cp -R --no-dereference --preserve=mode,links -v "$i" ${D}${PTEST_PATH}
|
||||
fi
|
||||
done
|
||||
echo `autoconf -V|awk '/autoconf/{print $NF}'` > ${D}${PTEST_PATH}/dist/autoconf-version
|
||||
|
||||
rmdlist="${D}${PTEST_PATH}/dist/net-snmp-solaris-build"
|
||||
for i in $rmdlist; do
|
||||
if [ -d "$i" ]; then
|
||||
rm -rf "$i"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
SYSROOT_PREPROCESS_FUNCS += "net_snmp_sysroot_preprocess"
|
||||
SNMP_DBGDIR = "/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}"
|
||||
|
||||
net_snmp_sysroot_preprocess () {
|
||||
if [ -e ${D}${bindir}/net-snmp-config ]; then
|
||||
install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
|
||||
install -m 755 ${D}${bindir}/net-snmp-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/
|
||||
sed -e "s@-I/usr/include@-I${STAGING_INCDIR}@g" \
|
||||
-e "s@^prefix=.*@prefix=${STAGING_DIR_HOST}${prefix}@g" \
|
||||
-e "s@^exec_prefix=.*@exec_prefix=${STAGING_EXECPREFIXDIR}@g" \
|
||||
-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" \
|
||||
-e "s@--sysroot=@--sysroot=${STAGING_DIR_HOST}@g" \
|
||||
-e "s@--with-libtool-sysroot=@--with-libtool-sysroot=${STAGING_DIR_HOST}@g" \
|
||||
-e "s@--with-install-prefix=@--with-install-prefix=${D}@g" \
|
||||
-i ${SYSROOT_DESTDIR}${bindir_crossscripts}/net-snmp-config
|
||||
fi
|
||||
}
|
||||
|
||||
PACKAGES += "${PN}-libs ${PN}-mibs ${PN}-server ${PN}-client \
|
||||
${PN}-server-snmpd ${PN}-server-snmptrapd \
|
||||
${PN}-lib-netsnmp ${PN}-lib-agent ${PN}-lib-helpers \
|
||||
${PN}-lib-mibs ${PN}-lib-trapd"
|
||||
|
||||
# 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"
|
||||
|
||||
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 \
|
||||
${sysconfdir}/snmp/snmpd.conf \
|
||||
${sysconfdir}/init.d \
|
||||
${systemd_unitdir}/system/snmpd.service \
|
||||
"
|
||||
|
||||
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} = ""
|
||||
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"
|
||||
|
||||
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 ."
|
||||
|
||||
SYSTEMD_PACKAGES = "${PN}-server-snmpd \
|
||||
${PN}-server-snmptrapd"
|
||||
|
||||
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 \
|
||||
${PN}-lib-netsnmp \
|
||||
${PN}-lib-agent \
|
||||
${PN}-lib-helpers \
|
||||
${PN}-lib-mibs \
|
||||
"
|
||||
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})"
|
||||
|
||||
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"
|
||||
|
||||
LEAD_SONAME = "libnetsnmp.so"
|
||||
|
||||
MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/net-snmp-config"
|
||||
|
||||
BBCLASSEXTEND = "native"
|
||||
@@ -0,0 +1,23 @@
|
||||
SUMMARY = "OpenSource WebSocket Toolkit"
|
||||
DESCRIPTION = "noPoll is a OpenSource WebSocket implementation (RFC 6455), \
|
||||
written in ansi C, that allows building pure WebSocket solutions or to \
|
||||
provide WebSocket support to existing TCP oriented applications.\
|
||||
\
|
||||
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-only"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=f0504124678c1b3158146e0630229298 \
|
||||
"
|
||||
DEPENDS = "openssl"
|
||||
SRC_URI = "http://www.aspl.es/nopoll/downloads/nopoll-${PV}.tar.gz \
|
||||
"
|
||||
SRC_URI[md5sum] = "8d333f158b5d5a8975a6149e6ef8db63"
|
||||
SRC_URI[sha256sum] = "7f1b20f1d0525f30cdd2a4fc386d328b4cf98c6d11cef51fe62cd9491ba19ad9"
|
||||
|
||||
inherit autotools pkgconfig
|
||||
|
||||
EXTRA_OECONF += "--disable-nopoll-doc"
|
||||
|
||||
LDFLAGS += "-lpthread"
|
||||
@@ -0,0 +1,22 @@
|
||||
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>
|
||||
---
|
||||
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})
|
||||
@@ -0,0 +1,47 @@
|
||||
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 = "ff73268829359639531ff02905c889f73a77b408"
|
||||
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 \
|
||||
"
|
||||
|
||||
PACKAGECONFIG ?= "encryption pubsub pubsub-eth"
|
||||
PACKAGECONFIG[amalgamation] = "-DUA_ENABLE_AMALGAMATION=ON, -DUA_ENABLE_AMALGAMATION=OFF"
|
||||
PACKAGECONFIG[encryption] = "-DUA_ENABLE_ENCRYPTION=ON, -DUA_ENABLE_ENCRYPTION=OFF, mbedtls"
|
||||
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"
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
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 = "GPL-2.0-only"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=e870c934e2c3d6ccf085fd7cf0a1e2e2"
|
||||
|
||||
SRC_URI = "git://gitosis.stanford.edu/openflow.git;protocol=git;branch=master"
|
||||
|
||||
CVE_CHECK_IGNORE = "\
|
||||
CVE-2015-1611 \
|
||||
CVE-2015-1612 \
|
||||
"
|
||||
|
||||
DEPENDS = "virtual/libc"
|
||||
|
||||
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)} \
|
||||
"
|
||||
|
||||
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"
|
||||
|
||||
# This CVE is not for this product but cve-check assumes it is
|
||||
# because two CPE collides when checking the NVD database
|
||||
CVE_CHECK_IGNORE = "CVE-2018-1078"
|
||||
@@ -0,0 +1,64 @@
|
||||
From 7b62e5884353b247f542844d1e4687d0e9211999 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Thu, 20 Jul 2017 04:27:32 -0700
|
||||
Subject: [PATCH 1/2] Check and use strlcpy from libc before defining own
|
||||
|
||||
This is required especially on musl where
|
||||
function prototype conflicts and causes build
|
||||
failures.
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
configure.ac | 2 +-
|
||||
lib/util.c | 2 ++
|
||||
lib/util.h | 1 +
|
||||
3 files changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 13064f6..596c43f 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -57,7 +57,7 @@ OFP_CHECK_HWTABLES
|
||||
OFP_CHECK_HWLIBS
|
||||
AC_SYS_LARGEFILE
|
||||
|
||||
-AC_CHECK_FUNCS([strsignal])
|
||||
+AC_CHECK_FUNCS([strlcpy strsignal])
|
||||
|
||||
AC_ARG_VAR(KARCH, [Kernel Architecture String])
|
||||
AC_SUBST(KARCH)
|
||||
diff --git a/lib/util.c b/lib/util.c
|
||||
index 21cc28d..1f341b1 100644
|
||||
--- a/lib/util.c
|
||||
+++ b/lib/util.c
|
||||
@@ -138,6 +138,7 @@ xasprintf(const char *format, ...)
|
||||
return s;
|
||||
}
|
||||
|
||||
+#ifndef HAVE_STRLCPY
|
||||
void
|
||||
strlcpy(char *dst, const char *src, size_t size)
|
||||
{
|
||||
@@ -148,6 +149,7 @@ strlcpy(char *dst, const char *src, size_t size)
|
||||
dst[n_copy] = '\0';
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
void
|
||||
ofp_fatal(int err_no, const char *format, ...)
|
||||
diff --git a/lib/util.h b/lib/util.h
|
||||
index fde681f..9e45ea9 100644
|
||||
--- a/lib/util.h
|
||||
+++ b/lib/util.h
|
||||
@@ -41,6 +41,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "compiler.h"
|
||||
+#include "config.h"
|
||||
|
||||
#ifndef va_copy
|
||||
#ifdef __va_copy
|
||||
--
|
||||
2.13.3
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
From 0fe6770b617af7e400abc6f8652c1417d4c3575e Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Sat, 8 Sep 2018 22:49:15 -0700
|
||||
Subject: [PATCH] generate not static get_dh* functions
|
||||
|
||||
Fixes build with OpenSSL 1.1.x
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
lib/automake.mk | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/automake.mk b/lib/automake.mk
|
||||
index bfbeb94..b53909a 100644
|
||||
--- a/lib/automake.mk
|
||||
+++ b/lib/automake.mk
|
||||
@@ -113,8 +113,9 @@ lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
|
||||
(echo '#include "lib/dhparams.h"' && \
|
||||
openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
|
||||
openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
|
||||
- openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
|
||||
- | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
|
||||
+ openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) | \
|
||||
+ sed -e 's/\(get_dh[0-9]*\)()/\1(void)/' \
|
||||
+ -e 's/static DH \*get_dh/DH \*get_dh/' > lib/dhparams.c.tmp
|
||||
mv lib/dhparams.c.tmp lib/dhparams.c
|
||||
endif
|
||||
|
||||
--
|
||||
2.18.0
|
||||
|
||||
@@ -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"
|
||||
@@ -0,0 +1,59 @@
|
||||
From 5bba224edea38607e8732081f86679ffd8b218ab Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Thu, 20 Jul 2017 04:29:04 -0700
|
||||
Subject: [PATCH 2/2] lib/netdev: Adjust header include sequence
|
||||
|
||||
Specify libc headers before kernel UAPIs
|
||||
this helps compiling with musl where otherwise
|
||||
it uses the definition from kernel and complains
|
||||
about double definition in libc headers
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
lib/netdev.c | 11 +++++------
|
||||
1 file changed, 5 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/lib/netdev.c b/lib/netdev.c
|
||||
index 3b6fbc5..c7de25e 100644
|
||||
--- a/lib/netdev.c
|
||||
+++ b/lib/netdev.c
|
||||
@@ -39,7 +39,6 @@
|
||||
#include <fcntl.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <inttypes.h>
|
||||
-#include <linux/if_tun.h>
|
||||
|
||||
/* Fix for some compile issues we were experiencing when setting up openwrt
|
||||
* with the 2.4 kernel. linux/ethtool.h seems to use kernel-style inttypes,
|
||||
@@ -57,10 +56,6 @@
|
||||
#define s64 __s64
|
||||
#endif
|
||||
|
||||
-#include <linux/ethtool.h>
|
||||
-#include <linux/rtnetlink.h>
|
||||
-#include <linux/sockios.h>
|
||||
-#include <linux/version.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/socket.h>
|
||||
@@ -68,12 +63,16 @@
|
||||
#include <net/ethernet.h>
|
||||
#include <net/if.h>
|
||||
#include <net/if_arp.h>
|
||||
-#include <net/if_packet.h>
|
||||
#include <net/route.h>
|
||||
#include <netinet/in.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
+#include <linux/ethtool.h>
|
||||
+#include <linux/rtnetlink.h>
|
||||
+#include <linux/sockios.h>
|
||||
+#include <linux/version.h>
|
||||
+#include <linux/if_tun.h>
|
||||
|
||||
#include "fatal-signal.h"
|
||||
#include "list.h"
|
||||
--
|
||||
2.13.3
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
include ${BPN}.inc
|
||||
|
||||
SRCREV = "5ccca75a69f99791659bcfbcf35353ab1921320a"
|
||||
PV = "1.0"
|
||||
@@ -0,0 +1,10 @@
|
||||
include ${BPN}.inc
|
||||
|
||||
SRCREV = "c84f33f09d5dbcfc9b489f64cb30475bf36f653a"
|
||||
PV = "1.0+git${SRCPV}"
|
||||
|
||||
SRC_URI += "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 \
|
||||
"
|
||||
@@ -0,0 +1,29 @@
|
||||
From 1f8d336a5cd88b87e15596d05980f6fe77a0f226 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Tue, 28 Mar 2017 11:28:41 -0700
|
||||
Subject: [PATCH 1/4] Use -1 instead of WAIT_ANY
|
||||
|
||||
WAIT_ANY is not supported by POSIX and some C libraries
|
||||
e.g. musl do not define this.
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
usl/usl_pid.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/usl/usl_pid.c b/usl/usl_pid.c
|
||||
index 103458b..9819473 100644
|
||||
--- a/usl/usl_pid.c
|
||||
+++ b/usl/usl_pid.c
|
||||
@@ -78,7 +78,7 @@ int usl_pid_reap_children(int waitfor)
|
||||
|
||||
/* Wait for processes in our process group. */
|
||||
|
||||
- while (((pid = waitpid(WAIT_ANY, &status, (waitfor ? 0: WNOHANG))) != -1) && (pid != 0)) {
|
||||
+ while (((pid = waitpid(-1, &status, (waitfor ? 0: WNOHANG))) != -1) && (pid != 0)) {
|
||||
have_callback = 0;
|
||||
usl_list_for_each(walk, tmp, &usl_child_list) {
|
||||
child = usl_list_entry(walk, struct usl_pid_child, list);
|
||||
--
|
||||
2.12.1
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
From 25dce20a75bc84ae9e4ec640590cef0c12750789 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Tue, 28 Mar 2017 17:48:13 -0700
|
||||
Subject: [PATCH 1/2] l2tp_api: Included needed headers
|
||||
|
||||
These are flagged by musl
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
l2tp_api.c | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/l2tp_api.c b/l2tp_api.c
|
||||
index d16f80e..9d6f60a 100644
|
||||
--- a/l2tp_api.c
|
||||
+++ b/l2tp_api.c
|
||||
@@ -22,9 +22,12 @@
|
||||
* Each module implements the required RPC xxx_1_svc() callbacks which
|
||||
* are called directly by the RPC library.
|
||||
*/
|
||||
-
|
||||
+#define _GNU_SOURCE
|
||||
+#include <sys/types.h>
|
||||
+#include <rpc/types.h>
|
||||
+#include <rpc/xdr.h>
|
||||
#include <rpc/pmap_clnt.h>
|
||||
-#include <net/ethernet.h>
|
||||
+//#include <netinet/in.h>
|
||||
|
||||
#include "usl.h"
|
||||
|
||||
--
|
||||
2.12.1
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
From ce5f5563ab54db9d28dba44a0e25e8a8c7bb9876 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Wed, 19 Oct 2016 00:34:35 +0000
|
||||
Subject: [PATCH] test/pppd_dummy.c: Fix return value
|
||||
|
||||
pause() is defined in unistd.h, clang does not
|
||||
like the fact that we are using a function without
|
||||
declaration
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
test/pppd_dummy.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/test/pppd_dummy.c b/test/pppd_dummy.c
|
||||
index 148e7d2..b564c36 100644
|
||||
--- a/test/pppd_dummy.c
|
||||
+++ b/test/pppd_dummy.c
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <syslog.h>
|
||||
+#include <unistd.h>
|
||||
|
||||
#define PPPD_DUMMY_TMP_FILE "/tmp/pppd_dummy"
|
||||
|
||||
@@ -40,7 +41,7 @@ int main(int argc, char **argv)
|
||||
|
||||
if (file == NULL) {
|
||||
syslog(LOG_ERR, "Failed to open %s\n", filename);
|
||||
- return;
|
||||
+ return -1;
|
||||
}
|
||||
|
||||
for (arg = 1; arg < argc; arg++) {
|
||||
--
|
||||
1.9.1
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
From 2d633f4c18ff3cb52234449fd86a0a63b55d669b Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Tue, 28 Mar 2017 11:31:55 -0700
|
||||
Subject: [PATCH 2/4] cli: include fcntl.h for O_CREAT define
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
cli/cli_readline.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/cli/cli_readline.c b/cli/cli_readline.c
|
||||
index 097ed6a..127136c 100644
|
||||
--- a/cli/cli_readline.c
|
||||
+++ b/cli/cli_readline.c
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <sys/file.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/errno.h>
|
||||
+#include <fcntl.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include <readline/readline.h>
|
||||
--
|
||||
2.12.1
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
From a41cbeee3cf660663a9baac80545050a8d960898 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Tue, 28 Mar 2017 18:09:58 -0700
|
||||
Subject: [PATCH 2/2] user ipv6 structures
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
|
||||
Update for ipv6 address compare
|
||||
Signed-off-by: Changqing Li <changqing.li@windriver.com>
|
||||
---
|
||||
l2tp_api.c | 8 +++++---
|
||||
1 file changed, 5 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/l2tp_api.c b/l2tp_api.c
|
||||
index 9d6f60a..f0946fd 100644
|
||||
--- a/l2tp_api.c
|
||||
+++ b/l2tp_api.c
|
||||
@@ -450,10 +450,12 @@ int l2tp_api_rpc_check_request(SVCXPRT *xprt)
|
||||
* non-loopback interface, reject the request.
|
||||
*/
|
||||
if ((!l2tp_opt_remote_rpc) &&
|
||||
- ((xprt->xp_raddr.sin_addr.s_addr != htonl(INADDR_LOOPBACK)) &&
|
||||
- (xprt->xp_raddr.sin_addr.s_addr != htonl(INADDR_ANY)))) {
|
||||
+ ((memcmp(&xprt->xp_raddr.sin6_addr, &in6addr_loopback, sizeof(struct in6_addr)) != 0) &&
|
||||
+ (memcmp(&xprt->xp_raddr.sin6_addr, &in6addr_any, sizeof(struct in6_addr)) != 0))) {
|
||||
+ char straddr[INET6_ADDRSTRLEN];
|
||||
+ inet_ntop(AF_INET6, &xprt->xp_raddr.sin6_addr, straddr, sizeof(straddr));
|
||||
if (l2tp_opt_trace_flags & L2TP_DEBUG_API) {
|
||||
- l2tp_log(LOG_ERR, "Rejecting RPC request from %s", inet_ntoa(xprt->xp_raddr.sin_addr));
|
||||
+ l2tp_log(LOG_ERR, "Rejecting RPC request from %s", straddr);
|
||||
}
|
||||
svcerr_auth(xprt, AUTH_TOOWEAK);
|
||||
return -EPERM;
|
||||
--
|
||||
2.12.1
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
From 74fe72583472bcc3c89a52839cac2ebbad6c8a74 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Tue, 28 Mar 2017 11:34:52 -0700
|
||||
Subject: [PATCH 3/4] cli: Define _GNU_SOURCE for getting sighandler_t
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
cli/cli_readline.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/cli/cli_readline.c b/cli/cli_readline.c
|
||||
index 127136c..931779b 100644
|
||||
--- a/cli/cli_readline.c
|
||||
+++ b/cli/cli_readline.c
|
||||
@@ -17,7 +17,7 @@
|
||||
* Boston, MA 02110-1301 USA
|
||||
*
|
||||
*****************************************************************************/
|
||||
-
|
||||
+#define _GNU_SOURCE
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
@@ -634,7 +634,7 @@ static void cli_rl_uninstall_signal_handlers(void)
|
||||
|
||||
static int cli_rl_install_signal_handlers(void)
|
||||
{
|
||||
- __sighandler_t handler;
|
||||
+ sighandler_t handler;
|
||||
|
||||
rl_catch_signals = 0;
|
||||
rl_clear_signals();
|
||||
--
|
||||
2.12.1
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
From 152486fa3c36c3b99d17d5b553cf87ef412fae8e Mon Sep 17 00:00:00 2001
|
||||
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
|
||||
|
||||
Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
|
||||
---
|
||||
Makefile | 22 +++++++++++-----------
|
||||
plugins/Makefile | 6 +++---
|
||||
2 files changed, 14 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 4aaa448..baa7882 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -152,10 +152,10 @@ LIBS.dmalloc= -ldmalloc
|
||||
export USE_DMALLOC
|
||||
endif
|
||||
|
||||
-CPPFLAGS= $(CPPFLAGS.l2tptest) $(CPPFLAGS-y)
|
||||
-CFLAGS= -I. -Iusl -Icli -isystem include \
|
||||
- -MMD -Wall -Werror -Wno-strict-aliasing \
|
||||
- $(CPPFLAGS) $(CPPFLAGS.dmalloc) \
|
||||
+ADD_CPPFLAGS= $(CPPFLAGS.l2tptest) $(CPPFLAGS-y)
|
||||
+ADD_CFLAGS= -I. -Iusl -Icli -isystem include \
|
||||
+ -MMD -Wall -Wno-strict-aliasing \
|
||||
+ $(ADD_CPPFLAGS) $(CPPFLAGS.dmalloc) \
|
||||
-DSYS_LIBDIR=$(SYS_LIBDIR)
|
||||
LDFLAGS.l2tpd= -Wl,-E -L. -Lusl -lusl -ldl $(LIBS.dmalloc) -lc
|
||||
LDFLAGS.l2tpconfig= -Lcli -lcli -lreadline $(LIBS.dmalloc) $(READLINE_LDFLAGS) -lc
|
||||
@@ -170,10 +170,10 @@ CFLAGS.optimize= $(OPT_CFLAGS)
|
||||
endif
|
||||
export CFLAGS.optimize
|
||||
|
||||
-CFLAGS+= $(CFLAGS.optimize)
|
||||
+ADD_CFLAGS+= $(CFLAGS.optimize)
|
||||
|
||||
ifeq ($(L2TP_USE_ASYNC_RPC),y)
|
||||
-CPPFLAGS+= -DL2TP_ASYNC_RPC
|
||||
+ADD_CPPFLAGS+= -DL2TP_ASYNC_RPC
|
||||
endif
|
||||
|
||||
ifeq ($(L2TP_FEATURE_RPC_MANAGEMENT),y)
|
||||
@@ -220,13 +220,13 @@ endif
|
||||
|
||||
# Compile without -Wall because rpcgen-generated code is full of warnings.
|
||||
%_xdr.o: %_xdr.c
|
||||
- $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(CPPFLAGS) $<
|
||||
+ $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(ADD_CPPFLAGS) $<
|
||||
|
||||
%_client.o: %_client.c
|
||||
- $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(CPPFLAGS) $<
|
||||
+ $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(ADD_CPPFLAGS) $<
|
||||
|
||||
%_server.o: %_server.c
|
||||
- $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(CPPFLAGS) $<
|
||||
+ $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(ADD_CPPFLAGS) $<
|
||||
|
||||
%_xdr.c: %.x
|
||||
-$(RM) $@
|
||||
@@ -272,7 +272,7 @@ l2tpconfig: $(L2TPCONFIG_SRCS.o)
|
||||
$(CC) -o $@ $^ $(LDFLAGS.l2tpconfig)
|
||||
|
||||
%.o: %.c
|
||||
- $(CC) -c $(CFLAGS) $< -o $@
|
||||
+ $(CC) -c $(CFLAGS) $(ADD_CFLAGS) $< -o $@
|
||||
|
||||
l2tp_options.h: FORCE
|
||||
@rm -f $@.tmp
|
||||
@@ -325,7 +325,7 @@ install: install-all
|
||||
install-all: all install-daemon install-app
|
||||
|
||||
install-daemon:
|
||||
- @for d in $(filter-out usl,$(SUBDIRS)); do $(MAKE) -C $$d $(MFLAGS) EXTRA_CFLAGS="$(CPPFLAGS)" install; if [ $$? -ne 0 ]; then exit 1; fi; done
|
||||
+ @for d in $(filter-out usl,$(SUBDIRS)); do $(MAKE) -C $$d $(MFLAGS) EXTRA_CFLAGS="$(CPPFLAGS) $(ADD_CPPFLAGS)" install; if [ $$? -ne 0 ]; then exit 1; fi; done
|
||||
$(INSTALL) -d $(DESTDIR)/usr/sbin
|
||||
$(INSTALL) openl2tpd $(DESTDIR)/usr/sbin
|
||||
|
||||
diff --git a/plugins/Makefile b/plugins/Makefile
|
||||
index 5be996d..6810236 100644
|
||||
--- a/plugins/Makefile
|
||||
+++ b/plugins/Makefile
|
||||
@@ -1,7 +1,7 @@
|
||||
-CFLAGS := $(CFLAGS.optimize) -MMD -Wall \
|
||||
+ADD_CFLAGS := $(CFLAGS.optimize) -MMD -Wall \
|
||||
-isystem ../include \
|
||||
-I. -I.. -I../usl -fPIC $(EXTRA_CFLAGS)
|
||||
-LDFLAGS := -shared
|
||||
+ADD_LDFLAGS := -shared
|
||||
|
||||
PLUGINS.c:= ppp_unix.c ppp_null.c ipsec.c event_sock.c
|
||||
|
||||
@@ -21,7 +21,7 @@ clean:
|
||||
$(RM) $(PLUGINS.so) $(wildcard *.o) $(wildcard *.d) $(SRC.generated)
|
||||
|
||||
%.so: %.c
|
||||
- $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $<
|
||||
+ $(CC) -o $@ $(LDFLAGS) $(ADD_LDFLAGS) $(CFLAGS) $(ADD_CFLAGS) $<
|
||||
|
||||
install: all
|
||||
$(INSTALL) -d $(DESTDIR)$(SYS_LIBDIR)/openl2tp
|
||||
--
|
||||
1.8.4.2
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
Upstream-Status: Pending
|
||||
|
||||
--- openl2tp-1.8/Makefile.orig 2016-09-16 14:54:18.554291976 +0200
|
||||
+++ openl2tp-1.8/Makefile 2016-09-16 14:57:23.559090400 +0200
|
||||
@@ -157,8 +157,8 @@ ADD_CFLAGS= -I. -Iusl -Icli -isystem i
|
||||
-MMD -Wall -Wno-strict-aliasing \
|
||||
$(ADD_CPPFLAGS) $(CPPFLAGS.dmalloc) \
|
||||
-DSYS_LIBDIR=$(SYS_LIBDIR)
|
||||
-LDFLAGS.l2tpd= -Wl,-E -L. -Lusl -lusl -ldl $(LIBS.dmalloc) -lc
|
||||
-LDFLAGS.l2tpconfig= -Lcli -lcli -lreadline $(LIBS.dmalloc) $(READLINE_LDFLAGS) -lc
|
||||
+LDFLAGS.l2tpd= -Wl,-E -L. -Lusl -lusl -ldl $(LIBS.dmalloc) -lc $(LDFLAGS)
|
||||
+LDFLAGS.l2tpconfig= -Lcli -lcli -lreadline $(LIBS.dmalloc) $(READLINE_LDFLAGS) -lc $(LDFLAGS)
|
||||
|
||||
OPT_CFLAGS?= -O
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
This fixes a compile issue introduced with linux kernel 4.15
|
||||
|
||||
include/linux/in.h:222:8: error: redefinition of 'struct in_pktinfo'
|
||||
| struct in_pktinfo {
|
||||
|
||||
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Armin Kuster <akuster808@gmail.com>
|
||||
|
||||
Index: openl2tp-1.8/plugins/ppp_unix.c
|
||||
===================================================================
|
||||
--- openl2tp-1.8.orig/plugins/ppp_unix.c
|
||||
+++ openl2tp-1.8/plugins/ppp_unix.c
|
||||
@@ -25,9 +25,14 @@
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
#include <signal.h>
|
||||
+#include <linux/version.h>
|
||||
+
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
|
||||
#include <net/ethernet.h>
|
||||
#include <net/if.h>
|
||||
#include <netinet/in.h>
|
||||
+#endif
|
||||
+
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
@@ -41,12 +46,12 @@
|
||||
#define __user
|
||||
#endif
|
||||
#include <sys/ioctl.h>
|
||||
-#include <linux/if_ether.h>
|
||||
-#include <linux/if_pppox.h>
|
||||
#include <linux/ppp_defs.h>
|
||||
#include <linux/if_ppp.h>
|
||||
+#include <linux/if_pppox.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
|
||||
#include <linux/if_pppol2tp.h>
|
||||
-
|
||||
+#endif
|
||||
#include "usl.h"
|
||||
#include "l2tp_private.h"
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
From 460549a3de27f8dd8371b6d6fc1f69d8bffa102b Mon Sep 17 00:00:00 2001
|
||||
From: Joe MacDonald <joe_macdonald@mentor.com>
|
||||
Date: Tue, 6 Jan 2015 11:23:21 -0500
|
||||
Subject: [PATCH] openl2tp: simplify gcc warning hack
|
||||
|
||||
The hack to work around the gcc warning causes problems with some modern
|
||||
gcc configurations. Since the redef behaviour is essentially correct
|
||||
everywhere and since the hack is still required on 32-bit builders, leave
|
||||
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
|
||||
|
||||
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
|
||||
---
|
||||
l2tp_private.h | 6 ------
|
||||
1 file changed, 6 deletions(-)
|
||||
|
||||
diff --git a/l2tp_private.h b/l2tp_private.h
|
||||
index f3c1af7..cca6806 100644
|
||||
--- a/l2tp_private.h
|
||||
+++ b/l2tp_private.h
|
||||
@@ -89,14 +89,8 @@
|
||||
* So we redefine the constant with UL suffix to avoid the gcc warning.
|
||||
* Is there some C preprocessor magic that could avoid having to do this?
|
||||
*/
|
||||
-#if L2TP_API_TUNNEL_FLAG_MTU != 2147483648
|
||||
-#error Constant L2TP_API_TUNNEL_FLAG_MTU changed. Update local definition here.
|
||||
-#endif
|
||||
#undef L2TP_API_TUNNEL_FLAG_MTU
|
||||
#define L2TP_API_TUNNEL_FLAG_MTU 2147483648UL
|
||||
-#if L2TP_API_SESSION_FLAG_NO_PPP != 2147483648
|
||||
-#error Constant L2TP_API_SESSION_FLAG_NO_PPP changed. Update local definition here.
|
||||
-#endif
|
||||
#undef L2TP_API_SESSION_FLAG_NO_PPP
|
||||
#define L2TP_API_SESSION_FLAG_NO_PPP 2147483648UL
|
||||
|
||||
--
|
||||
1.9.1
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
commit 3e96a6c41bdd26417265a45ed685138d8eed564e
|
||||
Author: Aws Ismail <aws.ismail@windriver.com>
|
||||
Date: Fri Sep 14 02:32:53 2012 -0400
|
||||
|
||||
openl2tp: Enable tests
|
||||
|
||||
Build the test direcctory as part
|
||||
of the overall build
|
||||
|
||||
Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 412cf4d..adf4f44 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -16,7 +16,7 @@ L2TP_FEATURE_LOCAL_CONF_FILE= y
|
||||
|
||||
# Define to include test code. This must be defined to run the
|
||||
# regression tests
|
||||
-# L2TP_TEST= y
|
||||
+L2TP_TEST=y
|
||||
|
||||
# Define to compile in debug code. Also makes default trace flags
|
||||
# enable all messages
|
||||
@@ -0,0 +1,35 @@
|
||||
commit 6ea3125e2bec15004f312814022335d94cdf7e94
|
||||
Author: Aws Ismail <aws.ismail@windriver.com>
|
||||
Date: Wed Sep 19 11:34:48 2012 -0400
|
||||
|
||||
Fix openl2tp config script location
|
||||
|
||||
Correct the location of the sysconfig
|
||||
script. Use /etc/default/ instead of
|
||||
/etc/sysconfig/
|
||||
|
||||
Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
|
||||
|
||||
Upstream-Status: Inappropriate [configuration]
|
||||
|
||||
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
|
||||
--- a/etc/rc.d/init.d/openl2tpd
|
||||
+++ b/etc/rc.d/init.d/openl2tpd
|
||||
@@ -8,12 +8,12 @@
|
||||
# can be used to implement L2TP VPNs. As a server, it can handle
|
||||
# hundreds of tunnels and sessions.
|
||||
# processname: openl2tpd
|
||||
-# config: /etc/sysconfig/openl2tpd
|
||||
+# config: /etc/default/openl2tpd
|
||||
# pidfile: /var/run/openl2tpd.pid
|
||||
|
||||
# Source function library.
|
||||
. /etc/init.d/functions
|
||||
-. /etc/sysconfig/openl2tpd
|
||||
+. /etc/default/openl2tpd
|
||||
|
||||
# See how we were called.
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
openl2tp: eliminate warning from modprobe
|
||||
|
||||
modprobe will emit alarming warnings if it cannot
|
||||
find a module, but we only care that it find one
|
||||
of two possible modules when we start openl2tpd.
|
||||
|
||||
Suppress messages from modprobe.
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Joe Slater <jslater@windriver.com>
|
||||
|
||||
--- a/etc/rc.d/init.d/openl2tpd
|
||||
+++ b/etc/rc.d/init.d/openl2tpd
|
||||
@@ -29,7 +29,7 @@ start() {
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
- modprobe -s pppol2tp || modprobe -s l2tp_ppp
|
||||
+ modprobe -sq pppol2tp || modprobe -sq l2tp_ppp
|
||||
RETVAL=$?
|
||||
if [ $RETVAL -eq 0 ]; then
|
||||
start-stop-daemon --start --exec openl2tpd $OPENL2TPDARGS
|
||||
@@ -57,7 +57,7 @@ stop() {
|
||||
return 1;
|
||||
fi
|
||||
killproc openl2tpd
|
||||
- modprobe -s -r pppol2tp || modprobe -s -r l2tp_ppp
|
||||
+ modprobe -srq pppol2tp || modprobe -srq l2tp_ppp
|
||||
echo
|
||||
rm -f /var/run/openl2tpd.pid
|
||||
rm -f /var/lock/subsys/openl2tpd
|
||||
@@ -0,0 +1,49 @@
|
||||
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>
|
||||
|
||||
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
|
||||
--- a/etc/rc.d/init.d/openl2tpd
|
||||
+++ b/etc/rc.d/init.d/openl2tpd
|
||||
@@ -24,7 +24,7 @@ start() {
|
||||
if [ -e /var/lock/subsys/openl2tpd ]; then
|
||||
if [ -e /var/run/openl2tpd.pid ] && [ -e /proc/`cat /var/run/openl2tpd.pid` ]; then
|
||||
echo -n $"cannot start openl2tpd: openl2tpd is already running.";
|
||||
- failure $"cannot start openl2tpd: openl2tpd already running.";
|
||||
+ #failure $"cannot start openl2tpd: openl2tpd already running.";
|
||||
echo
|
||||
return 1
|
||||
fi
|
||||
@@ -32,9 +32,9 @@ start() {
|
||||
modprobe -s pppol2tp || modprobe -s l2tp_ppp
|
||||
RETVAL=$?
|
||||
if [ $RETVAL -eq 0 ]; then
|
||||
- daemon openl2tpd $OPENL2TPDARGS
|
||||
+ start-stop-daemon --start --exec openl2tpd $OPENL2TPDARGS
|
||||
+ RETVAL=$?
|
||||
fi
|
||||
- RETVAL=$?
|
||||
echo
|
||||
if [ $RETVAL -eq 0 ]; then
|
||||
touch /var/lock/subsys/openl2tpd
|
||||
@@ -52,7 +52,7 @@ stop() {
|
||||
echo -n $"Stopping $prog: "
|
||||
if [ ! -e /var/lock/subsys/openl2tpd ]; then
|
||||
echo -n $"cannot stop openl2tpd: openl2tpd is not running."
|
||||
- failure $"cannot stop openl2tpd: openl2tpd is not running."
|
||||
+ #failure $"cannot stop openl2tpd: openl2tpd is not running."
|
||||
echo
|
||||
return 1;
|
||||
fi
|
||||
@@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=The open L2TP implementation
|
||||
After=network.target remote-fs.target nss-lookup.target rpcbind.target
|
||||
Requires=rpcbind.service
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
PIDFile=/run/openl2tpd.pid
|
||||
EnvironmentFile=@SYSCONFDIR@/default/openl2tpd
|
||||
ExecStartPre=@BASE_BINDIR@/sh -c "@BASE_SBINDIR@/modprobe -sq l2tp_ppp || @BASE_SBINDIR@/modprobe -sq pppol2tp"
|
||||
ExecStart=@SBINDIR@/openl2tpd $OPENL2TPDARGS
|
||||
ExecStartPost=@BASE_BINDIR@/sh -c 'if [ -n "$OPENL2TPD_CONFIG_FILE" ]; then sleep 1; @BINDIR@/l2tpconfig config restore file=$OPENL2TPD_CONFIG_FILE; fi'
|
||||
ExecStopPost=@BASE_BINDIR@/sh -c "@BASE_SBINDIR@/modprobe -rsq l2tp_ppp || @BASE_SBINDIR@/modprobe -rsq pppol2tp"
|
||||
SuccessExitStatus=1
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,97 @@
|
||||
#!/bin/sh
|
||||
|
||||
TMP_DIR=`mktemp -d /tmp/std.26.tmp.XXXXXX`
|
||||
|
||||
# restore the file if exist
|
||||
restore_file()
|
||||
{
|
||||
filelist="test_procs.tcl tunnel.test session.test"
|
||||
for file in ${filelist}
|
||||
do
|
||||
if [ -f ${TMP_DIR}/${file} ]; then
|
||||
mv ${TMP_DIR}/${file} ${OPENL2TP_DIR}
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
exit_cus()
|
||||
{
|
||||
restore_file
|
||||
echo $1
|
||||
exit $2
|
||||
}
|
||||
|
||||
if [ -d /usr/lib64/openl2tp/ptest ]; then
|
||||
OPENL2TP_DIR="/usr/lib64/openl2tp"
|
||||
elif [ -d /usr/lib/openl2tp/ptest ]; then
|
||||
OPENL2TP_DIR="/usr/lib/openl2tp"
|
||||
else
|
||||
exit_cus "The openl2tp ptest directory not installed, skip the test" 1
|
||||
fi
|
||||
|
||||
#read -p "Please input the network interface you use to test(such as eth0, em1 etc):" ETH_TEST
|
||||
echo "Please input the network interface you use to test(such as eth0, em1 etc):"
|
||||
read ETH_TEST > /dev/null
|
||||
|
||||
if [ x"$ETH_TEST" = x ]; then
|
||||
exit_cus "The network interface cannot be null" 1
|
||||
fi
|
||||
ifconfig | grep $ETH_TEST > /dev/null || exit_cus "The network interface you provide is invalid" 1
|
||||
|
||||
# check openl2tp related kernel config
|
||||
zcat /proc/config.gz | grep CONFIG_L2TP=y > /dev/null || exit_cus "Failed to check CONFIG_L2TP=y, skip the tests." 1
|
||||
zcat /proc/config.gz | grep CONFIG_PPPOL2TP=m > /dev/null || exit_cus "Failed to check CONFIG_PPPOL2TP=m, skip the tests." 1
|
||||
|
||||
SYSV_INIT="/etc/init.d/rpcbind"
|
||||
if [ -e ${SYSV_INIT} ]; then
|
||||
${SYSV_INIT} status > /dev/null || ${SYSV_INIT} start > /dev/null
|
||||
else
|
||||
systemctl status rpcbind > /dev/null || systemctl start rpcbind > /dev/null
|
||||
fi
|
||||
|
||||
which systemctl > /dev/null && systemctl status rpcbind > /dev/null || service rpcbind status > /dev/null
|
||||
[ $? -ne 0 ] && exit_cus "Failed to start rpcbind service, skip the tests." 1
|
||||
|
||||
# backup the below files
|
||||
cp ${OPENL2TP_DIR}/ptest/test_procs.tcl $TMP_DIR
|
||||
cp ${OPENL2TP_DIR}/ptest/tunnel.test $TMP_DIR
|
||||
cp ${OPENL2TP_DIR}/ptest/session.test $TMP_DIR
|
||||
|
||||
# customise the config
|
||||
if [ x"$ETH_TEST" = x ]; then
|
||||
exit_cus "Please set ETH_TEST which used to test first, skip the tests." 1
|
||||
fi
|
||||
|
||||
sed -i 's/eth2/'\"$ETH_TEST\"'/g' ${OPENL2TP_DIR}/ptest/test_procs.tcl
|
||||
test_ip="`ifconfig $ETH_TEST | grep 'inet ' | sed 's/^.*inet addr://g' | \
|
||||
sed 's/ *Mask.*$//g'|sed 's/ *Bcast.*$//g'`"
|
||||
sed -i 's/192.168.0.1/'"$test_ip"'/g' ${OPENL2TP_DIR}/ptest/tunnel.test
|
||||
|
||||
# load module l2tp_ppp
|
||||
modprobe l2tp_ppp > /dev/null
|
||||
lsmod | grep l2tp_ppp > /dev/null || exit_cus "FAIL: Load module l2tp_ppp" 2
|
||||
|
||||
# start openl2tpd
|
||||
ps aux | grep openl2tpd | grep -v grep > /dev/null && killall openl2tpd > /dev/null
|
||||
ppp_path=`rpm -ql openl2tp | grep ppp_null.so`
|
||||
echo "test it here"
|
||||
/usr/sbin/openl2tpd -d all -D -f -p ${ppp_path} & > /dev/null
|
||||
|
||||
# prepare the test env
|
||||
rm -rf $OPENL2TP_DIR/results
|
||||
mkdir -p $OPENL2TP_DIR/results || exit_cus "FAIL: mkdir $OPENL2TP_DIR/results" 2
|
||||
cp /usr/bin/l2tpconfig ${OPENL2TP_DIR} || exit_cus "FAIL: copy /usr/bin/l2tpconfig to ${OPENL2TP_DIR}" 2
|
||||
|
||||
# start the test
|
||||
cd ${OPENL2TP_DIR}/ptest && tclsh all.tcl -preservecore 3 -verbose bps -tmpdir $OPENL2TP_DIR/results -outfile test-l2tpd.result -constraints "l2tpdRunning peerProfile tunnelProfile sessionProfile pppProfile system" -match "peer_profile-1.1 tunnel_profile-1.1 session_profile-1.1 ppp_profile-1.1 system-1.1"
|
||||
|
||||
# check the result
|
||||
PASSNUM=`grep PASS $OPENL2TP_DIR/results/test-l2tpd.result | wc -l`
|
||||
FAILNUM=`grep FAIL $OPENL2TP_DIR/results/test-l2tpd.result | wc -l`
|
||||
if [ $PASSNUM -ne 0 ] && [ $FAILNUM -eq 0 ]; then
|
||||
echo "PASS: openl2tp"
|
||||
else
|
||||
echo "FAIL: openl2tp"
|
||||
fi
|
||||
|
||||
restore_file
|
||||
@@ -0,0 +1,96 @@
|
||||
SUMMARY = "An L2TP client/server, designed for VPN use."
|
||||
DESCRIPTION = "OpenL2TP is an open source L2TP client / server, written \
|
||||
specifically for Linux. It has been designed for use as an enterprise \
|
||||
L2TP VPN server or in commercial, Linux-based, embedded networking \
|
||||
products and is able to support hundreds of sessions, each with \
|
||||
different configuration. It is used by several ISPs to provide \
|
||||
L2TP services and by corporations to implement L2TP VPNs."
|
||||
HOMEPAGE = "http://www.openl2tp.org/"
|
||||
SECTION = "net"
|
||||
|
||||
# cli and usl use license 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 \
|
||||
file://usl/LICENSE;md5=9c1387a3c5213aa40671438af3e00793 \
|
||||
"
|
||||
|
||||
DEPENDS = "popt flex readline rpcsvc-proto-native bison-native"
|
||||
|
||||
SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${PV}/${BP}.tar.gz \
|
||||
file://Makefile-modify-CFLAGS-to-aviod-build-error.patch \
|
||||
file://openl2tp-simplify-gcc-warning-hack.patch \
|
||||
file://Makefile-obey-LDFLAGS.patch \
|
||||
file://0001-test-pppd_dummy.c-Fix-return-value.patch \
|
||||
file://0001-Use-1-instead-of-WAIT_ANY.patch \
|
||||
file://0002-cli-include-fcntl.h-for-O_CREAT-define.patch \
|
||||
file://0003-cli-Define-_GNU_SOURCE-for-getting-sighandler_t.patch \
|
||||
file://0001-l2tp_api-Included-needed-headers.patch \
|
||||
file://openl2tpd-initscript-fix.patch \
|
||||
file://openl2tpd-initscript-fix-sysconfig.patch \
|
||||
file://openl2tpd-initscript-fix-warning.patch \
|
||||
file://openl2tpd.service \
|
||||
file://openl2tpd-enable-tests.patch \
|
||||
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_AUTO_ENABLE = "disable"
|
||||
|
||||
DEPENDS += "libtirpc"
|
||||
CPPFLAGS += "-I${STAGING_INCDIR}/tirpc"
|
||||
CFLAGS += "-I${STAGING_INCDIR}/tirpc"
|
||||
LDFLAGS += "-ltirpc"
|
||||
|
||||
PARALLEL_MAKE = ""
|
||||
EXTRA_OEMAKE = 'CFLAGS="${CFLAGS} -Wno-unused-but-set-variable" CPPFLAGS="${CPPFLAGS}" OPT_CFLAGS="${CFLAGS}"'
|
||||
|
||||
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' \
|
||||
-e 's:$(CROSS_COMPILE)gcc:${CC}:g' \
|
||||
-e 's:$(CROSS_COMPILE)ar:${AR}:g' \
|
||||
-e 's:$(CROSS_COMPILE)nm:${NM}:g' \
|
||||
-e 's:$(CROSS_COMPILE)strip:${STRIP}:g' \
|
||||
-e 's:$(CROSS_COMPILE)install:install:g' \
|
||||
-e 's:CPPFLAGS-y:CPPFLAGS:g' \
|
||||
${S}/Makefile
|
||||
}
|
||||
|
||||
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
|
||||
install -m 0755 ${S}/etc/sysconfig/openl2tpd ${D}${sysconfdir}/default/openl2tpd
|
||||
|
||||
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
|
||||
install -D -m 0644 ${WORKDIR}/openl2tpd.service ${D}${systemd_system_unitdir}/openl2tpd.service
|
||||
sed -i -e 's,@STATEDIR@,${localstatedir},g' \
|
||||
-e 's,@SYSCONFDIR@,${sysconfdir},g' \
|
||||
-e 's,@SBINDIR@,${sbindir},g' \
|
||||
-e 's,@BINDIR@,${bindir},g' \
|
||||
-e 's,@BASE_SBINDIR@,${base_sbindir},g' \
|
||||
-e 's,@BASE_BINDIR@,${base_bindir},g' \
|
||||
${D}${systemd_system_unitdir}/openl2tpd.service
|
||||
fi
|
||||
}
|
||||
|
||||
do_install_ptest () {
|
||||
for i in all.tcl configfile.test peer_profile.test ppp_profile.test \
|
||||
session_profile.test session.test system.test test_procs.tcl \
|
||||
thirdparty_lns.test tunnel_profile.test tunnel.test; do
|
||||
install -m 0755 ${S}/test/$i ${D}${PTEST_PATH}
|
||||
done
|
||||
}
|
||||
|
||||
RDEPENDS:${PN} = "ppp ppp-l2tp bash"
|
||||
@@ -0,0 +1,26 @@
|
||||
From a64e52f9b58519aa2b8a1073fa6c04da04933428 Mon Sep 17 00:00:00 2001
|
||||
From: Jonathan Richardson <jonathan.richardson@broadcom.com>
|
||||
Date: Wed, 26 Feb 2020 12:16:38 -0800
|
||||
Subject: [PATCH] Fix musl libc build issue
|
||||
|
||||
clif.h should include sys/types.h for the definition of pid_t. It fails
|
||||
to compile when using musl libc.
|
||||
|
||||
Signed-off-by: Jonathan Richardson <jonathan.richardson@broadcom.com>
|
||||
|
||||
---
|
||||
include/clif.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/include/clif.h b/include/clif.h
|
||||
index 648eedf..92f4fd8 100644
|
||||
--- a/include/clif.h
|
||||
+++ b/include/clif.h
|
||||
@@ -32,6 +32,7 @@
|
||||
#ifndef CLIF_H
|
||||
#define CLIF_H
|
||||
|
||||
+#include <sys/types.h>
|
||||
#include <sys/un.h>
|
||||
#include "clif_sock.h"
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
From eb14aa66dc0384071af401cced8c02993b55502e Mon Sep 17 00:00:00 2001
|
||||
From: Jonathan Richardson <jonathan.richardson@broadcom.com>
|
||||
Date: Wed, 26 Feb 2020 15:54:51 -0800
|
||||
Subject: [PATCH] autotools: Add include path to generated version.h
|
||||
|
||||
When the build dir isn't the same as source dir it fails to compile
|
||||
because the generated version.h from AC_CONFIG_FILES is always in build
|
||||
dir. Include the path to it in AM_CPPFLAGS.
|
||||
|
||||
Signed-off-by: Jonathan Richardson <jonathan.richardson@broadcom.com>
|
||||
|
||||
---
|
||||
Makefile.am | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 0fb9bb0..2952019 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -14,6 +14,9 @@ endif
|
||||
AM_CPPFLAGS = -I${srcdir}/include -DSYSCONFDIR="\"${sysconfdir}\"" \
|
||||
-D_FORTIFY_SOURCE=2
|
||||
|
||||
+# Required for the generated version.h when build dir is not the same as srcdir.
|
||||
+AM_CPPFLAGS += -I${top_builddir}/include
|
||||
+
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
parse_cli.o: CFLAGS+=-U_FORTIFY_SOURCE -Wno-error
|
||||
@@ -0,0 +1,57 @@
|
||||
From dc3f2250908587710f109c80ddf8a94f0bc40b82 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
|
||||
files
|
||||
|
||||
Add option to configure.ac to enable or disable install of systemd conf
|
||||
files. If --with-systemdsystemunitdir is passed to configure then the
|
||||
files will be installed to the provided directory. If the option isn't
|
||||
provided then the value is determined from the systemd pkgconfig file,
|
||||
if found in PKG_CONFIG_PATH.
|
||||
|
||||
This change is required because Makefile.am always installed the files
|
||||
to a hard coded path that couldn't be changed.
|
||||
|
||||
|
||||
Signed-off-by: Jonathan Richardson <jonathan.richardson@broadcom.com>
|
||||
---
|
||||
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
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -138,8 +138,9 @@ install-data-hook: installdirs-local
|
||||
pkgconfigdir = ${libdir}/pkgconfig
|
||||
pkgconfig_DATA = lldpad.pc liblldp_clif.pc
|
||||
|
||||
-systemdsystemunitdir = $(prefix)/lib/systemd/system
|
||||
+if HAVE_SYSTEMD
|
||||
dist_systemdsystemunit_DATA = lldpad.service lldpad.socket
|
||||
+endif
|
||||
|
||||
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
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -95,6 +95,15 @@ AC_TYPE_UINT16_T
|
||||
AC_TYPE_UINT32_T
|
||||
AC_TYPE_UINT8_T
|
||||
|
||||
+# Support for systemd unit files.
|
||||
+AC_ARG_WITH([systemdsystemunitdir],
|
||||
+ AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
|
||||
+ [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
|
||||
+if test "x$with_systemdsystemunitdir" != xno; then
|
||||
+ AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
|
||||
+fi
|
||||
+AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
|
||||
+
|
||||
AC_CONFIG_FILES([Makefile include/version.h lldpad.spec lldpad.pc liblldp_clif.pc])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AC_OUTPUT
|
||||
@@ -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>
|
||||
@@ -0,0 +1,32 @@
|
||||
SUMMARY = "Open-LLDP"
|
||||
DESCRIPTION = "Link Layer Discovery Protocol for Linux that includes support for DCBX"
|
||||
HOMEPAGE = "http://open-lldp.org/start"
|
||||
|
||||
LICENSE = "GPL-2.0-only"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=8c2bc283e65df398ced5f5b747e78162"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
inherit pkgconfig autotools
|
||||
inherit ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}
|
||||
|
||||
DEPENDS = "libnl libconfig readline"
|
||||
|
||||
SRCREV = "85e55837a81d710e5baa7da47f7ed0d205c8ede5"
|
||||
PV .= "+git${SRCPV}"
|
||||
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 \
|
||||
"
|
||||
|
||||
# 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"
|
||||
|
||||
# To enable service at boot set to enable in local.conf.
|
||||
SYSTEMD_AUTO_ENABLE ?= "disable"
|
||||
|
||||
RRECOMMENDS:${PN} = "iproute2-tc"
|
||||
@@ -0,0 +1,30 @@
|
||||
#
|
||||
# Lock the port
|
||||
#
|
||||
lock
|
||||
|
||||
#
|
||||
# We don't need the tunnel server to authenticate itself
|
||||
#
|
||||
noauth
|
||||
|
||||
#
|
||||
# Turn off transmission protocols we know won't be used
|
||||
#
|
||||
nobsdcomp
|
||||
nodeflate
|
||||
|
||||
#
|
||||
# We want MPPE
|
||||
# (option naming specific to ppp 2.4.0 with unofficial patch)
|
||||
#
|
||||
#mppe-40
|
||||
mppe-128
|
||||
#mppe-stateless
|
||||
|
||||
#
|
||||
# We want a sane mtu/mru
|
||||
# (ppp 2.4.0 with unofficial patch)
|
||||
#
|
||||
#mtu 1000
|
||||
#mru 1000
|
||||
@@ -0,0 +1,32 @@
|
||||
SUMMARY = "Client for Microsoft PPTP VPNs"
|
||||
DESCRIPTION = "PPTP Client is a Linux, FreeBSD, NetBSD \
|
||||
and OpenBSD client for the proprietary Microsoft Point-to-Point \
|
||||
Tunneling Protocol, PPTP. Allows connection to a PPTP based \
|
||||
Virtual Private Network (VPN) as used by employers and some \
|
||||
cable and ADSL internet service providers."
|
||||
HOMEPAGE = "http://pptpclient.sourceforge.net"
|
||||
SECTION = "net"
|
||||
LICENSE = "GPL-2.0-or-later"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
|
||||
|
||||
inherit perlnative
|
||||
|
||||
SRC_URI = "${SOURCEFORGE_MIRROR}/sourceforge/pptpclient/pptp-${PV}.tar.gz \
|
||||
file://options.pptp \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "8d25341352fdae5ad5b36b9f18254908"
|
||||
SRC_URI[sha256sum] = "82492db8e487ce73b182ee7f444251d20c44f5c26d6e96c553ec7093aefb5af4"
|
||||
|
||||
S = "${WORKDIR}/pptp-${PV}"
|
||||
|
||||
EXTRA_OEMAKE = "-e MAKEFLAGS="
|
||||
|
||||
do_install() {
|
||||
install -d ${D}${sbindir} ${D}${sysconfdir}/ppp ${D}${mandir}/man8
|
||||
install -m 555 pptp ${D}${sbindir}
|
||||
install -m 644 pptp.8 ${D}${mandir}/man8
|
||||
install -m 644 ${WORKDIR}/options.pptp ${D}${sysconfdir}/ppp
|
||||
}
|
||||
|
||||
RDEPENDS:${PN} = "ppp"
|
||||
@@ -0,0 +1,84 @@
|
||||
From 45b97b474ce2d0ad56828db11edde8562bb47a43 Mon Sep 17 00:00:00 2001
|
||||
From: Li xin <lixin.fnst@cn.fujitsu.com>
|
||||
Date: Tue, 2 Dec 2014 02:33:53 +0900
|
||||
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
|
||||
|
||||
Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
|
||||
---
|
||||
configure.in | 6 +++++-
|
||||
etc/Makefile.am | 9 ++++++---
|
||||
etc/radiusclient.conf.in | 2 +-
|
||||
3 files changed, 12 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/configure.in b/configure.in
|
||||
index 812f640..3a8af99 100644
|
||||
--- a/configure.in
|
||||
+++ b/configure.in
|
||||
@@ -29,6 +29,9 @@ AC_SUBST(LIBVERSION)
|
||||
pkgsysconfdir=${sysconfdir}/$PACKAGE
|
||||
AC_SUBST(pkgsysconfdir)
|
||||
|
||||
+pkgdatadir=${datadir}/$PACKAGE
|
||||
+AC_SUBST(pkgdatadir)
|
||||
+
|
||||
AC_PROG_LIBTOOL
|
||||
|
||||
AC_PROG_CC
|
||||
@@ -118,7 +121,8 @@ then
|
||||
],
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_STRUCT_UTSNAME_DOMAINNAME),
|
||||
- AC_MSG_RESULT(no)
|
||||
+ AC_MSG_RESULT(no),
|
||||
+ AC_MSG_RESULT(assume no),
|
||||
)
|
||||
fi
|
||||
|
||||
diff --git a/etc/Makefile.am b/etc/Makefile.am
|
||||
index 39b6975..a3c403f 100644
|
||||
--- a/etc/Makefile.am
|
||||
+++ b/etc/Makefile.am
|
||||
@@ -14,9 +14,11 @@ CLEANFILES = *~ radiusclient.conf
|
||||
|
||||
sbindir = @sbindir@
|
||||
pkgsysconfdir = @pkgsysconfdir@
|
||||
-pkgsysconf_DATA = issue port-id-map radiusclient.conf \
|
||||
- dictionary dictionary.ascend dictionary.compat dictionary.merit \
|
||||
- dictionary.sip
|
||||
+pkgsysconf_DATA = issue port-id-map radiusclient.conf
|
||||
+
|
||||
+pkgdatadir = @pkgdatadir@
|
||||
+pkgdata_DATA = dictionary dictionary.ascend dictionary.compat \
|
||||
+ dictionary.merit dictionary.sip
|
||||
|
||||
EXTRA_DIST = issue port-id-map dictionary dictionary.ascend \
|
||||
dictionary.compat dictionary.merit servers radiusclient.conf.in \
|
||||
@@ -25,6 +27,7 @@ EXTRA_DIST = issue port-id-map dictionary dictionary.ascend \
|
||||
radiusclient.conf: radiusclient.conf.in
|
||||
sed -e 's|@sbin''dir@|$(sbindir)|g' \
|
||||
-e 's|@pkgsysconf''dir@|$(pkgsysconfdir)|g' \
|
||||
+ -e 's|@pkgdata''dir@|$(pkgdatadir)|g' \
|
||||
<$(srcdir)/radiusclient.conf.in >radiusclient.conf
|
||||
|
||||
install-data-local: servers
|
||||
diff --git a/etc/radiusclient.conf.in b/etc/radiusclient.conf.in
|
||||
index 948bc2f..aac9973 100644
|
||||
--- a/etc/radiusclient.conf.in
|
||||
+++ b/etc/radiusclient.conf.in
|
||||
@@ -47,7 +47,7 @@ servers @pkgsysconfdir@/servers
|
||||
|
||||
# dictionary of allowed attributes and values
|
||||
# just like in the normal RADIUS distributions
|
||||
-dictionary @pkgsysconfdir@/dictionary
|
||||
+dictionary @pkgdatadir@/dictionary
|
||||
|
||||
# program to call for a RADIUS authenticated login
|
||||
login_radius @sbindir@/login.radius
|
||||
--
|
||||
1.8.4.2
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
ac_cv_func_uname=no
|
||||
@@ -0,0 +1,37 @@
|
||||
SUMMARY = "RADIUS protocol client library"
|
||||
DESCRIPTION = "Portable, easy-to-use and standard compliant library suitable \
|
||||
for developing free and commercial software that need support for a RADIUS \
|
||||
protocol (RFCs 2128 and 2139)."
|
||||
HOMEPAGE = "http://sourceforge.net/projects/radiusclient-ng.berlios/"
|
||||
SECTION = "net"
|
||||
|
||||
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[sha256sum] = "282a9f1355f190efbb06c0d7c4e062eaa652caf342ed3ad361ac595f72f09f14"
|
||||
|
||||
LICENSE = "BSD-3-Clause & BSD-2-Clause & HPND"
|
||||
LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=3e47566c9271b786693d8a08792dbf41"
|
||||
|
||||
inherit autotools-brokensep
|
||||
|
||||
DEPENDS += "virtual/crypt"
|
||||
|
||||
EXTRA_OECONF += "--disable-static"
|
||||
|
||||
do_configure:prepend () {
|
||||
export CONFIG_SITE=./config-site.${P}
|
||||
}
|
||||
|
||||
do_compile:prepend() {
|
||||
for m in `find . -name "Makefile"` ; do
|
||||
sed -i -e 's:^program_transform_name =.*:program_transform_name =:g' ${m}
|
||||
done
|
||||
}
|
||||
|
||||
do_install() {
|
||||
oe_runmake DESTDIR=${D} install
|
||||
rm -f ${D}${libdir}/*.la
|
||||
rm -f ${D}${sbindir}/radexample
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
From fdb64d21560bfdafeefccc7d20e105e4857faa99 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Tue, 28 Mar 2017 19:20:07 -0700
|
||||
Subject: [PATCH] ppoe: Dont include linux/if_ether.h
|
||||
|
||||
Fixes build with musl
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
|
||||
---
|
||||
src/pppoe.h | 4 ----
|
||||
1 file changed, 4 deletions(-)
|
||||
|
||||
diff --git a/src/pppoe.h b/src/pppoe.h
|
||||
index ec067a0..281879c 100644
|
||||
--- a/src/pppoe.h
|
||||
+++ b/src/pppoe.h
|
||||
@@ -127,10 +127,6 @@ typedef unsigned long UINT32_t;
|
||||
#error Could not find a 32-bit integer type
|
||||
#endif
|
||||
|
||||
-#ifdef HAVE_LINUX_IF_ETHER_H
|
||||
-#include <linux/if_ether.h>
|
||||
-#endif
|
||||
-
|
||||
#include <netinet/in.h>
|
||||
|
||||
#ifdef HAVE_NETINET_IF_ETHER_H
|
||||
@@ -0,0 +1,23 @@
|
||||
From 31b6eecd7e5ebfb9a37915f28823e5af9d1062b4 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Tue, 28 Mar 2017 19:24:53 -0700
|
||||
Subject: [PATCH] Enable support for the kernel module
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
|
||||
---
|
||||
src/configure.in | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/configure.in b/src/configure.in
|
||||
index cae0976..951a042 100644
|
||||
--- a/src/configure.in
|
||||
+++ b/src/configure.in
|
||||
@@ -33,6 +33,7 @@ AC_CHECK_HEADERS(linux/if_pppox.h, [], [],
|
||||
#include<net/ethernet.h>
|
||||
#include<linux/if.h>
|
||||
#include<linux/in.h>
|
||||
+#include<linux/in6.h>
|
||||
])
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
@@ -0,0 +1,19 @@
|
||||
From c96dda04ec024bdef2a15d374e5f8242e041cad4 Mon Sep 17 00:00:00 2001
|
||||
From: Richard Purdie <richard.purdie@linuxfoundation.org>
|
||||
Date: Fri, 18 Jul 2014 08:25:16 +0000
|
||||
|
||||
---
|
||||
configure.in | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/configure.in b/configure.in
|
||||
index ac1a7e4..11b9f31 100644
|
||||
--- a/configure.in
|
||||
+++ b/configure.in
|
||||
@@ -1,4 +1,4 @@
|
||||
-AC_INIT(src/pppoe.c)
|
||||
-AM_INIT_AUTOMAKE([rp-pppoe], [3.8])
|
||||
+AC_INIT([rp-pppoe], [3.8])
|
||||
+AM_INIT_AUTOMAKE([foreign])
|
||||
AC_CONFIG_SUBDIRS(src)
|
||||
AC_OUTPUT(Makefile)
|
||||
@@ -0,0 +1,133 @@
|
||||
From 172907f31d64da4c3f289a439fd605d2ab51b24a Mon Sep 17 00:00:00 2001
|
||||
From: Lei Maohui <leimaohui@cn.fujitsu.com>
|
||||
Date: Wed, 19 Aug 2015 12:17:03 +0900
|
||||
Subject: [PATCH] configure in cross
|
||||
|
||||
Update the configure script to cross-compiling with OE. This hard-codes
|
||||
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 | 62 ++++++++++--------------------------------------
|
||||
1 file changed, 12 insertions(+), 50 deletions(-)
|
||||
|
||||
diff --git a/src/configure.in b/src/configure.in
|
||||
index 4add50c..9dff457 100644
|
||||
--- a/src/configure.in
|
||||
+++ b/src/configure.in
|
||||
@@ -5,6 +5,13 @@ AC_INIT(pppoe.c)
|
||||
dnl pppd directory for kernel-mode PPPoE
|
||||
PPPD_DIR=ppp-2.4.1.pppoe2
|
||||
|
||||
+dnl hard code some paths
|
||||
+PPPD=/usr/sbin/pppd
|
||||
+ID=/usr/bin/id
|
||||
+ECHO=/bin/echo
|
||||
+AC_ARG_VAR(PPPD)
|
||||
+AC_ARG_VAR(ID)
|
||||
+
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
|
||||
AC_PREFIX_DEFAULT(/usr)
|
||||
@@ -45,7 +52,7 @@ ac_cv_struct_sockaddr_ll=no)
|
||||
AC_MSG_RESULT($ac_cv_struct_sockaddr_ll)
|
||||
|
||||
if test "$ac_cv_struct_sockaddr_ll" = yes ; then
|
||||
-AC_DEFINE(HAVE_STRUCT_SOCKADDR_LL)
|
||||
+AC_DEFINE([HAVE_STRUCT_SOCKADDR_LL], [], [Have struct SOCKADDR_LL])
|
||||
fi
|
||||
|
||||
dnl Check for N_HDLC line discipline
|
||||
@@ -58,7 +65,7 @@ AC_TRY_COMPILE([
|
||||
ac_cv_n_hdlc=no)
|
||||
AC_MSG_RESULT($ac_cv_n_hdlc)
|
||||
if test "$ac_cv_n_hdlc" = yes ; then
|
||||
-AC_DEFINE(HAVE_N_HDLC)
|
||||
+AC_DEFINE([HAVE_N_HDLC], [], [Have N_HDLC])
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(plugin, [ --enable-plugin=pppd_src_path build pppd plugin], ac_cv_pluginpath=$enableval, ac_cv_pluginpath=no)
|
||||
@@ -106,7 +113,7 @@ PPPD_INCDIR=""
|
||||
if test "$ac_cv_header_linux_if_pppox_h" = yes ; then
|
||||
if test "$ac_cv_pluginpath" != no ; then
|
||||
LINUX_KERNELMODE_PLUGIN=rp-pppoe.so
|
||||
- AC_DEFINE(HAVE_LINUX_KERNEL_PPPOE)
|
||||
+ AC_DEFINE([HAVE_LINUX_KERNEL_PPPOE], [], [Have kernel PPPoE])
|
||||
PPPD_INCDIR=$ac_cv_pluginpath
|
||||
fi
|
||||
fi
|
||||
@@ -116,7 +123,7 @@ if test "$PPPD_INCDIR" = "" ; then
|
||||
fi
|
||||
|
||||
if test "$ac_cv_debugging" = "yes" ; then
|
||||
- AC_DEFINE(DEBUGGING_ENABLED)
|
||||
+ AC_DEFINE([DEBUGGING_ENABLED], [], [Debugging enabled])
|
||||
fi
|
||||
|
||||
AC_SUBST(LINUX_KERNELMODE_PLUGIN)
|
||||
@@ -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)
|
||||
-
|
||||
-dnl Check for setsid (probably Linux-specific)
|
||||
-AC_PATH_PROG(SETSID, setsid, "", $PATH:/sbin:/usr/sbin:/usr/local/sbin)
|
||||
-
|
||||
dnl Check for an "id" which accepts "-u" option -- hack for Solaris.
|
||||
-AC_PATH_PROG(ID, id, "", /usr/xpg4/bin:$PATH)
|
||||
+dnl AC_PATH_PROG(ID, id, "", /usr/xpg4/bin:$PATH)
|
||||
|
||||
dnl Check for Linux-specific kernel support for PPPoE
|
||||
AC_MSG_CHECKING(for Linux 2.4.X kernel-mode PPPoE support)
|
||||
@@ -195,42 +193,6 @@ if test "$GCC" = yes; then
|
||||
CFLAGS="$CFLAGS -fno-strict-aliasing -Wall -Wstrict-prototypes"
|
||||
fi
|
||||
|
||||
-dnl If we couldn't find pppd, die
|
||||
-if test "$PPPD" = "NOTFOUND"; then
|
||||
- AC_MSG_WARN([*** Oops! I couldn't find pppd, the PPP daemon anywhere.])
|
||||
- AC_MSG_WARN([*** You must install pppd, version 2.3.10 or later.])
|
||||
- AC_MSG_WARN([*** I will keep going, but it may not work.])
|
||||
- PPPD=pppd
|
||||
-fi
|
||||
-
|
||||
-dnl Figure out pppd version. 2.3.7 to 2.3.9 -- issue warning. Less than
|
||||
-dnl 2.3.7 -- stop
|
||||
-
|
||||
-PPPD_VERSION=`$PPPD --version 2>&1 | awk ' /version/ {print $NF}'`
|
||||
-
|
||||
-case "$PPPD_VERSION" in
|
||||
-1.*|2.0.*|2.1.*|2.2.*|2.3.0|2.3.1|2.3.2|2.3.3|2.3.4|2.3.5|2.3.6)
|
||||
- AC_MSG_WARN([*** Oops! Your version of pppd is $PPPD_VERSION, which is too old.])
|
||||
- AC_MSG_WARN([*** You need at least 2.3.7 (2.3.10 or newer recommended.])
|
||||
- AC_MSG_WARN([*** I will keep going, but it may not work.])
|
||||
- ;;
|
||||
-
|
||||
-2.3.7|2.3.8|2.3.9)
|
||||
- AC_MSG_WARN([*** Warning. Your version of pppd is $PPPD_VERSION. You will])
|
||||
- AC_MSG_WARN([*** not be able to use connect-on-demand. Upgrade to pppd])
|
||||
- AC_MSG_WARN([*** 2.3.10 or newer if you need connect-on-demand.])
|
||||
- ;;
|
||||
-
|
||||
-2*|3*|4*|5*|6*|7*|8*|9*)
|
||||
- ;;
|
||||
-
|
||||
-*)
|
||||
- AC_MSG_WARN([*** Oops. I cannot figure out what version of pppd you have.])
|
||||
- AC_MSG_WARN([*** All I got back was '$PPPD_VERSION'])
|
||||
- AC_MSG_WARN([*** I will keep going, but it may not work.])
|
||||
- ;;
|
||||
-esac
|
||||
-
|
||||
# Sigh... got to fix this up for tcl
|
||||
test "x$prefix" = xNONE && prefix=$ac_default_prefix
|
||||
# Let make expand exec_prefix.
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
From f658181c58347c3e2b0ee4f0a6a3d19162921471 Mon Sep 17 00:00:00 2001
|
||||
From: Ting Liu <b28495@freescale.com>
|
||||
Date: Tue, 12 Jun 2012 14:26:16 -0400
|
||||
Subject: [PATCH] discard use of dnl in Makefile.am
|
||||
|
||||
Since Makefile.am is not processed by m4, but by automake, 'dnl' does
|
||||
not introduce a comment.
|
||||
|
||||
Signed-off-by: Ting Liu <b28495@freescale.com>
|
||||
|
||||
---
|
||||
Makefile.am | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index eff6977..3091c33 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -1,5 +1,5 @@
|
||||
PACKAGE = rp-pppoe
|
||||
VERSION = 3.8
|
||||
|
||||
-dnl AM_CFLAGS = -Wall -DDEBUG
|
||||
+##dnl AM_CFLAGS = -Wall -DDEBUG
|
||||
SUBDIRS = src
|
||||
@@ -0,0 +1,22 @@
|
||||
# PPPoE Server options
|
||||
|
||||
# Maximum segment size, not used for in kernel PPPoE
|
||||
#MSS=1412
|
||||
|
||||
# Device(s) - Space seperated list of devices to listen on
|
||||
#DEVICES="eth1"
|
||||
|
||||
# Local IP
|
||||
#LOCAL_IP=10.0.0.1
|
||||
|
||||
# Starting remote IP
|
||||
#REMOTE_IP=10.67.15.1
|
||||
|
||||
# Service name
|
||||
#SERVICE_NAME="acme"
|
||||
|
||||
# Maximum number of sessions, default is 16
|
||||
#MAX_SESSIONS=64
|
||||
|
||||
# Access concentrator name, default is the hostname
|
||||
#ACCESS_CONCENTRATOR_NAME="pppoe-rtr-1"
|
||||
@@ -0,0 +1,59 @@
|
||||
#! /bin/sh
|
||||
|
||||
test -f /usr/sbin/pppoe-server || exit 0
|
||||
test -f /etc/default/pppoe-server && . /etc/default/pppoe-server
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
OPTIONS=""
|
||||
if [ -n "$MSS" ]; then
|
||||
OPTIONS="$OPTIONS -m $MSS"
|
||||
fi
|
||||
if [ -n "$DEVICES" ]; then
|
||||
for i in $DEVICES; do
|
||||
OPTIONS="$OPTIONS -I $i"
|
||||
done
|
||||
fi
|
||||
if [ -n "$LOCAL_IP" ]; then
|
||||
OPTIONS="$OPTIONS -L $LOCAL_IP"
|
||||
fi
|
||||
if [ -n "$REMOTE_IP" ]; then
|
||||
OPTIONS="$OPTIONS -R $REMOTE_IP"
|
||||
fi
|
||||
if [ -n "$SERVICE_NAME" ]; then
|
||||
OPTIONS="$OPTIONS -S $SERVICE_NAME"
|
||||
fi
|
||||
if [ -n "$MAX_SESSIONS" ]; then
|
||||
OPTIONS="$OPTIONS -N $MAX_SESSIONS"
|
||||
fi
|
||||
if [ -n "$ACCESS_CONCENTRATOR_NAME" ]; then
|
||||
OPTIONS="$OPTIONS -C $ACCESS_CONCENTRATOR_NAME"
|
||||
fi
|
||||
echo -n "Starting PPPoE server: pppoe-server"
|
||||
start-stop-daemon --start --quiet --exec /usr/sbin/pppoe-server -- $OPTIONS
|
||||
echo "."
|
||||
;;
|
||||
stop)
|
||||
echo -n "Stopping PPPoE server: pppoe-server"
|
||||
start-stop-daemon --stop --quiet --exec /usr/sbin/pppoe-server -- $OPTIONS
|
||||
echo "."
|
||||
;;
|
||||
status)
|
||||
pid=$(pidof pppoe-server)
|
||||
if [ -n "$pid" ] ; then
|
||||
echo "Running with pid $pid"
|
||||
else
|
||||
echo "Not running"
|
||||
fi
|
||||
;;
|
||||
restart|force-reload)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: /etc/init.d/pppoe-server {start|stop|restart|force-reload}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=PPPOE Service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
EnvironmentFile=-@SYSCONFDIR@/default/pppoe-server
|
||||
ExecStart=@SBINDIR@/pppoe-server
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,41 @@
|
||||
From 0b62f71eb5d44d4a57103566ba58022b6304fa4f Mon Sep 17 00:00:00 2001
|
||||
From: Tom Rini <tom_rini@mentor.com>
|
||||
Date: Wed, 27 Jul 2011 03:46:52 +0000
|
||||
Subject: [PATCH] rp-pppoe: Port from oe.dev
|
||||
|
||||
The autoconf stuff is all in a subdirectory, which is rather annoying
|
||||
as OE expects patches to be applied and autoconf stuff to be done in
|
||||
S. This adds enough autoconf at the top level to allow it to be
|
||||
called there - all it does is run a sub autoconf stuff in the src
|
||||
directory.
|
||||
|
||||
Upstream-Status: Inappropriate [build system specific change]
|
||||
|
||||
---
|
||||
Makefile.am | 5 +++++
|
||||
configure.in | 4 ++++
|
||||
2 files changed, 9 insertions(+)
|
||||
create mode 100644 Makefile.am
|
||||
create mode 100644 configure.in
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
new file mode 100644
|
||||
index 0000000..eff6977
|
||||
--- /dev/null
|
||||
+++ b/Makefile.am
|
||||
@@ -0,0 +1,5 @@
|
||||
+PACKAGE = rp-pppoe
|
||||
+VERSION = 3.8
|
||||
+
|
||||
+dnl AM_CFLAGS = -Wall -DDEBUG
|
||||
+SUBDIRS = src
|
||||
diff --git a/configure.in b/configure.in
|
||||
new file mode 100644
|
||||
index 0000000..ac1a7e4
|
||||
--- /dev/null
|
||||
+++ b/configure.in
|
||||
@@ -0,0 +1,4 @@
|
||||
+AC_INIT(src/pppoe.c)
|
||||
+AM_INIT_AUTOMAKE([rp-pppoe], [3.8])
|
||||
+AC_CONFIG_SUBDIRS(src)
|
||||
+AC_OUTPUT(Makefile)
|
||||
@@ -0,0 +1,41 @@
|
||||
From 4d34e0d7d790ec41b0afb731c7dc1b1ee90dd377 Mon Sep 17 00:00:00 2001
|
||||
From: Tom Rini <tom_rini@mentor.com>
|
||||
Date: Wed, 27 Jul 2011 03:46:52 +0000
|
||||
Subject: [PATCH] rp-pppoe: Port from oe.dev
|
||||
|
||||
Set the timeout to 0 since we don't want pppoe to try reconnecting,
|
||||
we want whatever is calling it to reconnect. Lots of odd things
|
||||
happen when you have pppoe retrying itself.
|
||||
|
||||
The path for the plugin is wrong, it's now part of ppp and is in a
|
||||
ppp's plugin lib directory. If no path is specified then that's where
|
||||
ppp looks, so that's what we do here.
|
||||
|
||||
Upstream-Status: Inappropriate [configuration]
|
||||
|
||||
---
|
||||
configs/pppoe.conf | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/configs/pppoe.conf b/configs/pppoe.conf
|
||||
index c222b2f..65618a5 100644
|
||||
--- a/configs/pppoe.conf
|
||||
+++ b/configs/pppoe.conf
|
||||
@@ -66,7 +66,7 @@ DEFAULTROUTE=yes
|
||||
# to connect forever after pppoe-start is called. Otherwise, it will
|
||||
# give out after CONNECT_TIMEOUT seconds and will not attempt to
|
||||
# connect again, making it impossible to reach.
|
||||
-CONNECT_TIMEOUT=30
|
||||
+CONNECT_TIMEOUT=0
|
||||
|
||||
# How often in seconds pppoe-start polls to check if link is up
|
||||
CONNECT_POLL=2
|
||||
@@ -115,7 +115,7 @@ PPPOE_TIMEOUT=80
|
||||
FIREWALL=NONE
|
||||
|
||||
# Linux kernel-mode plugin for pppd. If you want to try the kernel-mode
|
||||
-# plugin, use LINUX_PLUGIN=/etc/ppp/plugins/rp-pppoe.so
|
||||
+# plugin, use LINUX_PLUGIN=rp-pppoe.so
|
||||
LINUX_PLUGIN=
|
||||
|
||||
# Any extra arguments to pass to pppoe. Normally, use a blank string
|
||||
@@ -0,0 +1,78 @@
|
||||
SUMMARY = "A user-mode PPPoE client and server suite for Linux"
|
||||
HOMEPAGE = "http://www.roaringpenguin.com/products/pppoe"
|
||||
SECTION = "net"
|
||||
LICENSE = "GPL-2.0-only"
|
||||
LIC_FILES_CHKSUM = "file://doc/LICENSE;md5=a194eaefae2be54ee3221339b10d0581"
|
||||
|
||||
PR = "r11"
|
||||
|
||||
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://discard-use-of-dnl-in-Makefile.am.patch \
|
||||
file://configure.patch \
|
||||
file://pppoe-server.default \
|
||||
file://pppoe-server.init \
|
||||
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[sha256sum] = "b1f318bc7e4e5b0fd8a8e23e8803f5e6e43165245a5a10a7162a92a6cf17829a"
|
||||
|
||||
inherit autotools-brokensep update-rc.d systemd
|
||||
|
||||
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
|
||||
sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/pppoe-server.service
|
||||
install -d ${D}${datadir}/doc/${PN}
|
||||
if [ -f ${D}${datadir}/doc/README ]; then
|
||||
mv ${D}${datadir}/doc/README ${D}${datadir}/doc/${PN}/
|
||||
fi
|
||||
}
|
||||
|
||||
do_install() {
|
||||
# Install init script and default settings
|
||||
install -m 0755 -d ${D}${sysconfdir}/default ${D}${sysconfdir}/init.d
|
||||
install -m 0644 ${WORKDIR}/pppoe-server.default ${D}${sysconfdir}/default/pppoe-server
|
||||
install -m 0755 ${WORKDIR}/pppoe-server.init ${D}${sysconfdir}/init.d/pppoe-server
|
||||
# Install
|
||||
oe_runmake -C ${S} DESTDIR=${D} docdir=${docdir} install
|
||||
chmod 4755 ${D}${sbindir}/pppoe
|
||||
}
|
||||
|
||||
SYSTEMD_PACKAGES = "${PN}-server"
|
||||
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 \
|
||||
${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"
|
||||
|
||||
CONFFILES:${PN} = "${sysconfdir}/ppp/pppoe.conf \
|
||||
${sysconfdir}/ppp/firewall-standalone \
|
||||
${sysconfdir}/ppp/firewall-masq"
|
||||
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"
|
||||
|
||||
RDEPENDS:${PN} = "ppp"
|
||||
RDEPENDS:${PN}-server = "${PN}"
|
||||
RRECOMMENDS:${PN} = "ppp-oe"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user