From owner-svn-src-stable-9@FreeBSD.ORG Thu Feb 23 18:50:19 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 846801065670; Thu, 23 Feb 2012 18:50:19 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6FAD78FC08; Thu, 23 Feb 2012 18:50:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1NIoJqs018250; Thu, 23 Feb 2012 18:50:19 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1NIoJYw018247; Thu, 23 Feb 2012 18:50:19 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201202231850.q1NIoJYw018247@svn.freebsd.org> From: Kip Macy Date: Thu, 23 Feb 2012 18:50:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232058 - stable/9/sys/net X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Feb 2012 18:50:19 -0000 Author: kmacy Date: Thu Feb 23 18:50:19 2012 New Revision: 232058 URL: http://svn.freebsd.org/changeset/base/232058 Log: MFC r230598 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. Modified: stable/9/sys/net/flowtable.c stable/9/sys/net/if_llatbl.c Modified: stable/9/sys/net/flowtable.c ============================================================================== --- stable/9/sys/net/flowtable.c Thu Feb 23 18:49:38 2012 (r232057) +++ stable/9/sys/net/flowtable.c Thu Feb 23 18:50:19 2012 (r232058) @@ -1185,12 +1185,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: stable/9/sys/net/if_llatbl.c ============================================================================== --- stable/9/sys/net/if_llatbl.c Thu Feb 23 18:49:38 2012 (r232057) +++ stable/9/sys/net/if_llatbl.c Thu Feb 23 18:50:19 2012 (r232058) @@ -125,6 +125,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);