svn commit: r201544 - head/sys/netinet
Qing Li
qingli at FreeBSD.org
Tue Jan 5 00:35:47 UTC 2010
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();
}
More information about the svn-src-all
mailing list