diff options
author | Stijn Tintel <stijn@linux-ipv6.be> | 2020-09-26 04:11:05 +0300 |
---|---|---|
committer | Stijn Tintel <stijn@linux-ipv6.be> | 2021-03-17 21:53:10 +0200 |
commit | 4cdbe799b1722443f8aeeb3de32d00c964c6a2a9 (patch) | |
tree | aec21f23674030702851845e38e7e9b81e6becd2 /net/net-snmp/patches | |
parent | 6024474329d99d31cd43b41c3b519786908914f5 (diff) |
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>
Diffstat (limited to 'net/net-snmp/patches')
-rw-r--r-- | net/net-snmp/patches/000-cross-compile.patch | 4 | ||||
-rw-r--r-- | net/net-snmp/patches/010-HOST-MIB-hr_filesys-fix-compile-error.patch | 34 | ||||
-rw-r--r-- | net/net-snmp/patches/100-debian-statistics.patch | 4 | ||||
-rw-r--r-- | net/net-snmp/patches/160-no_ldconfig.patch | 6 | ||||
-rw-r--r-- | net/net-snmp/patches/170-ldflags.patch | 2 | ||||
-rw-r--r-- | net/net-snmp/patches/910-signal.patch | 143 |
6 files changed, 42 insertions, 151 deletions
diff --git a/net/net-snmp/patches/000-cross-compile.patch b/net/net-snmp/patches/000-cross-compile.patch index 730bdbcfc..efacdfb3e 100644 --- a/net/net-snmp/patches/000-cross-compile.patch +++ b/net/net-snmp/patches/000-cross-compile.patch @@ -15,7 +15,7 @@ link tests to fail due to a stray "no" word getting passed to the linker. Signed-off-by: Jo-Philipp Wich <jo@mein.io> --- a/configure.d/config_os_libs2 +++ b/configure.d/config_os_libs2 -@@ -254,14 +254,22 @@ if test "x$with_nl" != "xno"; then +@@ -247,14 +247,22 @@ if test "x$with_nl" != "xno"; then ) netsnmp_save_CPPFLAGS="$CPPFLAGS" @@ -23,7 +23,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io> - NETSNMP_SEARCH_LIBS(nl_connect, nl-3, - [AC_CHECK_HEADERS(netlink/netlink.h) - EXTERNAL_MIBGROUP_INCLUDES="$EXTERNAL_MIBGROUP_INCLUDES ${LIBNL3_CFLAGS}"], -- [CPPFLAGS="$netsnmp_save_CPPFLAGS"], [], [], [LMIBLIBS]) +- [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, [ 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 new file mode 100644 index 000000000..2b372a41f --- /dev/null +++ b/net/net-snmp/patches/010-HOST-MIB-hr_filesys-fix-compile-error.patch @@ -0,0 +1,34 @@ +From 9588b5c9c27239b1f8c02f0bf417f13735e93225 Mon Sep 17 00:00:00 2001 +From: Stijn Tintel <stijn@linux-ipv6.be> +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 <stijn@linux-ipv6.be> +--- + 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: ; + #if 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 2b24d9443..1af3a546c 100644 --- a/net/net-snmp/patches/100-debian-statistics.patch +++ b/net/net-snmp/patches/100-debian-statistics.patch @@ -1,6 +1,6 @@ --- a/agent/mibgroup/mibII/interfaces.c +++ b/agent/mibgroup/mibII/interfaces.c -@@ -1588,6 +1588,10 @@ Interface_Scan_Init(void) +@@ -1579,6 +1579,10 @@ Interface_Scan_Init(void) struct ifnet *nnew; char *stats, *ifstart = line; @@ -11,7 +11,7 @@ if (line[strlen(line) - 1] == '\n') line[strlen(line) - 1] = '\0'; -@@ -1620,7 +1624,7 @@ Interface_Scan_Init(void) +@@ -1611,7 +1615,7 @@ Interface_Scan_Init(void) &coll) != 5)) { if ((scan_line_to_use == scan_line_2_2) && !strstr(line, "No statistics available")) diff --git a/net/net-snmp/patches/160-no_ldconfig.patch b/net/net-snmp/patches/160-no_ldconfig.patch index d9de73e0d..786c34312 100644 --- a/net/net-snmp/patches/160-no_ldconfig.patch +++ b/net/net-snmp/patches/160-no_ldconfig.patch @@ -1,9 +1,9 @@ --- a/configure +++ b/configure -@@ -15097,7 +15097,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu) +@@ -15602,7 +15602,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' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + finish_cmds='' shlibpath_var=LD_LIBRARY_PATH diff --git a/net/net-snmp/patches/170-ldflags.patch b/net/net-snmp/patches/170-ldflags.patch index dd1b9fe25..b67b24631 100644 --- a/net/net-snmp/patches/170-ldflags.patch +++ b/net/net-snmp/patches/170-ldflags.patch @@ -1,6 +1,6 @@ --- a/Makefile.top +++ b/Makefile.top -@@ -87,7 +87,7 @@ LIBCURRENT = 35 +@@ -87,7 +87,7 @@ LIBCURRENT = 40 LIBAGE = 0 LIBREVISION = 0 diff --git a/net/net-snmp/patches/910-signal.patch b/net/net-snmp/patches/910-signal.patch deleted file mode 100644 index 45cd1fac2..000000000 --- a/net/net-snmp/patches/910-signal.patch +++ /dev/null @@ -1,143 +0,0 @@ -From 1ee70571e0cae37f155f59d4382bc7109138cf09 Mon Sep 17 00:00:00 2001 -From: Bart Van Assche <bvanassche@acm.org> -Date: Sat, 15 Aug 2020 17:29:25 -0700 -Subject: [PATCH] apps/snmpnetstat: Stop using obsolete signal functions - -This was reported by Rosen Penev. See also -https://github.com/net-snmp/net-snmp/pull/162. ---- - apps/snmpnetstat/if.c | 111 +++++++++++------------------------------- - 1 file changed, 28 insertions(+), 83 deletions(-) - mode change 100644 => 100755 apps/snmpnetstat/if.c - ---- a/apps/snmpnetstat/if.c -+++ b/apps/snmpnetstat/if.c -@@ -64,8 +64,6 @@ static char *rcsid = "$OpenBSD: if.c,v 1 - #define NO 0 - - static void sidewaysintpr(u_int); --static void timerSet(int interval_seconds); --static void timerPause(void); - - struct _if_info { - char name[128]; -@@ -92,6 +90,34 @@ static void timerPause(void); - }; - - -+static struct timeval deadline; -+ -+static void -+timerSet(int interval_seconds) -+{ -+ const struct timeval interval = { interval_seconds, 0 }; -+ -+ netsnmp_get_monotonic_clock(&deadline); -+ NETSNMP_TIMERADD(&deadline, &interval, &deadline); -+} -+ -+static void -+timerPause(void) -+{ -+ struct timeval now, delta; -+ -+ netsnmp_get_monotonic_clock(&now); -+ NETSNMP_TIMERSUB(&deadline, &now, &delta); -+ if (delta.tv_sec < 0) -+ return; -+#ifdef WIN32 -+ Sleep(delta.tv_sec * 1000 + delta.tv_usec / 1000); -+#else -+ if (select(0, NULL, NULL, NULL, &delta) < 0) -+ snmp_perror("select"); -+#endif -+} -+ - /* - * Retrieve the interface addressing information - * XXX - This could also be extended to handle non-IP interfaces -@@ -845,84 +871,3 @@ loop: - goto loop; - /*NOTREACHED*/ - } -- -- --/* -- * timerSet sets or resets the timer to fire in "interval" seconds. -- * timerPause waits only if the timer has not fired. -- * timing precision is not considered important. -- */ -- --#if (defined(WIN32) || defined(cygwin)) --static int sav_int; --static time_t timezup; --static void --timerSet(int interval_seconds) --{ -- sav_int = interval_seconds; -- timezup = time(0) + interval_seconds; --} -- --/* -- * you can do better than this ! -- */ --static void --timerPause(void) --{ -- time_t now; -- while (time(&now) < timezup) --#ifdef WIN32 -- Sleep(400); --#else -- { -- struct timeval tx; -- tx.tv_sec = 0; -- tx.tv_usec = 400 * 1000; /* 400 milliseconds */ -- select(0, 0, 0, 0, &tx); -- } --#endif --} -- --#else -- --/* -- * Called if an interval expires before sidewaysintpr has completed a loop. -- * Sets a flag to not wait for the alarm. -- */ --RETSIGTYPE --catchalarm(int sig) --{ -- signalled = YES; --} -- --static void --timerSet(int interval_seconds) --{ --#ifdef HAVE_SIGSET -- (void) sigset(SIGALRM, catchalarm); --#else -- (void) signal(SIGALRM, catchalarm); --#endif -- signalled = NO; -- (void) alarm(interval_seconds); --} -- --static void --timerPause(void) --{ --#ifdef HAVE_SIGHOLD -- sighold(SIGALRM); -- if (!signalled) { -- sigpause(SIGALRM); -- } --#else -- int oldmask; -- oldmask = sigblock(sigmask(SIGALRM)); -- if (!signalled) { -- sigpause(0); -- } -- sigsetmask(oldmask); --#endif --} -- --#endif /* !WIN32 && !cygwin */ |