Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Feb 2014 14:21:26 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r262162 - head/sys/net
Message-ID:  <201402181421.s1IELQl5071291@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Tue Feb 18 14:21:26 2014
New Revision: 262162
URL: http://svnweb.freebsd.org/changeset/base/262162

Log:
  Fix incorrect assertions.

Modified:
  head/sys/net/flowtable.c

Modified: head/sys/net/flowtable.c
==============================================================================
--- head/sys/net/flowtable.c	Tue Feb 18 14:11:19 2014	(r262161)
+++ head/sys/net/flowtable.c	Tue Feb 18 14:21:26 2014	(r262162)
@@ -634,7 +634,8 @@ flowtable_insert(struct flowtable *ft, u
 	 * preempted by another thread handling this flow
 	 */
 	SLIST_FOREACH(iter, flist, f_next) {
-		KASSERT(iter->f_hash == hash, ("%s: wrong hash", __func__));
+		KASSERT(iter->f_hash % ft->ft_size == hash % ft->ft_size,
+		    ("%s: wrong hash", __func__));
 		if (flow_matches(iter, key, keylen, fibnum)) {
 			/*
 			 * We probably migrated to an other CPU after
@@ -714,7 +715,8 @@ flowtable_lookup_common(struct flowtable
 	critical_enter();
 	flist = flowtable_list(ft, hash);
 	SLIST_FOREACH(fle, flist, f_next) {
-		KASSERT(fle->f_hash == hash, ("%s: wrong hash", __func__));
+		KASSERT(fle->f_hash % ft->ft_size == hash % ft->ft_size,
+		    ("%s: wrong hash", __func__));
 		if (flow_matches(fle, key, keylen, fibnum)) {
 			fle->f_uptime = time_uptime;
 #ifdef FLOWTABLE_HASH_ALL



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