]> git.baikalelectronics.ru Git - kernel.git/commit
[NETFILTER]: xt_connbytes: fix division by zero
authorPatrick McHardy <kaber@trash.net>
Tue, 30 Jan 2007 22:24:29 +0000 (14:24 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 30 Jan 2007 22:24:29 +0000 (14:24 -0800)
commitdf3afa3fd878654a3d5d7329ed7de6ab1f114824
tree24ec91647e5a1356afda6d85a13be8bff1b74912
parent4ea8eb02172926d6a2e36bdf364233b958e6cfb1
[NETFILTER]: xt_connbytes: fix division by zero

When the packet counter of a connection is zero a division by zero
occurs in div64_64(). Fix that by using zero as average value, which
is correct as long as the packet counter didn't overflow, at which
point we have lost anyway.

Additionally we're probably going to go back to 64 bit counters
in 2.6.21.

Based on patch from Jonas Berlin <xkr47@outerspace.dyndns.org>,
with suggestions from KOVACS Krisztian <hidden@balabit.hu>.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netfilter/xt_connbytes.c