kern/107807: Spurious EHOSTDOWN errors -- ARP retransmission bug.

Dmitrij Tejblum tejblum at yandex-team.ru
Wed Jan 10 16:10:17 PST 2007


>Number:         107807
>Category:       kern
>Synopsis:       Spurious EHOSTDOWN errors -- ARP retransmission bug.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 11 00:10:16 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Dmitrij Tejblum
>Release:        FreeBSD 6.2-PRERELEASE i386
>Organization:
Yandex
>Environment:
System: FreeBSD walrus-t.yandex.ru 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #4: Mon Jan 8 18:47:27 MSK 2007 root at walrus-t.yandex.ru:/.amd_mnt/walrus-t/host/opt/usr/src/sys/i386/compile/W5L i386


>Description:
ARP retrnsmission is rate limited (to 1 packet per second). But the count of
ARP requests sent works before the rate limit. Thus, the EHOSTDOWN error may
be returned before ARP request was retransmitted even once, and, with some
"luck", without any networking problem -- right after first
request was sent, but before the reply was received.

>How-To-Repeat:


>Fix:

--- sys/netinet/if_ether.c	Tue Sep 26 14:22:07 2006
+++ sys/netinet/if_ether.c	Thu Jan 11 02:14:26 2007
@@ -493,19 +493,21 @@
 	if (la->la_asked < arp_maxtries)
 		error = EWOULDBLOCK;	/* First request. */
 	else
 		error = (rt == rt0) ? EHOSTDOWN : EHOSTUNREACH;
 
-	if (la->la_asked++ == 0 || rt->rt_expire != time_second) {
+	if (la->la_asked == 0 || rt->rt_expire != time_second) {
 		struct in_addr sin =
 		    SIN(rt->rt_ifa->ifa_addr)->sin_addr;
 
 		rt->rt_expire = time_second;
 		RT_UNLOCK(rt);
 
 		arprequest(ifp, &sin, &SIN(dst)->sin_addr,
 		    IF_LLADDR(ifp));
+
+		la->la_asked++;
 	} else
 		RT_UNLOCK(rt);
 
 	return (error);
 }
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list