* [PATCH] netfilter: xt_hashlimit: fix 64 bit division compile error
@ 2017-09-05 1:03 Vishwanath Pai
0 siblings, 0 replies; only message in thread
From: Vishwanath Pai @ 2017-09-05 1:03 UTC (permalink / raw)
To: pablo, kadlec, netfilter-devel; +Cc: johunt, fw, netdev, pai.vishwain
commit bea74641e378 ("netfilter: xt_hashlimit: add rate match mode")
introduced a line where we divide two 64bit unsigned integers. This
breaks on ARM processors with the error:
ERROR: "__aeabi_uldivmod" [net/netfilter/xt_hashlimit.ko] undefined!
We can fix it by using div64_u64 instead.
Fixes: bea74641e378 ("netfilter: xt_hashlimit: add rate match mode")
Signed-off-by: Vishwanath Pai <vpai@akamai.com>
---
net/netfilter/xt_hashlimit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c
index 10d4823..fece7c2 100644
--- a/net/netfilter/xt_hashlimit.c
+++ b/net/netfilter/xt_hashlimit.c
@@ -531,7 +531,7 @@ static u64 user2rate_bytes(u64 user)
{
u64 r;
- r = user ? 0xFFFFFFFFULL / user : 0xFFFFFFFFULL;
+ r = user ? div64_u64(0xFFFFFFFFULL, user) : 0xFFFFFFFFULL;
r = (r - 1) << 4;
return r;
}
--
1.9.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-09-05 1:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-05 1:03 [PATCH] netfilter: xt_hashlimit: fix 64 bit division compile error Vishwanath Pai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox