Subject: bin/7508: rarpd stops answering requests
To: None <gnats-bugs@gnats.netbsd.org>
From: Krister Walfridsson <cato@ulysses.df.lth.se>
List: netbsd-bugs
Date: 05/02/1999 09:20:56
>Number:         7508
>Category:       bin
>Synopsis:       rarpd stops answering requests
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May  2 09:20:01 1999
>Last-Modified:
>Originator:     Krister Walfridsson
>Organization:
	
>Release:        NetBSD-current May 1 1999
>Environment:
	
System: NetBSD ulysses 1.4_BETA NetBSD 1.4_BETA (ULYSSES) #0: Sun May 2 10:49:45 CEST 1999 cato@ulysses:/dsk2/tmp/nbsd990502.i386/src/sys/arch/i386/compile/ULYSSES i386


>Description:
My diskless sun3 sends a couple of rarp requests when it boots,
but the rarp deamon on my i386 only answers the 3 first requests,
and need to be restarted before it will answer any more.

Further investigation shows that rarpd hangs in the read call in rtmsg()
(usr.sbin/rarpd/mkarp.c about line 230)

	do {
		l = read(s, (char *)&m_rtmsg, sizeof(m_rtmsg));
	} while (l > 0 && (rtm->rtm_seq != seq || rtm->rtm_pid != pid));

>How-To-Repeat:
Try to boot a diskless sun3 as described in the 'diskless' man page.

>Fix:
The following workaround solves the problem.

--- mkarp.c.orig        Sun May  2 17:15:43 1999
+++ mkarp.c     Sun May  2 17:16:23 1999
@@ -229,5 +229,7 @@
        } while (l > 0 && (rtm->rtm_seq != seq || rtm->rtm_pid != pid));
        if (l < 0)
                warn("read from routing socket");
+        close(s);
+        s = -1;
        return (0);
 }

>Audit-Trail:
>Unformatted: