Commit Graph

64 Commits

Author SHA1 Message Date
Rosen Penev 5bce0b09e6 Revert "net-snmp: fix compilation with GCC 14"
This reverts commit 7d39868294.
2024-05-16 23:44:08 -07:00
Aditya Nugraha 7d39868294 net-snmp: fix compilation with GCC 14
Refresh 900-musl-compat.patch, add missing headers & fixes incompatible pointer type is now an error.

Signed-off-by: Aditya Nugraha <vortexilation@gmail.com>
2024-05-16 23:33:27 -07:00
Ivan Pavlov 13a237d941 net-snmp: update to 5.9.4
Adjust patches for current version changes
Module "disk" renamed to "disk_hw"
Internal type "unknown" changed to "u_int32_t"
Add patch with removing macro syntax checking for successful build

Signed-off-by: Ivan Pavlov <AuthorReflex@gmail.com>
2024-02-10 14:57:25 -08:00
Christian Marangi 9f50361691
net-snmp: backport patch fixing memory leak for PCRE2
Backport patch fixing memory leak for PCRE2 present upstream.

Fixes: #22428
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-10-18 13:26:48 +02:00
Christian Marangi daf29ecbb2
net-snmp: move to PCRE2 library
Add upstream patch adding support for pcre2 and update dependency to
require libpcre2 instead of libpcre.

--with-pcre2-8 is now needed to exclude support for pcre and only
require pcre2 as net-snmp still use and try to use pcre by default.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-09-30 20:30:31 +02:00
Paul Fertser 0c10c224be treewide: remove AUTORELEASE
Automatically compute and substitute current values for all
$(AUTORELEASE) instances as this feature is deprecated and shouldn't be
used.

The following temporary change was made to the core:

diff --git a/rules.mk b/rules.mk
index 57d7995d4fa8..f16367de87a8 100644
--- a/rules.mk
+++ b/rules.mk
@@ -429,7 +429,7 @@ endef
 abi_version_str = $(subst -,,$(subst _,,$(subst .,,$(1))))

 COMMITCOUNT = $(if $(DUMP),0,$(call commitcount))
-AUTORELEASE = $(if $(DUMP),0,$(call commitcount,1))
+AUTORELEASE = $(if $(DUMP),0,$(shell sed -i "s/\$$(AUTORELEASE)/$(call commitcount,1)/" $(CURDIR)/Makefile))

 all:
 FORCE: ;

And this command used to fix affected packages:

for i in $(cd feeds/packages; git grep -l PKG_RELEASE:=.*AUTORELEASE | \
                              sed 's^.*/\([^/]*\)/Makefile^\1^';);
do
  make package/$i/download
done

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
2023-04-21 22:46:58 +02:00
Florian Eckert 9b67f7d134 net-snmp: rename stop_service to service_stopped
The commands in the function 'stop_service' do not stop the service.
Rather, they are commands that are to be executed when the service has
already been stopped. By renaming the function, the commands are now
executed after the service has been stopped.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2023-03-30 10:23:41 +03:00
Florian Eckert d6edd837f5 net-snmp: fix whitespaces
Replace spaces with tabs

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2023-03-30 10:16:00 +03:00
Seth Kingry 7b1bfb181a
net-snmp: move start order from 50 to 99
Signed-off-by: Seth Kingry <sjkingry@gmail.com>
2022-02-08 00:36:36 -05:00
Rosen Penev 2661d615db net-snmp: remove uClibc reference in patch
uClibc is no longer used in OpenWrt. It's pointless anyway. uClibc
defines __GLIBC__.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-10-05 02:01:39 +03:00
Rosen Penev 9aa6d9b9ac net-snmp: update to 5.9.1
Switch to AUTORELEASE for simplicity.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[remove irrelevant part from commit message after splitting changes]
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-10-05 02:00:56 +03:00
Stijn Tintel 4cdbe799b1 net-snmp: bump to 5.9
Neither the configure option nor configure variable to disable linking
against PCRE seem to work anymore, so simply drop both and add a
dependency on libpcre. As net-snmp is unlikely to fit on devices with
small flash anyway, the extra size requirement shouldn't be a problem.
If it is, feel free to submit a patch to fix the broken upstream
behaviour.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-03-17 21:53:10 +02:00
Ilya Lipnitskiy 5d8d4fbbcb
treewide: Run refresh on all packages
The crude loop I wrote to come up with this changeset:

  find -L package/feeds/packages/ -name patches | \
  sed 's/patches$/refresh/' | sort | xargs make

Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
2021-02-20 16:02:15 -08:00
Rosen Penev 5a7148d112
treewide: add missing BUILDONLY
Fixes Makefile warnings:

