Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 9832
b: refs/heads/master
c: a02a642
h: refs/heads/master
v: v3
  • Loading branch information
Herbert Xu authored and David S. Miller committed Oct 11, 2005
1 parent ea427c2 commit 65e392a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e1c73b78e3706bd3c336d4730a01dd4081dfb7ee
refs/heads/master: a02a64223eddb410712b015fb3342c9a316ab70b
11 changes: 6 additions & 5 deletions trunk/net/ipv4/esp4.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <net/esp.h>
#include <asm/scatterlist.h>
#include <linux/crypto.h>
#include <linux/kernel.h>
#include <linux/pfkeyv2.h>
#include <linux/random.h>
#include <net/icmp.h>
Expand Down Expand Up @@ -42,10 +43,10 @@ static int esp_output(struct xfrm_state *x, struct sk_buff *skb)
esp = x->data;
alen = esp->auth.icv_trunc_len;
tfm = esp->conf.tfm;
blksize = (crypto_tfm_alg_blocksize(tfm) + 3) & ~3;
clen = (clen + 2 + blksize-1)&~(blksize-1);
blksize = ALIGN(crypto_tfm_alg_blocksize(tfm), 4);
clen = ALIGN(clen + 2, blksize);
if (esp->conf.padlen)
clen = (clen + esp->conf.padlen-1)&~(esp->conf.padlen-1);
clen = ALIGN(clen, esp->conf.padlen);

if ((nfrags = skb_cow_data(skb, clen-skb->len+alen, &trailer)) < 0)
goto error;
Expand Down Expand Up @@ -307,13 +308,13 @@ static u32 esp4_get_max_size(struct xfrm_state *x, int mtu)
u32 blksize = crypto_tfm_alg_blocksize(esp->conf.tfm);

if (x->props.mode) {
mtu = (mtu + 2 + blksize-1)&~(blksize-1);
mtu = ALIGN(mtu + 2, blksize);
} else {
/* The worst case. */
mtu += 2 + blksize;
}
if (esp->conf.padlen)
mtu = (mtu + esp->conf.padlen-1)&~(esp->conf.padlen-1);
mtu = ALIGN(mtu, esp->conf.padlen);

return mtu + x->props.header_len + esp->auth.icv_trunc_len;
}
Expand Down
11 changes: 6 additions & 5 deletions trunk/net/ipv6/esp6.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <net/esp.h>
#include <asm/scatterlist.h>
#include <linux/crypto.h>
#include <linux/kernel.h>
#include <linux/pfkeyv2.h>
#include <linux/random.h>
#include <net/icmp.h>
Expand Down Expand Up @@ -66,10 +67,10 @@ static int esp6_output(struct xfrm_state *x, struct sk_buff *skb)

alen = esp->auth.icv_trunc_len;
tfm = esp->conf.tfm;
blksize = (crypto_tfm_alg_blocksize(tfm) + 3) & ~3;
clen = (clen + 2 + blksize-1)&~(blksize-1);
blksize = ALIGN(crypto_tfm_alg_blocksize(tfm), 4);
clen = ALIGN(clen + 2, blksize);
if (esp->conf.padlen)
clen = (clen + esp->conf.padlen-1)&~(esp->conf.padlen-1);
clen = ALIGN(clen, esp->conf.padlen);

if ((nfrags = skb_cow_data(skb, clen-skb->len+alen, &trailer)) < 0) {
goto error;
Expand Down Expand Up @@ -238,13 +239,13 @@ static u32 esp6_get_max_size(struct xfrm_state *x, int mtu)
u32 blksize = crypto_tfm_alg_blocksize(esp->conf.tfm);

if (x->props.mode) {
mtu = (mtu + 2 + blksize-1)&~(blksize-1);
mtu = ALIGN(mtu + 2, blksize);
} else {
/* The worst case. */
mtu += 2 + blksize;
}
if (esp->conf.padlen)
mtu = (mtu + esp->conf.padlen-1)&~(esp->conf.padlen-1);
mtu = ALIGN(mtu, esp->conf.padlen);

return mtu + x->props.header_len + esp->auth.icv_full_len;
}
Expand Down

0 comments on commit 65e392a

Please sign in to comment.