Skip to contentSkip to conversation

netfilter: nft_hash: fix nft_hash_deactivate

PATCH Applied Florian Westphal 2 participants 2 messages Nov 2, 2017 – Nov 6, 2017

Subsystems (2)
lore
Share & tools
lore

Florian Westphal

author maintainer
#0 lore raw

PATCH 1/1 netfilter: nft_hash: fix nft_hash_deactivate

Jindřich Makovička says:
The logical OR looks fishy to me. Shouldn't be && there instead?

---
 net/netfilter/nft_set_hash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nft_set_hash.c +1 -1
index 9c0d5a7ce5f9..fcd51e819d72 100644
@@ -494,7 +494,7 @@ static void *nft_hash_deactivate(const struct net *net,
 	hash = reciprocal_scale(hash, priv->buckets);
 	hlist_for_each_entry(he, &priv->table[hash], node) {
 		if (!memcmp(nft_set_ext_key(&this->ext), &elem->key.val,
-			    set->klen) ||
+			    set->klen) &&
 		    nft_set_elem_active(&he->ext, genmask)) {
 			nft_set_elem_change_active(net, set, &he->ext);
 			return he;
Signature · 1 line
2.13.6