Subject: Re: rarpd stops listening
To: David Brownlee <abs@netbsd.org>
From: Krister Walfridsson <cato@df.lth.se>
List: port-i386
Date: 02/10/2000 18:03:18
On Thu, 10 Feb 2000, David Brownlee wrote:

> 	It looks like the problem ony ever occurs if rarpd has been left
> 	idle for a while?

Not really (the info below is from my PR#7508 using NetBSD 1.4_BETA)

For me it is when rarpd is about to answer the 4th request from my sun3
machine, and what is happening is that it 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));

That read should not hang as I understand it, so I think it is a kernel
issue. If I close the file descriptor on the line after the while
statemente as in

--- 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);
 }

so that it is beeing reopened for the next request, then everything seems
to work.

   /Krister