Skip to contentSkip to conversation

netfilter: conntrack: fix build on 32bit arches

PATCH In review Florian Westphal 2 participants 2 messages Apr 13, 2019

Subsystems (2)
lore
Share & tools
lore

Florian Westphal

author maintainer
#0 lore raw

PATCH 1/1 netfilter: conntrack: fix build on 32bit arches

don't use hsiphash, it needs a hsiphash_key_t argument:
error: passing argument 3 of 'hsiphash' from incompatible pointer type

Fixes 862ae3a4a07e4c22 ("netfilter: ctnetlink: don't use conntrack/expect object addresses as id")

---
Pablo, feel free to squash this with 862ae3a4a07e4c22.

 net/netfilter/nf_conntrack_core.c    | 8 ++------
 net/netfilter/nf_conntrack_netlink.c | 6 ++----
 2 files changed, 4 insertions(+), 10 deletions(-)
net/netfilter/nf_conntrack_core.c +2 -6
index a966e69d68d9..3c48d44d6fff 100644
@@ -474,17 +474,13 @@ u32 nf_ct_get_id(const struct nf_conn *ct)
 	a = (unsigned long)ct;
 	b = (unsigned long)ct->master ^ net_hash_mix(nf_ct_net(ct));
 	c = (unsigned long)ct->ext;
-
+	d = (unsigned long)siphash(&ct->tuplehash, sizeof(ct->tuplehash),
+				   &ct_id_seed);
 #ifdef CONFIG_64BIT
-	d = siphash(&ct->tuplehash, sizeof(ct->tuplehash), &ct_id_seed);
-
 	return siphash_4u64((u64)a, (u64)b, (u64)c, (u64)d, &ct_id_seed);
 #else
-	d = hsiphash(&ct->tuplehash, sizeof(ct->tuplehash), &ct_id_seed);
-
 	return siphash_4u32((u32)a, (u32)b, (u32)c, (u32)d, &ct_id_seed);
 #endif
-
 }
 EXPORT_SYMBOL_GPL(nf_ct_get_id);
 
net/netfilter/nf_conntrack_netlink.c +2 -4
index f80fce25c673..805a277e456b 100644
@@ -2706,13 +2706,11 @@ static __be32 nf_expect_get_id(const struct nf_conntrack_expect *exp)
 	a = (unsigned long)exp;
 	b = (unsigned long)exp->helper;
 	c = (unsigned long)exp->master;
-#ifdef CONFIG_64BIT
-	d = siphash(&exp->tuple, sizeof(exp->tuple), &exp_id_seed);
+	d = (unsigned long)siphash(&exp->tuple, sizeof(exp->tuple), &exp_id_seed);
 
+#ifdef CONFIG_64BIT
 	return (__force __be32)siphash_4u64((u64)a, (u64)b, (u64)c, (u64)d, &exp_id_seed);
 #else
-	d = hsiphash(&exp->tuple, sizeof(exp->tuple), &exp_id_seed);
-
 	return (__force __be32)siphash_4u32((u32)a, (u32)b, (u32)c, (u32)d, &exp_id_seed);
 #endif
 }
Signature · 1 line
2.21.0