WARNING: skipping X -- package has no install section

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-10-12 17:43:49 -07:00
Rosen Penev 621c161afe
net-snmp: backport signal patch
Fixes compilation with uClibc-ng.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-09-26 16:07:25 -07:00
Stijn Tintel 6df49a634a net-snmp: do not exit if files cannot be opened
If snmpd fails to open files, like /dev/kmem or /dev/mem, it exits.
Avoid this by adding the -r argument.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2019-12-19 20:04:38 +02:00
Jan Pavlinec 299e5b0a9b
treewide: add PKG_CPE_ID for better cvescanner coverage
Signed-off-by: Jan Pavlinec <jan.pavlinec@nic.cz>
2019-09-17 12:40:26 +02:00
Alin Nastac 2168930089 net-snmp: reload firewall only when needed
Firewall needs to be reloaded in the following cases:
 - on service start when snmpd.general.enabled=1
 - when snmpd daemon is stopped

Signed-off-by: Alin Nastac <alin.nastac@gmail.com>
2019-08-12 10:27:22 +02:00
Koen Vandeputte 7bb78c3f9c
net-snmp: add missing dependency to libpci
There's a build race condition with other packages which sometimes results in:

Package libnetsnmp is missing dependencies for the following libraries:
libpci.so.3
2019-04-05 16:53:03 +02:00
Stijn Tintel 68a58ff22b
Merge pull request #8219 from Apteryks/master
net-snmp: disable support for perl
2019-02-16 17:28:50 +02:00
Stijn Tintel bf729d2f38
Merge pull request #5821 from kbabioch/feat/ipNetToPhysicalTable
net-snmp: Enable MIB ip-mib/inetNetToMediaTable
2019-02-16 17:15:04 +02:00
Maxim Cournoyer 90a713e3c6 net-snmp: disable support for perl
Using an external toolchain, it was discovered that net-snmp would
link with the Perl library (-lperl) from the host rather than from the
target.

Since we do not provide Perl as a dependency to net-snmp, the solution
is to disable support for it.

Fixes issue #8217.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
2019-02-14 13:34:39 -05:00
Rosen Penev 9251f51084 net-snmp: update to 5.8
Disable PCRE process searching to avoid linking against libprce, which
would cause the build to fail due to a missing dependency. With the
--without-pcre switch, build fails due to an undefined reference, so do
it via CONFIGURE_VARS instead.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[disable PCRE process searching]
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2018-10-17 16:03:54 +02:00
Stijn Tintel 1709b83091
Merge pull request #5069 from dedeckeh/pr-netsnmp-fw
net-snmp: fix inbound firewall rule support
2018-08-02 19:41:08 +03:00
Xavier Franquet a565ef8eaa SNMPD: Add snmp_extend config option
Signed-off-by: Xavier Franquet <xavier@franquet.es>
2018-05-23 16:04:13 +02:00
Hans Dedecker ffd78405f0 net-snmp: InstallDev fix
Commit 384c2a8cfd added support for symlinking
net-snmp-config into $(STAGING_DIR)/usr/bin but forgot to install first
$(STAGING_DIR)/usr/bin resulting into a compile issue if
$(STAGING_DIR)/usr/bin is not yet present.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-03-31 09:29:49 +02:00
Karol Babioch 9e856e2e3d net-snmp: Enable MIB ip-mib/inetNetToMediaTable
This enables the table `inetNetToMediaTable` from `ip-mib`, which implements
the `ipNetToPhysicalTable`. The former one is already enabled with the current
configuraiton, but it has been deprecatd by the IP version-neutral
`ipNetToMediaTable`, which also supports IPv6 entries [1]. It also disables all
other submodules from this MIB to keep the footprint small.

