-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[SNMP] fix issue #1874, ERR snmpd[34]: Error allocating more space for arpcache. Cache will continue to be limited to 4096 entries #1989
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/snmpd/patch-5.7.3+dfsg/0001-SNMP-Stop-spamming-logs-with-statfs-permission-denie.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
|
31 changes: 31 additions & 0 deletions
31
src/snmpd/patch-5.7.3+dfsg/0002-at.c-properly-check-return-status-from-realloc.-Than.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.