Subject: bin/1242: bootpd can not work under incomplete arp table
To: None <gnats-bugs@NetBSD.ORG>
From: Atsushi Furuta <furuta@trc.rwcp.or.jp>
List: netbsd-bugs
Date: 07/19/1995 17:24:23
>Number:         1242
>Category:       bin
>Synopsis:       bootpd can not work under incomplete arp table
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 19 04:35:03 1995
>Last-Modified:
>Originator:     Atsushi Furuta
>Organization:
Real World Computing Partnership, Tsukuba Research Center
>Release:        1.0
>Environment:
    	
System: NetBSD decpc.trc.rwcp.or.jp 1.0 NetBSD 1.0 (RWC) #3: Wed Dec 7 15:12:43
JST 1994 furuta@decpc.trc.rwcp.or.jp:/usr/src/sys/arch/i386/compile/RWC i386

>Description:
	/usr/sbin/bootpd can not work correctly when the arp table
has a incomplete hardware address entry on a client IP slot. Many messages
such as:

	Jul 19 14:47:33 decpc bootpd[7933]: arp failed, exit code=0x100
	Jul 19 14:47:33 decpc bootpd[7933]: sendto: Host is down

are logged (and displayed to console) when bootp client started. If I
started bootpd manually, I also get messages:

	writing to routing socket: File exists

>How-To-Repeat:

I assume a bootpd client machine "client" is down now.

	# /usr/sbin/bootpd
	# /sbin/ping client
	# /usr/sbin/arp -a
		:
	client.trc.rwcp.or.jp (163.220.1.225) at (incomplete)
		:
	#

Now, I turn on power switch of "client", but it can't boot. To set
correct value to arp table manually:

	# /usr/sbin/arp -d 163.220.1.225
	# /usr/sbin/arp -s 163.220.1.225 00:20:AF:75:7C:46 temp

makes it boot fine. Should I do it every time to boot client?

>Fix:

A dirty fix is:
----------------
--- hwaddr.c.ORIG       Wed Jul 19 14:59:21 1995
+++ hwaddr.c    Wed Jul 19 14:59:23 1995
@@ -130,6 +130,11 @@
        char buf[256];
        int status;
 
+       sprintf(buf, "arp -d %s", inet_ntoa(*ia));
+       if (debug > 2)
+               report(LOG_INFO, buf);
+       status = system(buf);
+
        sprintf(buf, "arp -s %s %s temp",
                        inet_ntoa(*ia), haddrtoa(ha, len));
        if (debug > 2)
----------------

I don't know if it is a proper solution or not.

>Audit-Trail:
>Unformatted: