Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SNMP] fix issue #1874, ERR snmpd[34]: Error allocating more space for arpcache. Cache will continue to be limited to 4096 entries #1989

Merged
merged 1 commit into from
Sep 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/snmpd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
dpkg-source -x net-snmp_$(SNMPD_VERSION_FULL).dsc

pushd net-snmp-$(SNMPD_VERSION)
patch -p0 < ../statfs_error.patch
git init
qiluo-msft marked this conversation as resolved.
Show resolved Hide resolved
git add -f *
git commit -m "unmodified snmpd source"

# Apply patches
stg init
stg import -s ../patch-$(SNMPD_VERSION)/series

fakeroot debian/rules -j$(SONIC_CONFIG_MAKE_JOBS) binary
popd

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
From a1edbce39e46b5c8bd5bd7db17fc11fa30e7dd73 Mon Sep 17 00:00:00 2001
From: pavel-shirshov <[email protected]>
Date: Mon, 27 Aug 2018 16:50:16 +0800
Subject: [PATCH] [SNMP] Stop spamming logs with statfs permission denied log
message #1668

---
agent/mibgroup/hardware/fsys/fsys_mntctl.c | 2 --
agent/mibgroup/hardware/fsys/fsys_mntent.c | 2 --
2 files changed, 4 deletions(-)

diff --git a/agent/mibgroup/hardware/fsys/fsys_mntctl.c b/agent/mibgroup/hardware/fsys/fsys_mntctl.c
index 9fbb068..adc38d6 100644
--- a/agent/mibgroup/hardware/fsys/fsys_mntctl.c
+++ b/agent/mibgroup/hardware/fsys/fsys_mntctl.c
@@ -163,8 +163,6 @@ netsnmp_fsys_arch_load( void )
continue;

if ( statfs( entry->path, &stat_buf ) < 0 ) {
- snprintf( tmpbuf, sizeof(tmpbuf), "Cannot statfs %s", entry->path );
- snmp_log_perror( tmpbuf );
continue;
}
entry->units = stat_buf.f_bsize;
diff --git a/agent/mibgroup/hardware/fsys/fsys_mntent.c b/agent/mibgroup/hardware/fsys/fsys_mntent.c
index 94d23db..5ad5e43 100644
--- a/agent/mibgroup/hardware/fsys/fsys_mntent.c
+++ b/agent/mibgroup/hardware/fsys/fsys_mntent.c
@@ -238,8 +238,6 @@ netsnmp_fsys_arch_load( void )
if ( NSFS_STATFS( entry->path, &stat_buf ) < 0 )
#endif
{
- snprintf( tmpbuf, sizeof(tmpbuf), "Cannot statfs %s", entry->path );
- snmp_log_perror( tmpbuf );
continue;
}
entry->units = stat_buf.NSFS_SIZE;
--
2.7.4

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From e370973f273ffc1b32673bc94c5a46f75a846d82 Mon Sep 17 00:00:00 2001
From: Niels Baggesen <[email protected]>
Date: Wed, 31 Aug 2016 21:43:36 +0200
Subject: [PATCH] at.c: properly check return status from realloc. Thanks to
Daniel Eiland (bug 2678)

---
agent/mibgroup/mibII/at.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/agent/mibgroup/mibII/at.c b/agent/mibgroup/mibII/at.c
index f57ba2a..a73fb8c 100644
--- a/agent/mibgroup/mibII/at.c
+++ b/agent/mibgroup/mibII/at.c
@@ -638,11 +638,12 @@ ARP_Scan_Init(void)
struct arptab *newtab = (struct arptab *)
realloc(at, (sizeof(struct arptab) *
(arptab_curr_max_size + ARP_CACHE_INCR)));
- if (newtab == at) {
+ if (newtab == NULL) {
snmp_log(LOG_ERR,
"Error allocating more space for arpcache. "
"Cache will continue to be limited to %d entries",
arptab_curr_max_size);
+ newtab = at;
break;
} else {
arptab_curr_max_size += ARP_CACHE_INCR;
--
2.7.4

2 changes: 2 additions & 0 deletions src/snmpd/patch-5.7.3+dfsg/series
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0001-SNMP-Stop-spamming-logs-with-statfs-permission-denie.patch
0002-at.c-properly-check-return-status-from-realloc.-Than.patch
22 changes: 0 additions & 22 deletions src/snmpd/statfs_error.patch

This file was deleted.