aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorShan Wei <shanwei@cn.fujitsu.com>2010-11-12 08:51:55 +0100
committerPatrick McHardy <kaber@trash.net>2010-11-12 08:51:55 +0100
commit22e091e5253da1e9ad7c0a82c2c84446fc403efe (patch)
treeb3f892779ab637002bfb9e32c74905b13f81ec75 /net
parentnetfilter: NF_HOOK_COND has wrong conditional (diff)
downloadlinux-dev-22e091e5253da1e9ad7c0a82c2c84446fc403efe.tar.xz
linux-dev-22e091e5253da1e9ad7c0a82c2c84446fc403efe.zip
netfilter: ipv6: fix overlap check for fragments
The type of FRAG6_CB(prev)->offset is int, skb->len is *unsigned* int, and offset is int. Without this patch, type conversion occurred to this expression, when (FRAG6_CB(prev)->offset + prev->len) is less than offset. Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com> Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/netfilter/nf_conntrack_reasm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index 3a3f129a44cb..79d43aa8fa8d 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -286,7 +286,7 @@ found:
/* Check for overlap with preceding fragment. */
if (prev &&
- (NFCT_FRAG6_CB(prev)->offset + prev->len) - offset > 0)
+ (NFCT_FRAG6_CB(prev)->offset + prev->len) > offset)
goto discard_fq;
/* Look for overlap with succeeding segment. */