This commit is contained in:
TriForceX
2021-03-13 22:13:38 -03:00
parent c77595adbd
commit b3ecc6e32d
7043 changed files with 119377 additions and 73694 deletions

View File

@@ -1,31 +0,0 @@
From 949ae648bf7c654b8fae607a0988bfa672607156 Mon Sep 17 00:00:00 2001
From: Patrick Rauscher <prauscher@prauscher.de>
Date: Fri, 18 Aug 2017 17:31:23 +0200
Subject: [PATCH] Prepend zero-byte before unsigned integers
fixes #8
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
---
mib.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/mib.c b/mib.c
index 7d2e513..a9ffbe2 100644
--- a/mib.c
+++ b/mib.c
@@ -207,6 +207,11 @@ static int encode_unsigned(data_t *data, int type, unsigned int ticks_value)
else
length = 1;
+ /* check if the integer could be interpreted negative during a signed decode and prepend a zero-byte if necessary */
+ if ((ticks_value >> (8 * (length - 1))) & 0x80) {
+ length++;
+ }
+
*buffer++ = type;
*buffer++ = length;
while (length--)
--
2.13.2

View File

@@ -0,0 +1,46 @@
From 73fa408f51ec25121075aaccac9c9db1c68567cd Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Thu, 12 Mar 2020 10:02:18 +0100
Subject: [PATCH] linux.c: fix musl build
Remove include on linux/if_link.h to avoid the following build failure
with musl:
In file included from /home/buildroot/autobuild/instance-2/output-1/host/i586-buildroot-linux-musl/sysroot/usr/include/linux/kernel.h:4,
from /home/buildroot/autobuild/instance-2/output-1/host/i586-buildroot-linux-musl/sysroot/usr/include/linux/netlink.h:4,
from /home/buildroot/autobuild/instance-2/output-1/host/i586-buildroot-linux-musl/sysroot/usr/include/linux/if_link.h:5,
from linux.c:21:
/home/buildroot/autobuild/instance-2/output-1/host/i586-buildroot-linux-musl/sysroot/usr/include/linux/sysinfo.h:7:8: error: redefinition of 'struct sysinfo'
struct sysinfo {
^~~~~~~
In file included from linux.c:19:
/home/buildroot/autobuild/instance-2/output-1/host/i586-buildroot-linux-musl/sysroot/usr/include/sys/sysinfo.h:10:8: note: originally defined here
struct sysinfo {
^~~~~~~
CC mini_snmpd-globals.o
Fixes:
- http://autobuild.buildroot.org/results/6903a0f685076b4a2c2824de6158da40e9e712d8
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
[Retrieved from:
https://github.com/troglobit/mini-snmpd/commit/73fa408f51ec25121075aaccac9c9db1c68567cd]
---
linux.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/linux.c b/linux.c
index a657912..86a7085 100644
--- a/linux.c
+++ b/linux.c
@@ -18,7 +18,6 @@
#include <netpacket/packet.h>
#include <sys/sysinfo.h>
#include <sys/socket.h>
-#include <linux/if_link.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/time.h>
--
2.25.1

View File

@@ -1,28 +0,0 @@
From 556c8a406c9e08dd9444222e072f7eb9c82a81e8 Mon Sep 17 00:00:00 2001
From: Patrick Rauscher <prauscher@prauscher.de>
Date: Fri, 18 Aug 2017 17:44:32 +0200
Subject: [PATCH] mib.c: allow unsigned integers to have an extra byte
The extra byte can be needed when encoding huge unsigned numbers (i.e. 0x80000000 or higher). In this case, during encoding we need an extra byte to make sure clients decoding as signed int do not get negative numbers. For further details, see commit 949ae648
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
---
mib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mib.c b/mib.c
index a9ffbe2..83cc20d 100644
--- a/mib.c
+++ b/mib.c
@@ -372,7 +372,7 @@ static int data_alloc(data_t *data, int type)
case BER_TYPE_COUNTER:
case BER_TYPE_GAUGE:
case BER_TYPE_TIME_TICKS:
- data->max_length = sizeof(unsigned int) + 2;
+ data->max_length = sizeof(unsigned int) + 3;
data->encoded_length = 0;
data->buffer = allocate(data->max_length);
break;
--
2.13.2

View File

@@ -0,0 +1,2 @@
# Require client authentication, thus SNMP version 2c
EXTRA_PARAMS=-a

View File

@@ -1,3 +1,3 @@
# Locally calculated
sha256 59f84e94ef7c9ff36d243c7974a100903a4a9a0bb529b67cf6f0d3352138a86b mini-snmpd-1.4.tar.gz
sha256 de00c475a3c70c56f3ee97cd683cb71009d3521d60b1f589c5a91b4671ede9f3 mini-snmpd-1.6.tar.gz
sha256 8a43b895972a24567297f44f35dab0f5f9ed3b7db6dac0bf6094075b27ab9d56 COPYING

View File

@@ -4,18 +4,18 @@
#
################################################################################
MINI_SNMPD_VERSION = 1.4
MINI_SNMPD_VERSION = 1.6
MINI_SNMPD_SITE = $(call github,troglobit,mini-snmpd,v$(MINI_SNMPD_VERSION))
MINI_SNMPD_LICENSE = GPL-2.0
MINI_SNMPD_LICENSE_FILES = COPYING
MINI_SNMPD_AUTORECONF = YES
MINI_SNMPD_DEPENDENCIES = host-pkgconf
define MINI_SNMPD_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 644 package/mini-snmpd/mini-snmpd.service \
$(TARGET_DIR)/usr/lib/systemd/system/mini-snmpd.service
mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
ln -sf ../../../../usr/lib/systemd/system/mini-snmpd.service \
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/mini-snmpd.service
define MINI_SNMPD_INSTALL_ETC_DEFAULT
$(INSTALL) -D -m 644 package/mini-snmpd/mini-snmpd \
$(TARGET_DIR)/etc/default/mini-snmpd
endef
MINI_SNMPD_POST_INSTALL_TARGET_HOOKS += MINI_SNMPD_INSTALL_ETC_DEFAULT
$(eval $(autotools-package))

View File

@@ -1,12 +0,0 @@
[Unit]
Description=Mini SNMP Daemon
StartLimitIntervalSec=0
[Service]
Environment='COMMUNITY=public'
ExecStart=/sbin/mini_snmpd -a -n -c ${COMMUNITY} $EXTRA_PARAMS
Restart=always
RestartSec=1
[Install]
WantedBy=multi-user.target