[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1424801227-17320-3-git-send-email-johunt@akamai.com>
Date: Tue, 24 Feb 2015 13:07:07 -0500
From: Josh Hunt <johunt@...mai.com>
To: Pablo Neira Ayuso <pablo@...filter.org>,
Patrick McHardy <kaber@...sh.net>, Thomas Graf <tgraf@...g.ch>
Cc: netfilter-devel@...r.kernel.org, netdev@...r.kernel.org,
Daniel Borkmann <daniel@...earbox.net>,
Josh Hunt <johunt@...mai.com>
Subject: [PATCH v4 2/2] rhashtable: require max_shift if grow_decision defined
If an rhashtable user defines a grow_decision fn they must also define a
max_shift parameter.
Acked-by: Thomas Graf <tgraf@...g.ch>
Signed-off-by: Josh Hunt <johunt@...mai.com>
---
lib/rhashtable.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/rhashtable.c b/lib/rhashtable.c
index 9cc4c4a..7d6f539 100644
--- a/lib/rhashtable.c
+++ b/lib/rhashtable.c
@@ -1077,7 +1077,8 @@ int rhashtable_init(struct rhashtable *ht, struct rhashtable_params *params)
size = HASH_DEFAULT_SIZE;
if ((params->key_len && !params->hashfn) ||
- (!params->key_len && !params->obj_hashfn))
+ (!params->key_len && !params->obj_hashfn) ||
+ (params->grow_decision && !params->max_shift))
return -EINVAL;
if (params->nulls_base && params->nulls_base < (1U << RHT_BASE_SHIFT))
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists