NetBSD Problem Report #572
From gnats Sun Nov 13 03:06:31 1994
Received: from pain.lcs.mit.edu (pain.lcs.mit.edu [128.52.46.239]) by sun-lamp.cs.berkeley.edu (8.6.9/8.6.9) with ESMTP id DAA05023 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Sun, 13 Nov 1994 03:06:31 -0800
Message-Id: <199411122328.AAA05831@hood.ed.unit.no>
Date: Sun, 13 Nov 1994 00:28:28 +0100
From: jarle@ed.unit.no
Reply-To: jarle@ed.unit.no
To: gnats-bugs@NetBSD.ORG
Subject: rare bootpd + arp failures
X-Send-Pr-Version: 3.2
>Number: 572
>Category: bin
>Synopsis: rare bootpd + arp failures
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: gnats-admin
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Nov 13 03:20:04 +0000 1994
>Closed-Date: Thu Feb 08 19:36:35 +0000 1996
>Last-Modified: Thu Feb 08 19:45:40 +0000 1996
>Originator: Jarle F. Greipsland
>Release: 1.0
>Organization:
Department of Redundancy Department
" "
>Environment:
System: NetBSD hood.ed.unit.no 1.0 NetBSD 1.0 (HOOD) #2: Mon Nov 7 00:42:11 MET 1994 jarle@hood.ed.unit.no:/usr/src/sys/arch/i386/compile/HOOD i386
Plain NetBSD 1.0
Intel EISA machine, 486/66, 3 WD8013 boards, bootp-serves about 30 OS/2
boxes on one segment, approx. 20 on the other one. Acts as gateway for
these machines towards the rest of the world. Some mail traffic.
>Description:
Every now and then a bootp request from one of the clients will fail, and
bootpd enters the following message into /var/log/messages:
Nov 10 10:22:32 hood bootpd[25500]: arp failed, exit code=0x100
and sometimes (but only very rarely) the following message also appears:
Nov 10 13:14:14 hood /netbsd: arptnew failed on 0
I don't know if these two are correlated, but I thougt I'd mention it.
Anyway, it seems like whenever bootpd tries to enter an already existing
entry into the table, 'arp' does an exit(1), and bootpd interprets this as an
error, and quits. My first fix was to, if the arpset failed, to see if
'arp hostname' would succeed (i.e. the address is already there). Then it
worked mostly OK, but sometimes the clients would still hang. Some more
digging, and it seems that the entries in the arp table 'times out', and any
lookup at an inappropriate time gives an entry of the form:
oci.ed.unit.no (129.241.180.120) at (incomplete)
bootpd don't seem to work well with one of these. So my final fix is, if
the first arpset fails, to delete the entry, and then to reinsert it. It
now seems to work.
>How-To-Repeat:
Run a bootp server with many clients for a long time..... Sorry for the lousy
How-To-Repeat-section, but I cannot reproduce this 'at will'.
>Fix:
Apply diff. I'm not sure if this is the proper way to solve this problem,
but I was in a hurry, with people talking behind my back about switching to
Solaris or Linux. Anyway, a suggestion for a more permanent fix would be
to pull most of the funcitonality in the arp program into a library, and
let the programs that need to talk with the arp-table use the library
instead of an external program. Oh well.
-jarle
----
"... except from the fact that it doesn't work, what do you think about the
program?"
*** /usr/src/usr.sbin/bootpd/hwaddr.c.orig Thu Nov 10 11:45:22 1994
--- /usr/src/usr.sbin/bootpd/hwaddr.c Thu Nov 10 19:11:21 1994
***************
*** 136,141 ****
report(LOG_INFO, buf);
status = system(buf);
! if (status)
! report(LOG_ERR, "arp failed, exit code=0x%x", status);
return;
#endif /* SIOCSARP */
--- 136,149 ----
report(LOG_INFO, buf);
status = system(buf);
! if (status) { /* arp set failed! */
! int status2;
! sprintf(buf, "arp -d %s", inet_ntoa(*ia));
! (void)system(buf); /* delete entry */
! sprintf(buf, "arp -s %s %s temp",
! inet_ntoa(*ia), haddrtoa(ha, len));
! status2 = system(buf); /* and set it again */
! if (status2)
! report(LOG_ERR, "arp failed, exit code=0x%x", status);
! }
return;
#endif /* SIOCSARP */
>Release-Note:
>Audit-Trail:
From: Jarle Greipsland <jarle@idt.unit.no>
To: gnats-bugs@netbsd.org
Subject: bin/572: rare bootpd + arp failures
Date: Tue, 15 Nov 1994 23:57:18 +0100
Please attach this message to the problem report indicated in the Subject
field. (bin/572)
-jarle
From: ronald@cpm.COM.MY (Ronald Khoo)
Date: Mon, 14 Nov 1994 10:02:44 +0000
In-Reply-To: <199411131120.DAA05303@sun-lamp.cs.berkeley.edu> (from jarle@ed.unit.no)
X-Mailer: Mail User's Shell (7.2.5 10/14/92)
To: jarle@ed.unit.no
Subject: Re: bin/572: rare bootpd + arp failures
In your message dated Nov 13, you write:
> Run a bootp server with many clients for a long time..... Sorry for the lousy
> How-To-Repeat-section, but I cannot reproduce this 'at will'.
Easy to repeat. From another terminal, before the workstation is switched
on, ping it.
# arp -d workstation # make sure any old arp entry for it is gone
# ping workstation
Now, switch on the workstation. Bootp will not be able to set an arp
for something that the system is already trying to arp for!
The reason is that there is already an incomplete link level route
for it, and arp.c gives up if RTM_ADD fails. I think that the correct
fix would be to teach arp(8) to RTM_CHANGE if RTM_ADD fails.
Remember that arp table entries are actually route table entries now!
I don't know how to use send-pr so can you re-file this ? Thanks :-)
By the way, the bootpd I'm using doesn't care about existing routes,
it deletes them anyway, I have been using
sprintf(buf, "route -n delete %s && arp -s %s %s temp", addr, addr
for quite a while now -- it's slower but it always works :-)
--
Me: Ronald Khoo Food: Roti Chanai Drink: Tea, weak, milky without sugar
In Malaysia: ronald@cpm.com.my +60 3 241 5232 Computer Protocol Malaysia
In England: ronald@demon.net +44 81 349 0063 Demon Internet Services
State-Changed-From-To: open->closed
State-Changed-By: gwr
State-Changed-When: Thu Feb 8 14:36:35 EST 1996
State-Changed-Why:
This was actually fixed long ago (1994/08/24) but I did not notice
the outstanding PR... Sorry. The fix applied was to use the command:
"arp -d %s; arp -s %s %s temp"
as suggested by Jarle Greipsland <jarle@idt.unit.no>
>Unformatted:
bootpd + arp fail to insert entry into the arp table
sw-bug
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.