summaryrefslogtreecommitdiff
path: root/net/xfrm
diff options
context:
space:
mode:
authorSteffen Klassert <steffen.klassert@secunet.com>2011-04-25 19:39:24 +0000
committerDavid S. Miller <davem@davemloft.net>2011-04-26 12:46:03 -0700
commit3f602b08dec32c418fc391fc838db357aab84f8a (patch)
tree743671d99f90e3d2ffc2c915c2aa91b20abada43 /net/xfrm
parent0972ddb2373d5e127aabdcabd8305eff0242cd0b (diff)
downloadlinux-3.10-3f602b08dec32c418fc391fc838db357aab84f8a.tar.gz
linux-3.10-3f602b08dec32c418fc391fc838db357aab84f8a.tar.bz2
linux-3.10-3f602b08dec32c418fc391fc838db357aab84f8a.zip
xfrm: Fix replay window size calculation on initialization
On replay initialization, we compute the size of the replay buffer to see if the replay window fits into the buffer. This computation lacks a mutliplication by 8 because we need the size in bit, not in byte. So we might return an error even though the replay window would fit into the buffer. This patch fixes this issue. Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com> Acked-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/xfrm')
-rw-r--r--net/xfrm/xfrm_replay.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_replay.c b/net/xfrm/xfrm_replay.c
index f218385950c..e8a781422fe 100644
--- a/net/xfrm/xfrm_replay.c
+++ b/net/xfrm/xfrm_replay.c
@@ -532,7 +532,7 @@ int xfrm_init_replay(struct xfrm_state *x)
if (replay_esn) {
if (replay_esn->replay_window >
- replay_esn->bmp_len * sizeof(__u32))
+ replay_esn->bmp_len * sizeof(__u32) * 8)
return -EINVAL;
if ((x->props.flags & XFRM_STATE_ESN) && x->replay_esn)