Re: [PATCH] netfilter: xt_hashlimit: Fix integer divide round to zero.

2017-02-06 Thread Alban Browaeys
Le lundi 06 février 2017 à 14:04 +0100, Pablo Neira Ayuso a écrit : > On Sat, Feb 04, 2017 at 11:47:31PM +0100, Alban Browaeys wrote: > > diff --git a/net/netfilter/xt_hashlimit.c > > b/net/netfilter/xt_hashlimit.c > > index 10063408141d..df75ad643eef 100644 > > --- a/net/netfilter/xt_hashlimit.c >

Re: [PATCH] netfilter: xt_hashlimit: Fix integer divide round to zero.

2017-02-06 Thread Pablo Neira Ayuso
On Sat, Feb 04, 2017 at 11:47:31PM +0100, Alban Browaeys wrote: > Diving the divider by the multiplier before applying to the input. > When this would "divide by zero", divide the multiplier by the divider > first then multiply the input by this value. > > Currently user2creds outputs zero when in

[PATCH] netfilter: xt_hashlimit: Fix integer divide round to zero.

2017-02-04 Thread Alban Browaeys
Diving the divider by the multiplier before applying to the input. When this would "divide by zero", divide the multiplier by the divider first then multiply the input by this value. Currently user2creds outputs zero when input value is bigger than the number of slices and lower than scale. This