[1]: http://net-snmp.sourceforge.net/docs/mibs/IP-MIB.txt

Signed-off-by: Karol Babioch <karol@babioch.de>
2018-03-26 00:59:36 +02:00
Hans Dedecker 8d446e8da6 net-snmp: InstallDev fix
Commit 384c2a8cfd added support for symlinking
net-snmp-config into $(STAGING_DIR)/usr/bin but forgot to install first
$(STAGING_DIR)/usr/bin resulting into a compile issue if
$(STAGING_DIR)/usr/bin is not yet present.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-11-11 18:06:16 +01:00
Hans Dedecker 0bd19db049 net-snmp: fix inbound firewall rule support
Commit ae5ee6ba6c added support for inbound
firewall rule support but some corner cases were not covered.

In case net-snmp is started and the network interface is already up
the procd firewall rule is created but not applied by fw3 as
service_started calling procd_set_config_changed firewall was missing.

When stopping net-snmp clean up the net-snmp inbound firewall rules in
iptables by calling procd_set_config_changed firewall in stop_service
which will trigger fw3 to remove the inbound firewall rules.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-11-11 18:06:03 +01:00
Stijn Tintel e4165b4452 net-snmp: avoid duplicate section names
It seems that UCI can't handle duplicate section names in a single
config file, even if they use different types. After the previous
commit, running `uci export` results in the following error:

uci: Parse error (section of different type overwrites prior section with same name) at line 17, byte 23

Append a 6 to the com2sec6 section names to solve this.

Fixes: 0e1c8b4ccc ("net-snmp: snmpd: listen on IPv6 by default")
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2017-09-29 04:36:47 +03:00
Stijn Tintel 0e1c8b4ccc net-snmp: snmpd: listen on IPv6 by default
Closes #4758.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2017-09-29 02:45:25 +03:00
Stijn Tintel 8079f86caa net-snmp: add snmptrapd packages
Closes #4724.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2017-09-29 02:40:49 +03:00
Stijn Tintel 61769b0786 net-snmp: use LN macro
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2017-09-29 01:56:38 +03:00
Stijn Tintel 83a216bcc9 net-snmp: improve snmp-utils description
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2017-09-29 01:38:37 +03:00
Etienne Champetier 4006865ae8 treewide: run "make check FIXUP=1"
fix Makefile chmod (644)
replace MD5SUM with HASH
add PKG_MIRROR_HASH when PKG_SOURCE_PROTO:=git

(PKG_SOURCE_PROTO:=svn tarballs are not reproducible for now)

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
2017-08-29 21:41:14 -07:00
Hans Dedecker 5878373882 netsnmp: add global enabled config option
Add enabled config option in the global uci section; it allows to put into
place the snmpd config but not yet start the netsnmp daemon.
If config option is unset; netsnmp daemon will be started as before.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-07-10 21:45:37 +02:00
Philip Prindeville 384c2a8cfd net-snmp: add symlink for net-snmp-config into usr/bin
A lot of autoconf-based scripts expect --with-foo-dir=$(STAGING_DIR)/usr
and break if they can't find bin/foo-config as a child of that path.

Putting things in $(STAGING_DIR)/host/bin seems to be suboptimal; I
could change the install path but there's no saying what that would
break.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2017-06-21 11:53:38 -06:00
Hans Dedecker bb0dfbe6cc net-snmp: add notification config options
Add config support which allow snmpd to take a more active role by sending
traps.

Following config options are supported which map directly on snmpd directives:
-trapcommunity
-trapsink
-trap2sink
-informsink
-authtrapenable
-v1trapaddress
-trapsess

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-06-19 09:00:27 +02:00
Hans Dedecker ae5ee6ba6c net-snmp: add inbound firewall rule support
Add UCI section general which holds the uci parameter network defining on
which interface(s) the snmp agent is reachable for inbound snmp requests
in case the firewall zone does not allow INPUT traffic by default.

