Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Jan 2012 20:02:40 +0000 (UTC)
From:      Kip Macy <kmacy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r230598 - head/sys/net
Message-ID:  <201201262002.q0QK2eWF003813@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kmacy
Date: Thu Jan 26 20:02:40 2012
New Revision: 230598
URL: http://svn.freebsd.org/changeset/base/230598

Log:
  A flowtable entry can continue referencing an llentry indefinitely if the entry is repeatedly
  referenced within its timeout window. This change clears the LLE_VALID flag when an llentry
  is removed from an interface's hash table and adds an extra check to the flowtable code
  for the LLE_VALID flag in llentry to avoid retaining and using a stale reference.
  
  Reviewed by:	qingli@
  MFC after:	2 weeks

Modified:
  head/sys/net/flowtable.c
  head/sys/net/if_llatbl.c

Modified: head/sys/net/flowtable.c
==============================================================================
--- head/sys/net/flowtable.c	Thu Jan 26 19:46:13 2012	(r230597)
+++ head/sys/net/flowtable.c	Thu Jan 26 20:02:40 2012	(r230598)
@@ -1186,12 +1186,14 @@ keycheck:	
 	rt = __DEVOLATILE(struct rtentry *, fle->f_rt);
 	lle = __DEVOLATILE(struct llentry *, fle->f_lle);
 	if ((rt != NULL)
+	    && lle != NULL
 	    && fle->f_fhash == hash
 	    && flowtable_key_equal(fle, key)
 	    && (proto == fle->f_proto)
 	    && (fibnum == fle->f_fibnum)
 	    && (rt->rt_flags & RTF_UP)
-	    && (rt->rt_ifp != NULL)) {
+	    && (rt->rt_ifp != NULL)
+	    && (lle->la_flags & LLE_VALID)) {
 		fs->ft_hits++;
 		fle->f_uptime = time_uptime;
 		fle->f_flags |= flags;

Modified: head/sys/net/if_llatbl.c
==============================================================================
--- head/sys/net/if_llatbl.c	Thu Jan 26 19:46:13 2012	(r230597)
+++ head/sys/net/if_llatbl.c	Thu Jan 26 20:02:40 2012	(r230598)
@@ -122,6 +122,7 @@ llentry_free(struct llentry *lle)
 		("%s: la_numheld %d > 0, pkts_droped %zd", __func__, 
 		 lle->la_numheld, pkts_dropped));
 
+	lle->la_flags &= ~LLE_VALID;
 	LLE_FREE_LOCKED(lle);
 
 	return (pkts_dropped);



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