summaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorShan Wei <shanwei@cn.fujitsu.com>2010-11-05 02:56:34 +0100
committerDavid S. Miller <davem@davemloft.net>2010-11-08 21:17:06 +0100
commitf46421416fb6b91513fb687d6503142cd99034a5 (patch)
treecad8e340ce9bccec9ff261a1c0d73b18382019af /net/ipv6
parentclassifier: report statistics for basic classifier (diff)
downloadlinux-f46421416fb6b91513fb687d6503142cd99034a5.tar.xz
linux-f46421416fb6b91513fb687d6503142cd99034a5.zip
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: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/reassembly.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index c7ba3149633f..0f2766453759 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -349,7 +349,7 @@ found:
/* Check for overlap with preceding fragment. */
if (prev &&
- (FRAG6_CB(prev)->offset + prev->len) - offset > 0)
+ (FRAG6_CB(prev)->offset + prev->len) > offset)
goto discard_fq;
/* Look for overlap with succeeding segment. */