bin/76075: arp program failures due to ARP table growth

Dmitrij Tejblum tejblum at yandex-team.ru
Mon Jan 10 15:30:30 PST 2005


>Number:         76075
>Category:       bin
>Synopsis:       arp program failures due to ARP table growth
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 10 23:30:27 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Dmitrij Tejblum
>Release:        FreeBSD 5.3-STABLE i386
>Organization:
>Environment:

>Description:

The arp -an command sometimes fail with

arp: actual retrieval of routing table: Cannot allocate memory

if ARP tables has been grown after its size was estimated. 

>How-To-Repeat:
>Fix:

Allocate a bit more memory for ARP table, so the event will be less likely.


--- arp.c	Tue Jan 11 02:00:45 2005
+++ arp.c	Tue Jan 11 02:05:15 2005
@@ -471,10 +471,11 @@
 	mib[5] = RTF_LLINFO;
 	if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
 		err(1, "route-sysctl-estimate");
 	if (needed == 0)	/* empty table */
 		return 0;
+	needed += needed / 2;
 	if ((buf = malloc(needed)) == NULL)
 		err(1, "malloc");
 	if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0)
 		err(1, "actual retrieval of routing table");
 	lim = buf + needed;
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list