Date: Tue, 11 Jan 2005 02:28:03 +0300 (MSK) From: Dmitrij Tejblum <tejblum@yandex-team.ru> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/76075: arp program failures due to ARP table growth Message-ID: <200501102328.j0ANS3Va051521@developer.yandex.ru> Resent-Message-ID: <200501102330.j0ANUT5b090471@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200501102328.j0ANS3Va051521>