Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Jan 2007 02:52:26 +0300 (MSK)
From:      Dmitrij Tejblum <tejblum@yandex-team.ru>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/107807: Spurious EHOSTDOWN errors -- ARP retransmission bug.
Message-ID:  <200701102352.l0ANqQYD008704@walrus-t.yandex.ru>
Resent-Message-ID: <200701110010.l0B0AHhp023143@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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@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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701102352.l0ANqQYD008704>