aboutsummaryrefslogtreecommitdiff
path: root/sys/net/flowtable.c
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2014-02-18 14:21:26 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2014-02-18 14:21:26 +0000
commitec0ad11ed282affaac820c4cead6e90f698838de (patch)
treed4ff901013ef8a54949800c92888580b6f70745d /sys/net/flowtable.c
parentc3c9304aa94668991bf3935ecebcbe4437fb06e7 (diff)
downloadsrc-ec0ad11ed282affaac820c4cead6e90f698838de.tar.gz
src-ec0ad11ed282affaac820c4cead6e90f698838de.zip
Fix incorrect assertions.
Notes
Notes: svn path=/head/; revision=262162
Diffstat (limited to 'sys/net/flowtable.c')
-rw-r--r--sys/net/flowtable.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/net/flowtable.c b/sys/net/flowtable.c
index 393d775d3e27..873ec36e7aa4 100644
--- a/sys/net/flowtable.c
+++ b/sys/net/flowtable.c
@@ -634,7 +634,8 @@ flowtable_insert(struct flowtable *ft, uint32_t hash, uint32_t *key,
* 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 *ft, uint32_t *key, int keylen,
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