For the different zones to which the different interfaces belong firewall
procd input rules are created making the snmp agent reachable on udp port
161.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-05-24 15:03:23 +02:00
Stijn Tintel ec6712fead net-snmp: enable agent/extend MIB
Closes #4085.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2017-03-01 12:17:02 +01:00
Stijn Tintel 5081551ae8 net-snmp: add engineID config options
According to the snmpd.conf man page, the engineID of an snmp agent
should be consistent through time. However, it seems that the engineID
changes every reboot. Add options to configure how the engineID is
generated. The default setting generates it based on the MAC address of
the eth0 interface.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2017-02-14 15:17:07 +01:00
Stijn Tintel 42aeb06308 net-snmpd: convert snmpd-static to dummy package
We believe snmpd-static isn't useful, but download stats show it's still
being downloaded. Instead of dropping it, make it a dummy package that
depends on snmpd.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Acked-by: Jo-Philipp Wich <jo@mein.io>
2017-01-15 18:17:58 +01:00
Jo-Philipp Wich 399d0e57cd net-snmp: build against libnl-tiny
Instead of causing nondeterministing conditional compilation depending on
whether libnl-core happens to be present or not, fixup the net-snmp package
to link against libnl-tiny which is present by default on the majority of
systems.

In order to successfully build against libnl-tiny, a number of things had
to be fixed in both the upstream configure and the outer Makefile:

- Add a patch which fixes the upstream configure macros to properly handle
  cases where the cache variables for nl_connect() and netlink.h tests are
  predefined. Without this patch, all subsequent link tests in configure
  will fail, causing the build system to assume functions like opendir() or
  readdir() to be missing, leading to build failures later on due to
  conflicting redefinitions of structures and function prototypes

- In the same patch, stop probing the host systems /usr/include/libnl-3 if
  ac_cv_header_netlink_netlink_h is given. This brings the proprietary
  configure bits in line with the behaviour expected from autoconfig in a
  cross compile setting

- Explicitely request nl support by passing the --with-nl flag to configure

- Pass the required cache variables to skip the broken tests for
  nl_connect() and netlink.h

- Amend TARGET_CPPFLAGS to let net-snmp's build system discover nl-tiny's
  netlink/netlink.h and netlink/socket.h

- Enable the autoreconf fixup to regenerate the broken shipped configure
  from patched macros

- Adjust the depends to unconditionally require libnl-tiny

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2017-01-06 16:46:28 +01:00
Stijn Tintel 74e436fac5 net-snmp: fix libnl dependency for snmpd-static
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2017-01-06 02:56:03 +01:00
Stijn Tintel 0368739eac net-snmp: enable AgentX support
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2017-01-05 14:44:45 +01:00
Stijn Tintel 8915b1e03b net-snmp: fix libnl dependency
When libnl-core is enabled, but libnl isn't, build fails because of a
missing dependency on libnl-3.so.200. Depending on libnl-core seems to
work for both cases.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2017-01-04 13:16:56 +01:00
Hans Dedecker 6282bf2114 net-snmp : update to 5.7.3
Update to 5.7.3 by refreshing patches; remove 800-format-security
as upstream integrated.
Add libnl dependency in the package Makefile as net-snmp will check
if libnl is enabled in config_os_libs2.
Remove unneeded PKG_FIXUP build variable.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-01-04 12:05:34 +01:00
Sven Roederer daeb5fd506 net-snmp: add package snmp-mibs
this installs the default MIBS-files under /usr/share/snmp/mibs .
Also aligns the defines to the same sorting-scheme.

Signed-off-by: Sven Roederer <devel-sven@geroedel.de>
2017-01-03 22:11:21 +01:00
Stijn Tintel e6b554763e net-snmp: take over maintainership
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2017-01-03 19:40:59 +01:00
Jo-Philipp Wich 9843f170d7 treewide: replace my defunct email address
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2016-06-07 12:00:59 +02:00