Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 9833
b: refs/heads/master
c: d4875b0
h: refs/heads/master
i:
  9831: ea427c2
v: v3
  • Loading branch information
Herbert Xu authored and David S. Miller committed Oct 11, 2005
1 parent 65e392a commit b88fa78
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 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: a02a64223eddb410712b015fb3342c9a316ab70b
refs/heads/master: d4875b049b2e6401a6e1fae90b7f09e20a636fcf
6 changes: 3 additions & 3 deletions trunk/net/ipv4/esp4.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ static int esp_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struc
struct ip_esp_hdr *esph;
struct esp_data *esp = x->data;
struct sk_buff *trailer;
int blksize = crypto_tfm_alg_blocksize(esp->conf.tfm);
int blksize = ALIGN(crypto_tfm_alg_blocksize(esp->conf.tfm), 4);
int alen = esp->auth.icv_trunc_len;
int elen = skb->len - sizeof(struct ip_esp_hdr) - esp->conf.ivlen - alen;
int nfrags;
Expand Down Expand Up @@ -305,13 +305,13 @@ static int esp_post_input(struct xfrm_state *x, struct xfrm_decap_state *decap,
static u32 esp4_get_max_size(struct xfrm_state *x, int mtu)
{
struct esp_data *esp = x->data;
u32 blksize = crypto_tfm_alg_blocksize(esp->conf.tfm);
u32 blksize = ALIGN(crypto_tfm_alg_blocksize(esp->conf.tfm), 4);

if (x->props.mode) {
mtu = ALIGN(mtu + 2, blksize);
} else {
/* The worst case. */
mtu += 2 + blksize;
mtu = ALIGN(mtu + 2, 4) + blksize - 4;
}
if (esp->conf.padlen)
mtu = ALIGN(mtu, esp->conf.padlen);
Expand Down
7 changes: 4 additions & 3 deletions trunk/net/ipv6/esp6.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ static int esp6_input(struct xfrm_state *x, struct xfrm_decap_state *decap, stru
struct ipv6_esp_hdr *esph;
struct esp_data *esp = x->data;
struct sk_buff *trailer;
int blksize = crypto_tfm_alg_blocksize(esp->conf.tfm);
int blksize = ALIGN(crypto_tfm_alg_blocksize(esp->conf.tfm), 4);
int alen = esp->auth.icv_trunc_len;
int elen = skb->len - sizeof(struct ipv6_esp_hdr) - esp->conf.ivlen - alen;

Expand Down Expand Up @@ -236,13 +236,14 @@ static int esp6_input(struct xfrm_state *x, struct xfrm_decap_state *decap, stru
static u32 esp6_get_max_size(struct xfrm_state *x, int mtu)
{
struct esp_data *esp = x->data;
u32 blksize = crypto_tfm_alg_blocksize(esp->conf.tfm);
u32 blksize = ALIGN(crypto_tfm_alg_blocksize(esp->conf.tfm), 4);

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

0 comments on commit b88fa78

Please sign in to comment.