net-snmp: import from oldpackages, add myself as maintainer, add license information, update to v5.4.4, refresh patches

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
This commit is contained in:
Jo-Philipp Wich
2014-07-02 14:04:57 +02:00
parent 1971a1d567
commit 7c00700f58
12 changed files with 13037 additions and 0 deletions
@@ -0,0 +1,22 @@
--- a/agent/mibgroup/mibII/interfaces.c
+++ b/agent/mibgroup/mibII/interfaces.c
@@ -1561,6 +1561,10 @@ Interface_Scan_Init(void)
struct ifnet *nnew;
char *stats, *ifstart = line;
+ /* Ignore interfaces with no statistics. */
+ if (strstr(line, "No statistics available."))
+ continue;
+
if (line[strlen(line) - 1] == '\n')
line[strlen(line) - 1] = '\0';
@@ -1594,7 +1598,7 @@ Interface_Scan_Init(void)
&coll) != 5)) {
if ((scan_line_to_use == scan_line_2_2)
&& !strstr(line, "No statistics available"))
- snmp_log(LOG_ERR,
+ snmp_log(LOG_DEBUG,
"/proc/net/dev data format error, line ==|%s|",
line);
continue;
@@ -0,0 +1,40 @@
--- a/local/Makefile.in
+++ b/local/Makefile.in
@@ -100,7 +100,7 @@ tkmib.made: $(srcdir)/tkmib
mib2c.made: $(srcdir)/mib2c
if test "x$(PERL)" != "x" ; then \
- $(PERL) -p -e 's%^#!.*/perl.*%#!$(PERL)%;s#/usr/local/share/snmp#$(snmplibdir)#;' ${srcdir}/mib2c > mib2c.made; \
+ $(PERL) -p -e 's%^#!.*/perl.*%#!$(PERL)%;s#/usr/local/share/snmp#$(snmplibdir)#;s#/usr/local/etc/snmp#$(SNMPCONFPATH)#;' ${srcdir}/mib2c > mib2c.made; \
else \
touch mib2c.made; \
fi
--- a/mibs/Makefile.in
+++ b/mibs/Makefile.in
@@ -48,11 +48,15 @@ NETSNMPMIBS = NET-SNMP-TC.txt NET-SNMP-M
UCDMIBS = UCD-SNMP-MIB.txt UCD-DEMO-MIB.txt UCD-IPFWACC-MIB.txt \
UCD-DLMOD-MIB.txt UCD-DISKIO-MIB.txt
+EXTRAMIBS = BGP4-MIB.txt BRIDGE-MIB.txt GNOME-SMI.txt OSPF-MIB.txt \
+ OSPF-TRAP-MIB.txt RIPv2-MIB.txt SOURCE-ROUTING-MIB.txt \
+ LM-SENSORS-MIB.txt
+
DEFAULTMIBS = @default_mibs_install@
MIBS = $(V1MIBS) $(V2MIBS) $(V3MIBS) $(RFCMIBS) \
$(AGENTMIBS) $(IANAMIBS) \
- $(NETSNMPMIBS) $(UCDMIBS) $(DEFAULTMIBS)
+ $(NETSNMPMIBS) $(UCDMIBS) $(DEFAULTMIBS) $(EXTRAMIBS)
all: standardall
--- a/Makefile.top
+++ b/Makefile.top
@@ -26,6 +26,7 @@ man8dir = $(mandir)/man8
snmplibdir = $(datadir)/snmp
mibdir = $(snmplibdir)/mibs
persistentdir = @PERSISTENT_DIRECTORY@
+sysconfdir = @sysconfdir@
DESTDIR = @INSTALL_PREFIX@
INSTALL_PREFIX = $(DESTDIR)
@@ -0,0 +1,14 @@
--- a/local/mib2c
+++ b/local/mib2c
@@ -60,8 +60,9 @@ $currentlevel = -1;
if($ENV{MIB2C_DIR}) {
push @def_search_dirs, split(/:/, $ENV{MIB2C_DIR});
}
-push @def_search_dirs, "/usr/local/share/snmp/";
-push @def_search_dirs, "/usr/local/share/snmp/mib2c-data";
+push @def_search_dirs, "/etc/snmp/";
+push @def_search_dirs, "/usr/share/snmp/";
+push @def_search_dirs, "/usr/share/snmp/mib2c-data";
push @def_search_dirs, "./mib2c-conf.d";
sub usage {
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,11 @@
--- a/configure
+++ b/configure
@@ -10216,7 +10216,7 @@ linux* | k*bsd*-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'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ finish_cmds=''
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
# This implies no fast_install, which is unacceptable.
+11
View File
@@ -0,0 +1,11 @@
--- a/Makefile.top
+++ b/Makefile.top
@@ -81,7 +81,7 @@ LIBCURRENT = 16
LIBAGE = 1
LIBREVISION = 3
-LIB_LD_CMD = $(LIBTOOL) --mode=link $(LINKCC) $(CFLAGS) -rpath $(libdir) -version-info $(LIBCURRENT):$(LIBREVISION):$(LIBAGE) -o
+LIB_LD_CMD = $(LIBTOOL) --mode=link $(LINKCC) $(CFLAGS) -rpath $(libdir) $(LDFLAGS) -version-info $(LIBCURRENT):$(LIBREVISION):$(LIBAGE) -o
LIB_EXTENSION = la
LIB_VERSION =
LIB_LDCONFIG_CMD = $(LIBTOOL) --mode=finish $(libdir)
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,29 @@
--- a/agent/mibgroup/host/hr_filesys.c
+++ b/agent/mibgroup/host/hr_filesys.c
@@ -322,13 +322,13 @@ var_hrfilesys(struct variable *vp,
long_return = fsys_idx;
return (u_char *) & long_return;
case HRFSYS_MOUNT:
- snprintf(string, sizeof(string), HRFS_entry->HRFS_mount);
+ snprintf(string, sizeof(string), "%s", HRFS_entry->HRFS_mount);
string[ sizeof(string)-1 ] = 0;
*var_len = strlen(string);
return (u_char *) string;
case HRFSYS_RMOUNT:
if (Check_HR_FileSys_NFS()) {
- snprintf(string, sizeof(string), HRFS_entry->HRFS_name);
+ snprintf(string, sizeof(string), "%s", HRFS_entry->HRFS_name);
string[ sizeof(string)-1 ] = 0;
} else
string[0] = '\0';
--- a/agent/mibgroup/ucd-snmp/extensible.c
+++ b/agent/mibgroup/ucd-snmp/extensible.c
@@ -513,7 +513,7 @@ fixExecError(int action,
}
tmp = *((long *) var_val);
if ((tmp == 1) && (action == COMMIT) && (exten->fixcmd[0] != 0)) {
- sprintf(ex.command, exten->fixcmd);
+ sprintf(ex.command, "%s", exten->fixcmd);
if ((fd = get_exec_output(&ex)) != -1) {
file = fdopen(fd, "r");
while (fgets(ex.output, sizeof(ex.output), file) != NULL);