From: Ivan Pavlov Date: Fri, 13 Mar 2026 13:34:53 +0000 (+0300) Subject: net-snmp: update to 5.9.5.2 X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=d107cdb7481d5706956ac78134f8be3db462628e;p=openwrt-packages.git net-snmp: update to 5.9.5.2 Changelog: https://github.com/net-snmp/net-snmp/blob/v5.9.5.2/CHANGES Refresh patches for current version changes Added git headers for Debian patches Clean 750-ieee802dot11.patch - remove unnecesary trailing spaces, fix macro definition, include header file Remove patches: - 010-HOST-MIB-hr_filesys-fix-compile-error.patch - 161-project_types.patch - 751-gcc-14-fix.patch - 900-musl-compat.patch - 990-remove-semicolon-check-in-macros.patch Install symlink for shared library without version reference Signed-off-by: Ivan Pavlov --- diff --git a/net/net-snmp/Makefile b/net/net-snmp/Makefile index 5b41c3c92..86e622804 100644 --- a/net/net-snmp/Makefile +++ b/net/net-snmp/Makefile @@ -8,13 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=net-snmp -PKG_VERSION:=5.9.4 -PKG_RELEASE:=11 +PKG_VERSION:=5.9.5.2 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@SF/net-snmp -PKG_HASH:=8b4de01391e74e3c7014beb43961a2d6d6fa03acc34280b9585f4930745b0544 - +PKG_HASH:=16707719f833184a4b72835dac359ae188123b06b5e42817c00790d7dc1384bf PKG_MAINTAINER:=Stijn Tintel PKG_LICENSE:=MIT BSD-3-Clause-Clear PKG_LICENSE_FILES:=COPYING @@ -316,7 +315,7 @@ Package/snmpd-ssl/conffiles = $(Package/snmpd-nossl/conffiles) define Package/libnetsnmp-nossl/install $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.so.* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.so* $(1)/usr/lib/ endef Package/libnetsnmp-ssl/install = $(Package/libnetsnmp-nossl/install) diff --git a/net/net-snmp/patches/000-cross-compile.patch b/net/net-snmp/patches/000-cross-compile.patch index b0c9f4d50..8a1e3ac7c 100644 --- a/net/net-snmp/patches/000-cross-compile.patch +++ b/net/net-snmp/patches/000-cross-compile.patch @@ -13,32 +13,46 @@ encountering predefined cache variables, causing all subsequent configure link tests to fail due to a stray "no" word getting passed to the linker. Signed-off-by: Jo-Philipp Wich ---- a/configure.d/config_os_libs2 -+++ b/configure.d/config_os_libs2 -@@ -252,14 +252,22 @@ if test "x$with_nl" != "xno"; then +--- a/configure.d/config_os_libs1 ++++ b/configure.d/config_os_libs1 +@@ -161,21 +161,29 @@ if test "x$with_nl" != "xno"; then case $target_os in linux*) # Check for libnl (linux) netsnmp_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="${LIBNL3_CFLAGS} ${LIBNLROUTE3_CFLAGS} $CPPFLAGS" - NETSNMP_SEARCH_LIBS(nl_connect, nl-3, -- [AC_CHECK_HEADERS(netlink/netlink.h) +- [AC_CHECK_HEADERS([netlink/cache.h netlink/msg.h ]dnl +- [netlink/netlink.h netlink/socket.h]) - EXTERNAL_MIBGROUP_INCLUDES="$EXTERNAL_MIBGROUP_INCLUDES ${LIBNL3_CFLAGS}"], - [CPPFLAGS="$netsnmp_save_CPPFLAGS"], [], [LMIBLIBS]) +- NETSNMP_SEARCH_LIBS(rtnl_link_alloc_cache, nl-route-3, +- [AC_CHECK_HEADERS([netlink/route/addr.h netlink/route/link.h]) +- EXTERNAL_MIBGROUP_INCLUDES="$EXTERNAL_MIBGROUP_INCLUDES ${LIBNLROUTE3_CFLAGS}"], +- [CPPFLAGS="$netsnmp_save_CPPFLAGS"], [], [LMIBLIBS]) + netsnmp_netlink_include_flags="" if test "x$ac_cv_header_netlink_netlink_h" != xyes; then - NETSNMP_SEARCH_LIBS(nl_connect, nl, [ -- AC_CHECK_HEADERS(netlink/netlink.h)], [], [], LMIBLIBS) +- AC_CHECK_HEADERS([netlink/cache.h netlink/msg.h ]dnl +- [netlink/netlink.h netlink/socket.h])], +- [], [], LMIBLIBS) + netsnmp_netlink_include_flags="-I/usr/include/libnl3" + fi + CPPFLAGS="$netsnmp_netlink_include_flags $CPPFLAGS" + if test "x$netsnmp_cv_func_nl_connect_LIBS" = x; then + NETSNMP_SEARCH_LIBS(nl_connect, nl-3, -+ [AC_CHECK_HEADERS(netlink/netlink.h) ++ [AC_CHECK_HEADERS([netlink/cache.h netlink/msg.h ]dnl ++ [netlink/netlink.h netlink/socket.h]) ++ EXTERNAL_MIBGROUP_INCLUDES="$EXTERNAL_MIBGROUP_INCLUDES $netsnmp_netlink_include_flags"], ++ [CPPFLAGS="$netsnmp_save_CPPFLAGS"], [], [LMIBLIBS]) ++ NETSNMP_SEARCH_LIBS(rtnl_link_alloc_cache, nl-route-3, ++ [AC_CHECK_HEADERS([netlink/route/addr.h netlink/route/link.h]) + EXTERNAL_MIBGROUP_INCLUDES="$EXTERNAL_MIBGROUP_INCLUDES $netsnmp_netlink_include_flags"], -+ [CPPFLAGS="$netsnmp_save_CPPFLAGS"], [], [], [LMIBLIBS]) ++ [CPPFLAGS="$netsnmp_save_CPPFLAGS"], [], [LMIBLIBS]) + if test "x$ac_cv_header_netlink_netlink_h" != xyes; then + NETSNMP_SEARCH_LIBS(nl_connect, nl, [ -+ AC_CHECK_HEADERS(netlink/netlink.h)], [], [], LMIBLIBS) ++ AC_CHECK_HEADERS([netlink/cache.h netlink/msg.h ]dnl ++ [netlink/netlink.h netlink/socket.h])], ++ [], [], LMIBLIBS) + fi + else + LMIBLIBS="$LMIBLIBS $netsnmp_cv_func_nl_connect_LIBS" diff --git a/net/net-snmp/patches/010-HOST-MIB-hr_filesys-fix-compile-error.patch b/net/net-snmp/patches/010-HOST-MIB-hr_filesys-fix-compile-error.patch deleted file mode 100644 index 98ca95382..000000000 --- a/net/net-snmp/patches/010-HOST-MIB-hr_filesys-fix-compile-error.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 9588b5c9c27239b1f8c02f0bf417f13735e93225 Mon Sep 17 00:00:00 2001 -From: Stijn Tintel -Date: Sat, 26 Sep 2020 04:34:18 +0300 -Subject: [PATCH] HOST-MIB, hr_filesys: fix compile error - -On non-AIX systems without getfsstat, a variable is being declared right -after a label. This is a violation of the C language standard, and -causes the following compile error: - -host/hr_filesys.c: In function 'Get_Next_HR_FileSys': -host/hr_filesys.c:752:5: error: a label can only be part of a statement and a declaration is not a statement - const char **cpp; - ^~~~~ - -Fix the problem by adding an empty statement after the label. - -Fixes: 22e1371bb1fd ("HOST-MIB, hr_filesys: Convert recursion into iteration") - -Signed-off-by: Stijn Tintel ---- - agent/mibgroup/host/hr_filesys.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/agent/mibgroup/host/hr_filesys.c -+++ b/agent/mibgroup/host/hr_filesys.c -@@ -718,7 +718,7 @@ static const char *HRFS_ignores[] = { - int - Get_Next_HR_FileSys(void) - { --next: -+next: ; - #ifdef HAVE_GETFSSTAT - if (HRFS_index >= fscount) - return -1; diff --git a/net/net-snmp/patches/100-debian-statistics.patch b/net/net-snmp/patches/100-debian-statistics.patch index 7f8f9df86..5a1562c6f 100644 --- a/net/net-snmp/patches/100-debian-statistics.patch +++ b/net/net-snmp/patches/100-debian-statistics.patch @@ -1,3 +1,7 @@ +Description: Ignore interfaces without statistics +Author: Net-SNMP Packaging Team +Reviewed-by: Craig Small +Last-Update: 2023-08-19 --- a/agent/mibgroup/mibII/interfaces.c +++ b/agent/mibgroup/mibII/interfaces.c @@ -1586,6 +1586,10 @@ Interface_Scan_Init(void) diff --git a/net/net-snmp/patches/110-debian-makefiles.patch b/net/net-snmp/patches/110-debian-makefiles.patch index 2cb2715aa..5a8bb683d 100644 --- a/net/net-snmp/patches/110-debian-makefiles.patch +++ b/net/net-snmp/patches/110-debian-makefiles.patch @@ -1,3 +1,9 @@ +Description: Update Makefiles + Makefile patch to include libwrap and libsensors libraries and install + extra MIB files. +Author: Net-SNMP Packaging Team +Reviewed-by: Craig Small +Last-Update: 2021-09-20 --- a/local/Makefile.in +++ b/local/Makefile.in @@ -101,7 +101,7 @@ tkmib.made: $(srcdir)/tkmib diff --git a/net/net-snmp/patches/120-debian-searchdirs.patch b/net/net-snmp/patches/120-debian-searchdirs.patch index b5e377f96..e23fb633d 100644 --- a/net/net-snmp/patches/120-debian-searchdirs.patch +++ b/net/net-snmp/patches/120-debian-searchdirs.patch @@ -1,3 +1,9 @@ +From: Net-SNMP Packaging Team +Date: Thu, 18 Jun 2015 06:12:04 +0900 +Subject: _searchdirs + +Makefile patch to include libwrap and libsensors libraries and install extra +MIB files. --- a/local/mib2c +++ b/local/mib2c @@ -61,8 +61,9 @@ $currentlevel = -1; diff --git a/net/net-snmp/patches/130-debian-extramibs.patch b/net/net-snmp/patches/130-debian-extramibs.patch index 48fb90747..4aeae2a4f 100644 --- a/net/net-snmp/patches/130-debian-extramibs.patch +++ b/net/net-snmp/patches/130-debian-extramibs.patch @@ -1,3 +1,8 @@ +From: Net-SNMP Packaging Team +Date: Thu, 18 Jun 2015 06:12:04 +0900 +Subject: _extramibs + +Extra MIB files shipped with Debian. --- /dev/null +++ b/mibs/BGP4-MIB.txt @@ -0,0 +1,929 @@ diff --git a/net/net-snmp/patches/160-no_ldconfig.patch b/net/net-snmp/patches/160-no_ldconfig.patch index f6604dbe5..abf577faa 100644 --- a/net/net-snmp/patches/160-no_ldconfig.patch +++ b/net/net-snmp/patches/160-no_ldconfig.patch @@ -1,6 +1,6 @@ --- a/configure +++ b/configure -@@ -16599,7 +16599,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu +@@ -16860,7 +16860,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' diff --git a/net/net-snmp/patches/161-project_types.patch b/net/net-snmp/patches/161-project_types.patch deleted file mode 100644 index 0818f5dd4..000000000 --- a/net/net-snmp/patches/161-project_types.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/configure.d/config_project_types -+++ b/configure.d/config_project_types -@@ -66,7 +66,7 @@ netsnmp_save_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS -Werror" - - AC_MSG_CHECKING([for the type of fd_set::fds_bits]) --for type in __fd_mask __int32_t unknown; do -+for type in fd_mask int32_t size_t; do - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ - #include - #include diff --git a/net/net-snmp/patches/170-ldflags.patch b/net/net-snmp/patches/170-ldflags.patch index f9781d80d..bdf5a829f 100644 --- a/net/net-snmp/patches/170-ldflags.patch +++ b/net/net-snmp/patches/170-ldflags.patch @@ -1,8 +1,8 @@ --- a/Makefile.top +++ b/Makefile.top -@@ -87,7 +87,7 @@ LIBCURRENT = 42 - LIBAGE = 2 - LIBREVISION = 1 +@@ -87,7 +87,7 @@ LIBCURRENT = 45 + LIBAGE = 0 + LIBREVISION = 0 -LIB_LD_CMD = $(LIBTOOL) --mode=link $(LINKCC) $(CFLAGS) -rpath $(libdir) -version-info $(LIBCURRENT):$(LIBREVISION):$(LIBAGE) @LD_NO_UNDEFINED@ -o +LIB_LD_CMD = $(LIBTOOL) --mode=link $(LINKCC) $(CFLAGS) -rpath $(libdir) $(LDFLAGS) -version-info $(LIBCURRENT):$(LIBREVISION):$(LIBAGE) @LD_NO_UNDEFINED@ -o diff --git a/net/net-snmp/patches/200-add-pcre2-support.patch b/net/net-snmp/patches/200-add-pcre2-support.patch index c3f0cc61e..d41719a70 100644 --- a/net/net-snmp/patches/200-add-pcre2-support.patch +++ b/net/net-snmp/patches/200-add-pcre2-support.patch @@ -30,7 +30,7 @@ Subject: [PATCH] add pcre2 support #include #endif -@@ -100,32 +103,52 @@ swrun_max_processes( void ) +@@ -99,32 +102,52 @@ swrun_max_processes( void ) #endif /* NETSNMP_FEATURE_REMOVE_SWRUN_MAX_PROCESSES */ #ifndef NETSNMP_FEATURE_REMOVE_SWRUN_COUNT_PROCESSES_BY_REGEX @@ -100,7 +100,7 @@ Subject: [PATCH] add pcre2 support #include #elif defined(HAVE_REGEX_H) #include -@@ -824,7 +828,13 @@ int netsnmp_access_interface_max_reached +@@ -821,7 +825,13 @@ int netsnmp_access_interface_max_reached int netsnmp_access_interface_include(const char *name) { netsnmp_include_if_list *if_ptr; @@ -115,7 +115,7 @@ Subject: [PATCH] add pcre2 support int found_ndx[3]; #endif -@@ -840,7 +850,13 @@ int netsnmp_access_interface_include(con +@@ -837,7 +847,13 @@ int netsnmp_access_interface_include(con for (if_ptr = include_list; if_ptr; if_ptr = if_ptr->next) { @@ -130,7 +130,7 @@ Subject: [PATCH] add pcre2 support if (pcre_exec(if_ptr->regex_ptr, NULL, name, strlen(name), 0, 0, found_ndx, 3) >= 0) return TRUE; -@@ -853,6 +869,9 @@ int netsnmp_access_interface_include(con +@@ -850,6 +866,9 @@ int netsnmp_access_interface_include(con #endif } @@ -140,7 +140,7 @@ Subject: [PATCH] add pcre2 support return FALSE; } -@@ -964,7 +983,13 @@ _parse_include_if_config(const char *tok +@@ -961,7 +980,13 @@ _parse_include_if_config(const char *tok { netsnmp_include_if_list *if_ptr, *if_new; char *name, *st; @@ -155,7 +155,7 @@ Subject: [PATCH] add pcre2 support const char *pcre_error; int pcre_error_offset; #elif defined(HAVE_REGEX_H) -@@ -996,7 +1021,15 @@ _parse_include_if_config(const char *tok +@@ -993,7 +1018,15 @@ _parse_include_if_config(const char *tok config_perror("Out of memory"); goto err; } @@ -172,7 +172,7 @@ Subject: [PATCH] add pcre2 support if_new->regex_ptr = pcre_compile(if_new->name, 0, &pcre_error, &pcre_error_offset, NULL); if (!if_new->regex_ptr) { -@@ -1032,7 +1065,7 @@ _parse_include_if_config(const char *tok +@@ -1029,7 +1062,7 @@ _parse_include_if_config(const char *tok err: if (if_new) { @@ -181,7 +181,7 @@ Subject: [PATCH] add pcre2 support free(if_new->regex_ptr); #endif free(if_new->name); -@@ -1047,7 +1080,7 @@ _free_include_if_config(void) +@@ -1044,7 +1077,7 @@ _free_include_if_config(void) while (if_ptr) { if_next = if_ptr->next; @@ -307,7 +307,7 @@ Subject: [PATCH] add pcre2 support --- a/configure.d/config_os_libs1 +++ b/configure.d/config_os_libs1 -@@ -97,6 +97,32 @@ LIBS="$netsnmp_save_LIBS" +@@ -95,6 +95,32 @@ LIBS="$netsnmp_save_LIBS" # # regex in process table # @@ -340,14 +340,14 @@ Subject: [PATCH] add pcre2 support if test "x$with_pcre" != "xno"; then AC_CHECK_HEADER([pcre.h], [ AC_DEFINE([HAVE_PCRE_H], [1], [Define to 1 if you have .]) -@@ -123,3 +149,4 @@ if test "x$with_pcre" != "xno"; then - AC_SUBST(LAGENTLIBS) - AC_SUBST(LMIBLIBS) +@@ -194,3 +220,4 @@ if test "x$with_nl" != "xno"; then + ;; + esac fi +fi --- a/configure.d/config_project_with_enable +++ b/configure.d/config_project_with_enable -@@ -160,6 +160,10 @@ NETSNMP_ARG_WITH(rpm, +@@ -171,6 +171,10 @@ NETSNMP_ARG_WITH(rpm, management system when building the host MIB module.]) @@ -396,7 +396,7 @@ Subject: [PATCH] add pcre2 support --- a/include/net-snmp/types.h +++ b/include/net-snmp/types.h -@@ -63,7 +63,7 @@ typedef long ssize_t; +@@ -66,7 +66,7 @@ typedef long ssize_t; typedef unsigned long int nfds_t; #endif diff --git a/net/net-snmp/patches/201-Run-autoreconf.patch b/net/net-snmp/patches/201-Run-autoreconf.patch index 0417dff25..0a325244f 100644 --- a/net/net-snmp/patches/201-Run-autoreconf.patch +++ b/net/net-snmp/patches/201-Run-autoreconf.patch @@ -10,7 +10,7 @@ Subject: [PATCH] Run autoreconf --- a/configure +++ b/configure -@@ -928,6 +928,8 @@ with_dnssec +@@ -925,6 +925,8 @@ with_dnssec enable_dnssec with_rpm enable_rpm @@ -28,7 +28,7 @@ Subject: [PATCH] Run autoreconf --without-pcre Don't include pcre process searching support in the agent. --with-install-prefix=PATH Just for installing, prefix all -@@ -5259,6 +5263,21 @@ fi +@@ -5357,6 +5361,21 @@ fi @@ -50,7 +50,7 @@ Subject: [PATCH] Run autoreconf # Check whether --with-pcre was given. if test ${with_pcre+y} -@@ -26477,6 +26496,112 @@ LIBS="$netsnmp_save_LIBS" +@@ -27345,6 +27364,112 @@ LIBS="$netsnmp_save_LIBS" # # regex in process table # @@ -163,7 +163,7 @@ Subject: [PATCH] Run autoreconf if test "x$with_pcre" != "xno"; then ac_fn_c_check_header_compile "$LINENO" "pcre.h" "ac_cv_header_pcre_h" "$ac_includes_default" if test "x$ac_cv_header_pcre_h" = xyes -@@ -31486,6 +31611,7 @@ printf "%s\n" "#define pid_t $ac_pid_typ +@@ -36354,6 +36479,7 @@ printf "%s\n" "#define HAVE_STRUCT_UDPST fi @@ -173,7 +173,7 @@ Subject: [PATCH] Run autoreconf --- a/include/net-snmp/net-snmp-config.h.in +++ b/include/net-snmp/net-snmp-config.h.in -@@ -727,6 +727,9 @@ +@@ -788,6 +788,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_PCI_PCI_H diff --git a/net/net-snmp/patches/202-Improve-pcre2-support.patch b/net/net-snmp/patches/202-Improve-pcre2-support.patch index 067adcbfa..7220f8e1e 100644 --- a/net/net-snmp/patches/202-Improve-pcre2-support.patch +++ b/net/net-snmp/patches/202-Improve-pcre2-support.patch @@ -13,7 +13,7 @@ declarations occur before statements. --- a/agent/mibgroup/host/data_access/swrun.c +++ b/agent/mibgroup/host/data_access/swrun.c -@@ -111,10 +111,7 @@ swrun_count_processes_by_regex( char *na +@@ -110,10 +110,7 @@ swrun_count_processes_by_regex( char *na netsnmp_iterator *it; int i = 0; #ifdef HAVE_PCRE2_H @@ -25,7 +25,7 @@ declarations occur before statements. #elif defined(HAVE_PCRE_H) int found_ndx[30]; #endif -@@ -122,22 +119,20 @@ swrun_count_processes_by_regex( char *na +@@ -121,22 +118,20 @@ swrun_count_processes_by_regex( char *na char fullCommand[64 + 128 + 128 + 3]; netsnmp_cache_check_and_reload(swrun_cache); @@ -55,7 +55,7 @@ declarations occur before statements. #endif --- a/agent/mibgroup/if-mib/data_access/interface.c +++ b/agent/mibgroup/if-mib/data_access/interface.c -@@ -828,12 +828,8 @@ int netsnmp_access_interface_max_reached +@@ -825,12 +825,8 @@ int netsnmp_access_interface_max_reached int netsnmp_access_interface_include(const char *name) { netsnmp_include_if_list *if_ptr; @@ -70,7 +70,7 @@ declarations occur before statements. #elif defined(HAVE_PCRE_H) int found_ndx[3]; #endif -@@ -851,8 +847,8 @@ int netsnmp_access_interface_include(con +@@ -848,8 +844,8 @@ int netsnmp_access_interface_include(con for (if_ptr = include_list; if_ptr; if_ptr = if_ptr->next) { #if defined(HAVE_PCRE2_H) @@ -81,7 +81,7 @@ declarations occur before statements. pcre2_match_data_free(ndx_match); return TRUE; } -@@ -984,11 +980,13 @@ _parse_include_if_config(const char *tok +@@ -981,11 +977,13 @@ _parse_include_if_config(const char *tok netsnmp_include_if_list *if_ptr, *if_new; char *name, *st; #if defined(HAVE_PCRE2_H) @@ -99,7 +99,7 @@ declarations occur before statements. #elif defined(HAVE_PCRE_H) const char *pcre_error; int pcre_error_offset; -@@ -1022,10 +1020,14 @@ _parse_include_if_config(const char *tok +@@ -1019,10 +1017,14 @@ _parse_include_if_config(const char *tok goto err; } #if defined(HAVE_PCRE2_H) diff --git a/net/net-snmp/patches/203-if-mib-data_access-interface.c-plug-a-leak-with-pcre.patch b/net/net-snmp/patches/203-if-mib-data_access-interface.c-plug-a-leak-with-pcre.patch index 71b553b75..687c513d2 100644 --- a/net/net-snmp/patches/203-if-mib-data_access-interface.c-plug-a-leak-with-pcre.patch +++ b/net/net-snmp/patches/203-if-mib-data_access-interface.c-plug-a-leak-with-pcre.patch @@ -9,7 +9,7 @@ Subject: [PATCH] if-mib/data_access/interface.c: plug a leak with pcre2 --- a/agent/mibgroup/if-mib/data_access/interface.c +++ b/agent/mibgroup/if-mib/data_access/interface.c -@@ -829,7 +829,7 @@ int netsnmp_access_interface_include(con +@@ -826,7 +826,7 @@ int netsnmp_access_interface_include(con { netsnmp_include_if_list *if_ptr; #if defined(HAVE_PCRE2_H) @@ -18,7 +18,7 @@ Subject: [PATCH] if-mib/data_access/interface.c: plug a leak with pcre2 #elif defined(HAVE_PCRE_H) int found_ndx[3]; #endif -@@ -844,6 +844,9 @@ int netsnmp_access_interface_include(con +@@ -841,6 +841,9 @@ int netsnmp_access_interface_include(con */ return TRUE; diff --git a/net/net-snmp/patches/750-ieee802dot11.patch b/net/net-snmp/patches/750-ieee802dot11.patch index 7bee514eb..e08959c8b 100644 --- a/net/net-snmp/patches/750-ieee802dot11.patch +++ b/net/net-snmp/patches/750-ieee802dot11.patch @@ -346,14 +346,14 @@ +* * +****************************************************************************/ +unsigned char * -+var_ieee802dot11 ( struct variable *vp, -+ oid *name, -+ size_t *length, -+ int exact, -+ size_t *var_len, ++var_ieee802dot11 ( struct variable *vp, ++ oid *name, ++ size_t *length, ++ int exact, ++ size_t *var_len, + WriteMethod **write_method) +{ -+ loadTables(); ++ loadTables(); + + if ( header_generic ( vp, name, length, exact,var_len,write_method ) + == MATCH_FAILED ) @@ -396,11 +396,11 @@ + for ( np = LIST_FIRST ( &scList ); np != NULL; np = LIST_NEXT ( np, nodes )) { + sc = ( struct scTbl_data * ) np->data; + rName[vp->namelen] = sc->ifIndex; -+ if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) == 0 )) || ++ if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) == 0 )) || + ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) > 0 ))) { + + switch ( vp->magic ) { // found requested OID, now check for requested variable -+ case DOT11STATIONID: ++ case DOT11STATIONID: + if ( sc->haveStationID ) found = TRUE; break; + case DOT11MEDIUMOCCUPANCYLIMIT: + if ( sc->haveMediumOccupancyLimit ) found = TRUE; break; @@ -422,7 +422,7 @@ + if ( sc->haveDesiredBSSType ) found = TRUE; break; + case DOT11OPERATIONALRATESET: + if ( sc->haveOperationalRateSet ) found = TRUE; break; -+ case DOT11BEACONPERIOD: ++ case DOT11BEACONPERIOD: + if ( sc->haveBeaconPeriod ) found = TRUE; break; + case DOT11DTIMPERIOD: + if ( sc->haveDTIMPeriod ) found = TRUE; break; @@ -446,7 +446,7 @@ + break; + } + -+ if ( !found ) ++ if ( !found ) + return NULL; + + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid )); @@ -456,7 +456,7 @@ + + switch ( vp->magic ) { + -+ case DOT11STATIONID: ++ case DOT11STATIONID: +// *write_method = write_dot11StationID; + MACWork[ 0] = sc->stationID [ 0]; + MACWork[ 1] = sc->stationID [ 1]; @@ -515,7 +515,7 @@ + *var_len = strlen ( sc->operationalRateSet ); + return ( UCHAR * ) sc->operationalRateSet; + -+ case DOT11BEACONPERIOD: ++ case DOT11BEACONPERIOD: +// *write_method = write_dot11BeaconPeriod; + return ( UCHAR * ) &sc->beaconPeriod; + @@ -629,7 +629,7 @@ + break; + } + -+ if ( !found ) ++ if ( !found ) + return NULL; + + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid )); @@ -641,7 +641,7 @@ + + case DOT11AUTHENTICATIONALGORITHM: + return ( UCHAR * ) &aa->authenticationAlgorithm; -+ ++ + case DOT11AUTHENTICATIONALGORITHMSENABLE: +// *write_method = write_dot11AuthenticationAlgorithmsEnable; + return ( UCHAR * ) &aa->authenticationAlgorithmsEnable; @@ -680,13 +680,13 @@ + switch ( vp->magic ) { + case DOT11WEPDEFAULTKEYVALUE: + if ( df->haveWEPDefaultKeyValue ) found = TRUE; break; -+ } -+ } ++ } ++ } + if ( found ) + break; + } + -+ if ( !found ) ++ if ( !found ) + return NULL; + + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid )); @@ -741,14 +741,14 @@ + case DOT11WEPKEYMAPPINGVALUE: + if ( km->haveWEPKeyMappingValue ) found = TRUE; break; + case DOT11WEPKEYMAPPINGSTATUS: -+ if ( km->haveWEPKeyMappingStatus ) found = TRUE; break; ++ if ( km->haveWEPKeyMappingStatus ) found = TRUE; break; + } + } + if ( found ) + break; + } + -+ if ( !found ) ++ if ( !found ) + return NULL; + + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid )); @@ -831,13 +831,13 @@ + if ( pr->haveWEPICVErrorCount ) found = TRUE; break; + case DOT11WEPEXCLUDEDCOUNT: + if ( pr->haveWEPExcludedCount ) found = TRUE; break; -+ } ++ } + } + if ( found ) + break; + } + -+ if ( !found ) ++ if ( !found ) + return NULL; + + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid )); @@ -865,10 +865,10 @@ + + case DOT11WEPICVERRORCOUNT: + return ( UCHAR * ) &pr->WEPICVErrorCount; -+ ++ + case DOT11WEPEXCLUDEDCOUNT: + return ( UCHAR * ) &pr->WEPExcludedCount; -+ ++ + default: + ERROR_MSG ( "" ); + } @@ -902,17 +902,17 @@ + ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) > 0 ))) { + + switch ( vp->magic ) { // found requested OID, now check for requested variable -+ case DOT11MACADDRESS: ++ case DOT11MACADDRESS: + if ( op->haveMACAddress ) found = TRUE; break; -+ case DOT11RTSTHRESHOLD: ++ case DOT11RTSTHRESHOLD: + if ( op->haveRTSThreshold ) found = TRUE; break; -+ case DOT11SHORTRETRYLIMIT: ++ case DOT11SHORTRETRYLIMIT: + if ( op->haveShortRetryLimit ) found = TRUE; break; + case DOT11LONGRETRYLIMIT: + if ( op->haveLongRetryLimit ) found = TRUE; break; -+ case DOT11FRAGMENTATIONTHRESHOLD: ++ case DOT11FRAGMENTATIONTHRESHOLD: + if ( op->haveFragmentationThreshold ) found = TRUE; break; -+ case DOT11MAXTRANSMITMSDULIFETIME: ++ case DOT11MAXTRANSMITMSDULIFETIME: + if ( op->haveMaxTransmitMSDULifetime ) found = TRUE; break; + case DOT11MAXRECEIVELIFETIME: + if ( op->haveMaxReceiveLifetime ) found = TRUE; break; @@ -922,7 +922,7 @@ + if ( op->haveProductID ) found = TRUE; break; + } + } -+ if ( found ) ++ if ( found ) + break; + } + @@ -952,7 +952,7 @@ + MACWork[12] = '\0'; + *var_len = 6; + return ( UCHAR * ) htob ( MACWork ); -+ ++ + case DOT11RTSTHRESHOLD: +// *write_method = write_dot11RTSThreshold; + return ( UCHAR * ) &op->RTSThreshold; @@ -984,7 +984,7 @@ + case DOT11PRODUCTID: + *var_len = strlen ( op->productID ); + return ( UCHAR * ) op->productID; -+ ++ + default: + ERROR_MSG ( "" ); + } @@ -1050,7 +1050,7 @@ + break; + } + -+ if ( !found ) ++ if ( !found ) + return NULL; + + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid )); @@ -1074,7 +1074,7 @@ + case DOT11FCSERRORCOUNT: return ( UCHAR * ) &co->FCSErrorCount; + case DOT11TRANSMITTEDFRAMECOUNT: return ( UCHAR * ) &co->transmittedFrameCount; + case DOT11WEPUNDECRYPTABLECOUNT: return ( UCHAR * ) &co->WEPUndecryptableCount; -+ ++ + default: + ERROR_MSG ( "" ); + } @@ -1118,7 +1118,7 @@ + break; + } + -+ if ( !found ) ++ if ( !found ) + return NULL; + + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid )); @@ -1194,7 +1194,7 @@ + break; + } + -+ if ( !found ) ++ if ( !found ) + return NULL; + + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid )); @@ -1207,20 +1207,20 @@ + case DOT11MANUFACTUREROUI: + *var_len = strlen ( ri->manufacturerOUI ); + return ( UCHAR * ) ri->manufacturerOUI; -+ ++ + case DOT11MANUFACTURERNAME: + *var_len = strlen ( ri->manufacturerName ); + return ( UCHAR * ) ri->manufacturerName; -+ ++ + case DOT11MANUFACTURERPRODUCTNAME: + *var_len = strlen ( ri->manufacturerProductName ); + return ( UCHAR * ) ri->manufacturerProductName; -+ ++ + case DOT11MANUFACTURERPRODUCTVERSION: + *var_len = strlen ( ri->manufacturerProductVersion ); + return ( UCHAR * ) ri->manufacturerProductVersion; -+ -+ default: ++ ++ default: + ERROR_MSG ( "" ); + } + @@ -1263,7 +1263,7 @@ + break; + } + -+ if ( !found ) ++ if ( !found ) + return NULL; + + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid )); @@ -1275,14 +1275,14 @@ + + case DOT11PHYTYPE: + return ( UCHAR * ) &po->PHYType; -+ ++ + case DOT11CURRENTREGDOMAIN: +// *write_method = write_dot11CurrentRegDomain; + return ( UCHAR * ) &po->currentRegDomain; + + case DOT11TEMPTYPE: + return ( UCHAR * ) &po->tempType; -+ ++ + default: + ERROR_MSG ( "" ); + } @@ -1326,7 +1326,7 @@ + break; + } + -+ if ( !found ) ++ if ( !found ) + return NULL; + + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid )); @@ -1342,7 +1342,7 @@ + + case DOT11DIVERSITYSUPPORT: + return ( UCHAR * ) &pa->diversitySupport; -+ ++ + case DOT11CURRENTRXANTENNA: +// *write_method = write_dot11CurrentRxAntenna; + return ( UCHAR * ) &pa->currentRxAntenna; @@ -1403,7 +1403,7 @@ + break; + } + -+ if ( !found ) ++ if ( !found ) + return NULL; + + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid )); @@ -1413,7 +1413,7 @@ + + switch ( vp->magic ) { + -+ case DOT11NUMBERSUPPORTEDPOWERLEVELS: ++ case DOT11NUMBERSUPPORTEDPOWERLEVELS: + return ( UCHAR * ) &pt->numberSupportedPowerLevels; + + case DOT11TXPOWERLEVEL1: return ( UCHAR * ) &pt->TxPowerLevel1; @@ -1424,7 +1424,7 @@ + case DOT11TXPOWERLEVEL6: return ( UCHAR * ) &pt->TxPowerLevel6; + case DOT11TXPOWERLEVEL7: return ( UCHAR * ) &pt->TxPowerLevel7; + case DOT11TXPOWERLEVEL8: return ( UCHAR * ) &pt->TxPowerLevel8; -+ ++ + case DOT11CURRENTTXPOWERLEVEL: +// *write_method = write_dot11CurrentTxPowerLevel; + return ( UCHAR * ) &pt->currentTxPowerLevel; @@ -1480,7 +1480,7 @@ + break; + } + -+ if ( !found ) ++ if ( !found ) + return NULL; + + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid )); @@ -1492,14 +1492,14 @@ + + case DOT11HOPTIME: + return ( UCHAR * ) &pf->hopTime; -+ ++ + case DOT11CURRENTCHANNELNUMBER: +// *write_method = write_dot11CurrentChannelNumber; + return ( UCHAR * ) &pf->currentChannelNumber; + + case DOT11MAXDWELLTIME: + return ( UCHAR * ) &pf->maxDwellTime; -+ ++ + case DOT11CURRENTDWELLTIME: +// *write_method = write_dot11CurrentDwellTime; + return ( UCHAR * ) &pf->currentDwellTime; @@ -1561,7 +1561,7 @@ + break; + } + -+ if ( !found ) ++ if ( !found ) + return NULL; + + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid )); @@ -1577,7 +1577,7 @@ + + case DOT11CCAMODESUPPORTED: + return ( UCHAR * ) &pd->CCAModeSupported; -+ ++ + case DOT11CURRENTCCAMODE: +// *write_method = write_dot11CurrentCCAMode; + return ( UCHAR * ) &pd->currentCCAMode; @@ -1632,7 +1632,7 @@ + break; + } + -+ if ( !found ) ++ if ( !found ) + return NULL; + + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid )); @@ -1698,7 +1698,7 @@ + break; + } + -+ if ( !found ) ++ if ( !found ) + return NULL; + + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid )); @@ -1710,7 +1710,7 @@ + + case DOT11REGDOMAINSSUPPORTVALUE: + return ( UCHAR * ) &rd->regDomainsSupportValue; -+ ++ + default: + ERROR_MSG ( "" ); + } @@ -1755,7 +1755,7 @@ + break; + } + -+ if ( !found ) ++ if ( !found ) + return NULL; + + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid )); @@ -1817,7 +1817,7 @@ + break; + } + -+ if ( !found ) ++ if ( !found ) + return NULL; + + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid )); @@ -1829,7 +1829,7 @@ + + case DOT11SUPPORTEDDATARATESTXVALUE: + return ( UCHAR * ) &rt->supportedDataRatesTxValue; -+ ++ + default: + ERROR_MSG ( "" ); + } @@ -1870,7 +1870,7 @@ + break; + } + -+ if ( !found ) ++ if ( !found ) + return NULL; + + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid )); @@ -1882,7 +1882,7 @@ + + case DOT11SUPPORTEDDATARATESRXVALUE: + return ( UCHAR * ) &rr->supportedDataRatesRxValue; -+ ++ + default: + ERROR_MSG ( "" ); + } @@ -3964,7 +3964,7 @@ +* load80211Structs() - load the 802.11 structures * +* * +****************************************************************************/ -+static void ++static void +load80211Structs ( int skfd, char *ifName, struct wireless_info *wi ) +{ + int rc, ifIndex = 0; @@ -3975,9 +3975,9 @@ + rc = ioctl ( skfd, SIOCGIFHWADDR, &ifr ); + if ( rc >= 0 ) { + -+ sprintf ( MACAddress, "%02X:%02X:%02X:%02X:%02X:%02X", -+ ( UCHAR ) ifr.ifr_hwaddr.sa_data[0], ( UCHAR ) ifr.ifr_hwaddr.sa_data[1], -+ ( UCHAR ) ifr.ifr_hwaddr.sa_data[2], ( UCHAR ) ifr.ifr_hwaddr.sa_data[3], ++ sprintf ( MACAddress, "%02X:%02X:%02X:%02X:%02X:%02X", ++ ( UCHAR ) ifr.ifr_hwaddr.sa_data[0], ( UCHAR ) ifr.ifr_hwaddr.sa_data[1], ++ ( UCHAR ) ifr.ifr_hwaddr.sa_data[2], ( UCHAR ) ifr.ifr_hwaddr.sa_data[3], + ( UCHAR ) ifr.ifr_hwaddr.sa_data[4], ( UCHAR ) ifr.ifr_hwaddr.sa_data[5] ); + + nSc.haveStationID = TRUE; @@ -3985,11 +3985,11 @@ + nOp.haveMACAddress = TRUE; + strcpy ( nOp.MACAddress, MACAddress ); + nRi.haveManufacturerOUI = TRUE; -+ strncpy ( nRi.manufacturerOUI, MACAddress, MAN_OUI_LEN ); ++ strncpy ( nRi.manufacturerOUI, MACAddress, MAN_OUI_LEN ); + + ifIndex = if_nametoindex ( ifName ); + if ( !ifIndex ) { -+ syslog ( LOG_ERR, "SNMP %s - %s %s\n", ++ syslog ( LOG_ERR, "SNMP %s - %s %s\n", + "ieee802dot11.load80211Structs()", ifName, "has no ifIndex" ); + return; + } @@ -4074,7 +4074,7 @@ + } + } + -+//printf ( "%s - ifIndex: %ld ifName: %s UID: %s\n", ++//printf ( "%s - ifIndex: %ld ifName: %s UID: %s\n", +// "load80211Structs() - HASCHANGED", ifIndex, ifName, nSc.UID ); +} + @@ -4119,7 +4119,7 @@ +* loadWiExtTo80211Structs() - load wireless extensions to 802.11 structures * +* * +****************************************************************************/ -+static void ++static void +loadWiExtTo80211Structs ( int ifIndex, char *ifName, struct wireless_info *wi ) +{ + int i, j = 0; @@ -4132,19 +4132,19 @@ + if ( wi->has_power ) { + nSc.havePowerManagementMode = TRUE; + nSc.powerManagementMode = 1; // assume power is active -+ if ( !wi->power.disabled && ++ if ( !wi->power.disabled && + wi->power.flags & IW_POWER_MIN ) + nSc.powerManagementMode = 2; // power save mode + } + + if ( wi->has_essid && strlen ( wi->essid )) { + nSc.haveDesiredSSID = TRUE; -+ strcpy ( nSc.desiredSSID, wi->essid ); ++ strcpy ( nSc.desiredSSID, wi->essid ); + } + + if ( wi->has_mode ) { + nSc.haveDesiredBSSType = TRUE; -+ if ( wi->mode == IW_MODE_ADHOC ) ++ if ( wi->mode == IW_MODE_ADHOC ) + nSc.desiredBSSType = 2; // independent + else if ( wi->has_ap_addr ) + nSc.desiredBSSType = 1; // infrastructure @@ -4160,7 +4160,7 @@ + } + + // dot11AuthenticationAlgorithmsTable -+ nAa.haveAuthenticationAlgorithm = TRUE; // it's a rule to always have ++ nAa.haveAuthenticationAlgorithm = TRUE; // it's a rule to always have + nAa.haveAuthenticationAlgorithmsEnable = TRUE; // 'open' supported + nAa.ifIndex = ifIndex; + nAa.authenticationAlgorithmsIndex = 1; // index number one @@ -4234,7 +4234,7 @@ + // dot11PhyOperationTable + if ( strstr ( wi->name, "IEEE 802.11-FS" )) nPo.PHYType = 1; // So what if I + if ( strstr ( wi->name, "IEEE 802.11-DS" )) nPo.PHYType = 2; // made up a couple? -+ if ( strstr ( wi->name, "IEEE 802.11-IR" )) nPo.PHYType = 3; ++ if ( strstr ( wi->name, "IEEE 802.11-IR" )) nPo.PHYType = 3; + if ( strstr ( wi->name, "IEEE 802.11-OFDM" )) nPo.PHYType = 4; // 802.11a + if ( strstr ( wi->name, "IEEE 802.11-OFDM/DS" )) nPo.PHYType = 5; // 802.11g + if ( strstr ( wi->name, "IEEE 802.11-TURBO" )) nPo.PHYType = 6; // Atheros TURBO mode @@ -4245,7 +4245,7 @@ + for ( i = 0; i < wi->range.num_frequency; i++ ) { + if ((( double ) ( wi->range.freq[i].e * 10 ) * ( double ) wi->range.freq[i].m ) == wi->freq ) { + nPd.haveCurrentChannel = TRUE; -+ nPd.currentChannel = wi->range.freq[i].i; ++ nPd.currentChannel = wi->range.freq[i].i; + } + } + } @@ -4276,7 +4276,7 @@ + } + } + -+//printf ( "%s max_encoding_tokens: %d\n", ++//printf ( "%s max_encoding_tokens: %d\n", +// "loadWiExtTo80211Structs() - ", wi->range.max_encoding_tokens ); +} + @@ -4420,7 +4420,7 @@ + } + + /* Get retry limit/lifetime */ // #if WIRELESS_EXT > 10 -+ if ( ioctl ( skfd, SIOCGIWRETRY, &wrq ) >= 0 ) { ++ if ( ioctl ( skfd, SIOCGIWRETRY, &wrq ) >= 0 ) { + wi->has_retry = 1; + memcpy ( &wi->retry, &wrq.u.retry, sizeof ( iwparam )); + } @@ -4443,7 +4443,7 @@ + s = bfr; + s = strchr ( s, ':' ); s++; /* Skip ethX: */ + s = strtok ( s, " " ); /* ' ' => '\0' */ -+ sscanf ( s, "%hX", &wi->stats.status ); // status ++ sscanf ( s, "%hX", &wi->stats.status ); // status + + s = strtok ( NULL, " " ); // link quality + if ( strchr ( s, '.' ) != NULL ) @@ -4500,7 +4500,7 @@ + else + printf ( "%s %s\n", "SIOCGIWNICKN", " ===> no info.nickname support" ); + -+ if ( info.has_essid ) ++ if ( info.has_essid ) + printf ( "%s essid_on: %d essid: %s\n", "SIOCGIWESSID", info.essid_on, info.essid ); + else + printf ( "%s %s\n", "SIOCGIWESSID", " ===> no info.essid support" ); @@ -4511,7 +4511,7 @@ + printf ( "%s max_nwid: %d\n", "SIOCGIWRANGE", info.range.max_nwid ); + printf ( "%s sensitivity: %d\n", "SIOCGIWRANGE", info.range.sensitivity ); + printf ( "%s num_bitrates: %d\n", "SIOCGIWRANGE", info.range.num_bitrates ); -+ for ( i = 0; i < info.range.num_bitrates; i++ ) ++ for ( i = 0; i < info.range.num_bitrates; i++ ) + printf ( "%s bitrate[%d]: %d\n", "SIOCGIWRANGE", i, info.range.bitrate[i] ); + printf ( "%s min_rts: %d\n", "SIOCGIWRANGE", info.range.min_rts ); + printf ( "%s max_rts: %d\n", "SIOCGIWRANGE", info.range.max_rts ); @@ -4525,13 +4525,13 @@ + printf ( "%s pmt_flags: %d\n", "SIOCGIWRANGE", info.range.pmt_flags ); + printf ( "%s pm_capa: %d\n", "SIOCGIWRANGE", info.range.pm_capa ); + printf ( "%s num_encoding_sizes: %d\n", "SIOCGIWRANGE", info.range.num_encoding_sizes ); -+ for ( i = 0; i < info.range.num_encoding_sizes; i++ ) ++ for ( i = 0; i < info.range.num_encoding_sizes; i++ ) + printf ( "%s encoding_size[%d]: %d\n", "SIOCGIWRANGE", i, info.range.encoding_size[i] ); + printf ( "%s max_encoding_tokens: %d\n", "SIOCGIWRANGE", info.range.max_encoding_tokens ); +// printf ( "%s encoding_login_index: %d\n", "SIOCGIWRANGE", info.range.encoding_login_index ); + printf ( "%s txpower_capa: %d\n", "SIOCGIWRANGE", info.range.txpower_capa ); + printf ( "%s num_txpower: %d dBm\n", "SIOCGIWRANGE", info.range.num_txpower ); -+ for ( i = 0; i < info.range.num_txpower; i++ ) ++ for ( i = 0; i < info.range.num_txpower; i++ ) + printf ( "%s txpower[%d]: %d\n", "SIOCGIWRANGE", i, info.range.txpower[i] ); + printf ( "%s we_version_compiled: %d\n", "SIOCGIWRANGE", info.range.we_version_compiled ); + printf ( "%s we_version_source: %d\n", "SIOCGIWRANGE", info.range.we_version_source ); @@ -4544,14 +4544,14 @@ + printf ( "%s max_r_time: %d\n", "SIOCGIWRANGE", info.range.max_r_time ); + printf ( "%s num_channels: %d\n", "SIOCGIWRANGE", info.range.num_channels ); + printf ( "%s num_frequency: %d\n", "SIOCGIWRANGE", info.range.num_frequency ); -+ for ( i = 0; i < info.range.num_frequency; i++ ) -+ printf ( "%s freq[%d].i: %d freq[%d].e: %d freq[%d].m: %d\n", "SIOCGIWRANGE", ++ for ( i = 0; i < info.range.num_frequency; i++ ) ++ printf ( "%s freq[%d].i: %d freq[%d].e: %d freq[%d].m: %d\n", "SIOCGIWRANGE", + i, info.range.freq[i].i, i, info.range.freq[i].e, i, info.range.freq[i].m ); + } + else + printf ( "%s %s\n", "SIOCGIWRANGE", " ===> no info.range support" ); + -+ if ( info.has_nwid ) ++ if ( info.has_nwid ) + printf ( "%s nwid - disabled: %d value: %X\n", "SIOCGIWNWID", info.nwid.disabled, info.nwid.value ); + else + printf ( "%s %s\n", "SIOCGIWNWID", " ===> no info.nwid support" ); @@ -4569,7 +4569,7 @@ + printf ( "%s %s\n", "SIOCGIWSENS", " ===> no info.sens support" ); + + if ( info.has_key ) { -+ printf ( "%s key_size: %d key_flags: %d wepCurrentKey: %ld\n", ++ printf ( "%s key_size: %d key_flags: %d wepCurrentKey: %ld\n", + "SIOCGIWENCODE", info.key_size, info.key_flags, wepCurrentKey ); + printf ( "%s MODE: %d DISABLED: %d INDEX: %d OPEN: %d RESTRICTED: %d NOKEY: %d TEMP: %d\n", + "SIOCGIWENCODE", info.key_flags & IW_ENCODE_MODE, @@ -4582,22 +4582,22 @@ + + for ( i = 0; i < MAX_WEP_KEYS; i++ ) { + if ( wep[i].haveKey ) -+ printf ( "%s wep[%d].len: %ld wep[%d].key: %s\n", ++ printf ( "%s wep[%d].len: %ld wep[%d].key: %s\n", + "SIOCGIWENCODE", i, wep[i].len, i, wep[i].key ); + } + + if ( info.has_ap_addr ) -+ printf ( "%s ap_addr.sa_data: %02X:%02X:%02X:%02X:%02X:%02X ap_addr.sa_family: %d\n", -+ "SIOCGIWAP", ( UCHAR ) info.ap_addr.sa_data[0], ( UCHAR ) info.ap_addr.sa_data[1], -+ ( UCHAR ) info.ap_addr.sa_data[2], ( UCHAR ) info.ap_addr.sa_data[3], -+ ( UCHAR ) info.ap_addr.sa_data[4], ( UCHAR ) info.ap_addr.sa_data[5], ++ printf ( "%s ap_addr.sa_data: %02X:%02X:%02X:%02X:%02X:%02X ap_addr.sa_family: %d\n", ++ "SIOCGIWAP", ( UCHAR ) info.ap_addr.sa_data[0], ( UCHAR ) info.ap_addr.sa_data[1], ++ ( UCHAR ) info.ap_addr.sa_data[2], ( UCHAR ) info.ap_addr.sa_data[3], ++ ( UCHAR ) info.ap_addr.sa_data[4], ( UCHAR ) info.ap_addr.sa_data[5], + info.ap_addr.sa_family ); + else + printf ( "%s %s\n", "SIOCGIWAP", " ===> no ap_addr information" ); + + if ( info.has_bitrate ) -+ printf ( "%s bitrate: %" PRIdPTR " value: %d fixed: %d disabled: %d flags: %d\n", -+ "SIOCGIWRATE", *(intptr_t *)&info.bitrate, info.bitrate.value, info.bitrate.fixed, ++ printf ( "%s bitrate: %" PRIdPTR " value: %d fixed: %d disabled: %d flags: %d\n", ++ "SIOCGIWRATE", *(intptr_t *)&info.bitrate, info.bitrate.value, info.bitrate.fixed, + info.bitrate.disabled, info.bitrate.flags ); + else + printf ( "%s %s\n", "SIOCGIWRATE", " ===> no info.bitrate support" ); @@ -4612,7 +4612,7 @@ + else + printf ( "%s %s\n", "SIOCGIWFRAG", " ===> no info.frag support" ); + -+ if ( info.has_mode ) ++ if ( info.has_mode ) + printf ( "%s mode: %d\n", "SIOCGIWMODE", info.mode ); + else + printf ( "%s %s\n", "SIOCGIWMODE", " ===> no info.mode support" ); @@ -4621,18 +4621,18 @@ + printf ( "%s power: %" PRIdPTR "\n", "SIOCGIWPOWER", *(intptr_t *)&info.power ); + printf ( "%s disabled: %d MIN: %d MAX: %d TIMEOUT: %d RELATIVE: %d\n", + "SIOCGIWPOWER", -+ info.power.disabled ? 1:0, -+ info.power.flags & IW_POWER_MIN ? 1:0, -+ info.power.flags & IW_POWER_MAX ? 1:0, -+ info.power.flags & IW_POWER_TIMEOUT ? 1:0, -+ info.power.flags & IW_POWER_RELATIVE ? 1:0 ); ++ info.power.disabled ? 1:0, ++ info.power.flags & IW_POWER_MIN ? 1:0, ++ info.power.flags & IW_POWER_MAX ? 1:0, ++ info.power.flags & IW_POWER_TIMEOUT ? 1:0, ++ info.power.flags & IW_POWER_RELATIVE ? 1:0 ); + printf ( "%s UNICAST: %d MULTICAST: %d ALL: %d FORCE: %d REPEATER: %d\n", + "SIOCGIWPOWER", -+ info.power.flags & IW_POWER_UNICAST_R ? 1:0, -+ info.power.flags & IW_POWER_MULTICAST_R ? 1:0, -+ info.power.flags & IW_POWER_ALL_R ? 1:0, -+ info.power.flags & IW_POWER_FORCE_S ? 1:0, -+ info.power.flags & IW_POWER_REPEATER ? 1:0 ); ++ info.power.flags & IW_POWER_UNICAST_R ? 1:0, ++ info.power.flags & IW_POWER_MULTICAST_R ? 1:0, ++ info.power.flags & IW_POWER_ALL_R ? 1:0, ++ info.power.flags & IW_POWER_FORCE_S ? 1:0, ++ info.power.flags & IW_POWER_REPEATER ? 1:0 ); + } + else + printf ( "%s %s\n", "SIOCGIWPOWER", " ===> no info.power support" ); @@ -4659,12 +4659,12 @@ + printf ( "%s %s\n", "SIOCGIWSTATS", " ===> no info.stats support" ); + + if ( info.txpower.flags & IW_TXPOW_MWATT ) -+ printf ( "%s txpower1: %d dBm disabled: %d fixed: %d flags: %d\n", "SIOCGIWRANGE", ++ printf ( "%s txpower1: %d dBm disabled: %d fixed: %d flags: %d\n", "SIOCGIWRANGE", + mWatt2dbm ( info.txpower.value ), info.txpower.disabled, info.txpower.fixed, info.txpower.flags); + else + printf ( "%s txpower2: %d dBm disabled: %d fixed: %d flags: %d\n", "SIOCGIWRANGE", info.txpower.value, info.txpower.disabled, info.txpower.fixed, info.txpower.flags ); + -+ if ( info.has_range ) ++ if ( info.has_range ) + if ( info.sens.value < 0 ) + printf ( "%s sens: %d dBm\n", "SIOCGIWRANGE", info.sens.value ); + else @@ -4698,16 +4698,16 @@ +* addList() - add an entry to a linked list * +* * +****************************************************************************/ -+static void ++static void +addList ( char *l, char *data, int len ) +{ + char uid[256]; -+ avList_t *list; ++ avList_t *list; + -+ // NOTE: this assumes the UID is at the beginning of the ++ // NOTE: this assumes the UID is at the beginning of the + // data structure and that UIDs are strings -+ -+ list = ( avList_t * ) l; // NOTE: don't know how to get ++ ++ list = ( avList_t * ) l; // NOTE: don't know how to get + strcpy ( uid, data ); // rid of compiler warning on + // LISTHEAD typecast + // create a new node and the data that goes in it @@ -4790,8 +4790,8 @@ +static void flushList ( char *l ) +{ + avList_t *list; -+ -+ list = ( avList_t * ) l; // NOTE: don't know how to get ++ ++ list = ( avList_t * ) l; // NOTE: don't know how to get + while ( !LIST_EMPTY ( list )) { // rid of compiler warning on + np = LIST_FIRST ( list ); // LISTHEAD typecast + if ( np->data ) @@ -4956,7 +4956,7 @@ +/**************************************************************************** +* Linked List Defines * +****************************************************************************/ -+// here are some Linked List MACROS I wanted to use, ++// here are some Linked List MACROS I wanted to use, +// but curiously were not in /usr/includes/sys/queue.h + +#ifndef LIST_EMPTY @@ -5026,8 +5026,8 @@ +/**************************************************************************** +* Linked List Structure * +****************************************************************************/ -+struct avNode { -+ LIST_ENTRY ( avNode ) nodes; ++struct avNode { ++ LIST_ENTRY ( avNode ) nodes; + char *data; // pointer to data +}; + @@ -5574,7 +5574,7 @@ +/**************************************************************************** +* * +****************************************************************************/ -+config_require(util_funcs) ++config_require(util_funcs); + +/* function prototypes */ + @@ -5755,21 +5755,21 @@ +#error "Your kernel/libc combination is not supported" +#endif + -+#ifdef GENERIC_HEADERS ++#ifdef GENERIC_HEADERS +/* Proposed by Dr. Michael Rietz , 27.3.2 */ +/* If this works for all, it might be more stable on the long term - Jean II */ +#include /* For ARPHRD_ETHER */ +#include /* For AF_INET & struct sockaddr */ +#include /* For struct sockaddr_in */ +#include -+#endif /* GENERIC_HEADERS */ ++#endif /* GENERIC_HEADERS */ + -+#ifdef GLIBC22_HEADERS ++#ifdef GLIBC22_HEADERS +/* Added by Ross G. Miller , 3/28/01 */ +#include /* For ARPHRD_ETHER */ +#include /* For AF_INET & struct sockaddr */ +#include -+#endif /* GLIBC22_HEADERS */ ++#endif /* GLIBC22_HEADERS */ + +#ifdef KLUDGE_HEADERS +#include @@ -6165,3 +6165,13 @@ +#endif + +#endif /* IWLIB_H */ +--- a/agent/mib_modules.c ++++ b/agent/mib_modules.c +@@ -42,6 +42,7 @@ + #include + #include + #include "mib_module_includes.h" ++#include "mibgroup/ieee802dot11.h" + + static int need_shutdown = 0; + diff --git a/net/net-snmp/patches/751-gcc-14-fix.patch b/net/net-snmp/patches/751-gcc-14-fix.patch deleted file mode 100644 index a217bb708..000000000 --- a/net/net-snmp/patches/751-gcc-14-fix.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/agent/mib_modules.c -+++ b/agent/mib_modules.c -@@ -42,6 +42,7 @@ - #include - #include - #include "mib_module_includes.h" -+#include "mibgroup/ieee802dot11.h" - - static int need_shutdown = 0; - diff --git a/net/net-snmp/patches/900-musl-compat.patch b/net/net-snmp/patches/900-musl-compat.patch deleted file mode 100644 index c4234dd21..000000000 --- a/net/net-snmp/patches/900-musl-compat.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/agent/mibgroup/iwlib.h -+++ b/agent/mibgroup/iwlib.h -@@ -92,6 +92,10 @@ - #elif !defined(__GLIBC__) && LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0) - #define GENERIC_HEADERS - -+/* Musl */ -+#elif !defined(__GLIBC__) && LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0) -+#define GENERIC_HEADERS -+ - /* Unsupported combination */ - #else - #error "Your kernel/libc combination is not supported" diff --git a/net/net-snmp/patches/990-remove-semicolon-check-in-macros.patch b/net/net-snmp/patches/990-remove-semicolon-check-in-macros.patch deleted file mode 100644 index 0abe74392..000000000 --- a/net/net-snmp/patches/990-remove-semicolon-check-in-macros.patch +++ /dev/null @@ -1,130 +0,0 @@ ---- a/configure.d/config_modules_agent -+++ b/configure.d/config_modules_agent -@@ -27,8 +27,6 @@ done - # - AC_MSG_CHECKING([for and configuring mib modules to use]) - --AH_TOP([#define NETSNMP_REQUIRE_SEMICOLON extern void netsnmp_unused_function(void)]) -- - # set up the CPP command - MODULECPP="$CPP $PARTIALTARGETFLAGS $CPPFLAGS -DNETSNMP_FEATURE_CHECKING -I${srcdir}/include -I${srcdir}/agent/mibgroup" - if test "x$enable_mfd_rewrites" = "xyes"; then -@@ -194,7 +192,7 @@ while test "x$new_module_list" != "x"; d - # - mib_module => libnetsnmpmibs (default) - # - agent_module => libnetsnmpagent - # -- AH_TOP([#define config_belongs_in(x) NETSNMP_REQUIRE_SEMICOLON]) -+ AH_TOP([#define config_belongs_in(x)]) - module_type=mib_module - if test -f $srcdir/$mibdir/$i.h; then - changequote(, ) -@@ -279,7 +277,7 @@ while test "x$new_module_list" != "x"; d - # - # check if $i has any conflicts - # -- AH_TOP([#define config_exclude(x) NETSNMP_REQUIRE_SEMICOLON]) -+ AH_TOP([#define config_exclude(x)]) - new_list_excl=`$MODULECPP module_tmp_header.h | \ - $SED -n 's/.*config_exclude(\(.*\)).*/\1/p'` - if test "x$new_list_excl" != "x"; then -@@ -308,7 +306,7 @@ while test "x$new_module_list" != "x"; d - # - # check if $i has any architecture specific requirements - # -- AH_TOP([#define config_arch_require(x,y) NETSNMP_REQUIRE_SEMICOLON]) -+ AH_TOP([#define config_arch_require(x,y)]) - changequote(, ) - new_list_arch=`$MODULECPP module_tmp_header.h | \ - $SED -n 's/.*config_arch_require( *\([^ ]*\) *, *\([^ ]*\) *).*/\1-xarchx-\2/p'` -@@ -330,7 +328,7 @@ while test "x$new_module_list" != "x"; d - # macro: config_version_require((base, version, version-modules, ...)) - # - lists alternative modules used from different versions. - # -- AH_TOP([#define config_version_require(x) NETSNMP_REQUIRE_SEMICOLON]) -+ AH_TOP([#define config_version_require(x)]) - [new_list_alt3=`$MODULECPP module_tmp_header.h | \ - $AWK ' - BEGIN { -@@ -372,7 +370,7 @@ while test "x$new_module_list" != "x"; d - # - # check if $i has any other required modules - # -- AH_TOP([#define config_require(x) NETSNMP_REQUIRE_SEMICOLON]) -+ AH_TOP([#define config_require(x)]) - new_list="$new_list `$MODULECPP module_tmp_header.h | \ - $SED -n 's/.*config_require(\(.*\)).*/\1/p'`" - AC_MSG_MODULE_DBG(" $i will test: $new_list") -@@ -409,7 +407,7 @@ while test "x$new_module_list" != "x"; d - # - # check if $i has any mibs to add - # -- AH_TOP([#define config_add_mib(x) NETSNMP_REQUIRE_SEMICOLON]) -+ AH_TOP([#define config_add_mib(x)]) - new_mibs=`$MODULECPP module_tmp_header.h | \ - $SED -n 's/.*config_add_mib(\(.*\)).*/\1/p'` - if test "x$new_mibs" != "x"; then -@@ -456,7 +454,7 @@ while test "x$new_module_list" != "x"; d - # check for config_parse_dot_conf - # (generally not used any longer; old auto-load a .conf token) - # -- AH_TOP([#define config_parse_dot_conf(w,x,y,z) NETSNMP_REQUIRE_SEMICOLON]) -+ AH_TOP([#define config_parse_dot_conf(w,x,y,z)]) - changequote(, ) - $MODULECPP module_tmp_header.h | \ - $SED -n 's@.*config_parse_dot_conf(\([^)]*\), *\([^),]*\), *\([^),]*\), *\([^),]*\)).*@register_config_handler("snmpd",\1, \2, \3, \4);@p' >> $mibdir/mib_module_dot_conf.h -@@ -468,7 +466,7 @@ while test "x$new_module_list" != "x"; d - # - # check if $i has any errors, or warnings - # -- AH_TOP([#define config_error(x) NETSNMP_REQUIRE_SEMICOLON]) -+ AH_TOP([#define config_error(x)]) - error=`$MODULECPP module_tmp_header.h | \ - $SED -n 's/.*config_error(\(.*\)).*/\1/p'` - if test "x$error" != "x"; then -@@ -481,7 +479,7 @@ while test "x$new_module_list" != "x"; d - # macro: config_warning(warning text) - # - used to signal a configuration "warning" to be printed to the user - # -- AH_TOP([#define config_warning(x) NETSNMP_REQUIRE_SEMICOLON]) -+ AH_TOP([#define config_warning(x)]) - warning=`$MODULECPP module_tmp_header.h | \ - $SED -n 's/.*config_warning(\(.*\)).*/\1/p'` - if test "x$warning" != "x"; then ---- a/include/net-snmp/net-snmp-config.h.in -+++ b/include/net-snmp/net-snmp-config.h.in -@@ -36,25 +36,25 @@ - - /* definitions added by configure on-the-fly */ - --#define config_parse_dot_conf(w,x,y,z) NETSNMP_REQUIRE_SEMICOLON -+#define config_parse_dot_conf(w,x,y,z) - --#define config_error(x) NETSNMP_REQUIRE_SEMICOLON -+#define config_error(x) - --#define config_warning(x) NETSNMP_REQUIRE_SEMICOLON -+#define config_warning(x) - --#define NETSNMP_REQUIRE_SEMICOLON extern void netsnmp_unused_function(void) -+#define extern void netsnmp_unused_function(void) - --#define config_belongs_in(x) NETSNMP_REQUIRE_SEMICOLON -+#define config_belongs_in(x) - --#define config_exclude(x) NETSNMP_REQUIRE_SEMICOLON -+#define config_exclude(x) - --#define config_arch_require(x,y) NETSNMP_REQUIRE_SEMICOLON -+#define config_arch_require(x,y) - --#define config_version_require(x) NETSNMP_REQUIRE_SEMICOLON -+#define config_version_require(x) - --#define config_require(x) NETSNMP_REQUIRE_SEMICOLON -+#define config_require(x) - --#define config_add_mib(x) NETSNMP_REQUIRE_SEMICOLON -+#define config_add_mib(x) - - /* Define to 1 if using 'alloca.c'. */ - #undef C_ALLOCA