[Pkg-net-snmp-devel] Bug#856551: Error allocating more space for arpcache

Sven Hartge sven at svenhartge.de
Thu Mar 2 11:40:12 UTC 2017


Package: snmpd
Version: 5.7.2.1+dfsg-1
Severity: normal
Tags: upstream patch

Hi!

On a system of mine where the neighbour table can get quite large, I
often get the following error:

,----
| Mar  2 10:57:26 firewall snmpd[5302]: Error allocating more space for arpcache.  Cache will continue to be limited to 1024 entries
| Mar  2 10:57:27 firewall snmpd[5302]: Error allocating more space for arpcache.  Cache will continue to be limited to 1024 entries
| Mar  2 10:57:28 firewall snmpd[5302]: Error allocating more space for arpcache.  Cache will continue to be limited to 1024 entries
| Mar  2 10:57:29 firewall snmpd[5302]: Error allocating more space for arpcache.  Cache will continue to be limited to 1024 entries
| Mar  2 10:57:30 firewall snmpd[5302]: Error allocating more space for arpcache.  Cache will continue to be limited to 1024 entries
| Mar  2 10:57:31 firewall snmpd[5302]: Error allocating more space for arpcache.  Cache will continue to be limited to 1024 entries
| Mar  2 10:57:32 firewall snmpd[5302]: Error allocating more space for arpcache.  Cache will continue to be limited to 1024 entries
| Mar  2 10:57:33 firewall snmpd[5302]: Error allocating more space for arpcache.  Cache will continue to be limited to 1024 entries
| Mar  2 10:57:34 firewall snmpd[5302]: Error allocating more space for arpcache.  Cache will continue to be limited to 1024 entries
`----

I tracked this down to bug 2678 on Sourceforge:
https://sourceforge.net/p/net-snmp/bugs/2678/

The fix is in commit d6e7f8962b110a2cd65667b2c57a8a60ad3cd222 in the
upstream git, a patch is attached for your convenience.

It would be very nice if this change can make it to Stretch before
release. The fix is simple enough that the Release-Team should unblock
the package.

Grüße,
Sven.
-------------- next part --------------
>From d6e7f8962b110a2cd65667b2c57a8a60ad3cd222 Mon Sep 17 00:00:00 2001
From: Niels Baggesen <nba at users.sourceforge.net>
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 45ab51680..2068fd50a 100644
--- a/agent/mibgroup/mibII/at.c
+++ b/agent/mibgroup/mibII/at.c
@@ -640,11 +640,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.11.0



More information about the Pkg-net-snmp-devel mailing list