[PATCH] NETFILTER: xt_connbytes: fix division by zero
authorPatrick McHardy <kaber@trash.net>
Wed, 31 Jan 2007 00:27:29 +0000 (01:27 +0100)
committerChris Wright <chrisw@sous-sol.org>
Mon, 5 Feb 2007 16:31:45 +0000 (08:31 -0800)
commit81a86f15d6f696efcb531620c936d1e7edb96f17
treefb8a0e0e908dd4c4f257d9ee20fa3bf56e15fe2f
parent6e3e53bbff845b9c8d77967bf75bcd5325782199
[PATCH] 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: Chris Wright <chrisw@sous-sol.org>
net/netfilter/xt_connbytes.c