Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Jan 2010 00:35:47 +0000 (UTC)
From:      Qing Li <qingli@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r201544 - head/sys/netinet
Message-ID:  <201001050035.o050Zluo028157@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: qingli
Date: Tue Jan  5 00:35:46 2010
New Revision: 201544
URL: http://svn.freebsd.org/changeset/base/201544

Log:
  An existing incomplete ARP entry would expire a subsequent
  statically configured entry of the same host. This bug was
  due to the expiration timer was not cancelled when installing
  the static entry. Since there exist a potential race condition
  with respect to timer cancellation, simply check for the
  LLE_STATIC bit inside the expiration function instead of
  cancelling the active timer.
  
  MFC after:	5 days

Modified:
  head/sys/netinet/if_ether.c

Modified: head/sys/netinet/if_ether.c
==============================================================================
--- head/sys/netinet/if_ether.c	Mon Jan  4 23:39:53 2010	(r201543)
+++ head/sys/netinet/if_ether.c	Tue Jan  5 00:35:46 2010	(r201544)
@@ -175,18 +175,24 @@ arptimer(void *arg)
 	CURVNET_SET(ifp->if_vnet);
 	IF_AFDATA_LOCK(ifp);
 	LLE_WLOCK(lle);
-	if ((!callout_pending(&lle->la_timer) &&
-	    callout_active(&lle->la_timer))) {
-		(void) llentry_free(lle);
-		ARPSTAT_INC(timeouts);
-	} 
-#ifdef DIAGNOSTIC
+	if (lle->la_flags & LLE_STATIC)
+		LLE_WUNLOCK(lle);
 	else {
-		struct sockaddr *l3addr = L3_ADDR(lle);
-		log(LOG_INFO, "arptimer issue: %p, IPv4 address: \"%s\"\n", lle,
-		    inet_ntoa(((const struct sockaddr_in *)l3addr)->sin_addr));
-	}
+		if (!callout_pending(&lle->la_timer) &&
+		    callout_active(&lle->la_timer)) {
+			(void) llentry_free(lle);
+			ARPSTAT_INC(timeouts);
+		} 
+#ifdef DIAGNOSTIC
+		else {
+			struct sockaddr *l3addr = L3_ADDR(lle);
+			log(LOG_INFO, 
+			    "arptimer issue: %p, IPv4 address: \"%s\"\n", lle,
+			    inet_ntoa(
+			        ((const struct sockaddr_in *)l3addr)->sin_addr));
+		}
 #endif
+	}
 	IF_AFDATA_UNLOCK(ifp);
 	CURVNET_RESTORE();
 }



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