diff options
Diffstat (limited to 'net/ipv4/esp4.c')
-rw-r--r-- | net/ipv4/esp4.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c index e911c6dd8296..1b18ce66e7b7 100644 --- a/net/ipv4/esp4.c +++ b/net/ipv4/esp4.c | |||
@@ -144,7 +144,7 @@ static int esp_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struc | |||
144 | struct ip_esp_hdr *esph; | 144 | struct ip_esp_hdr *esph; |
145 | struct esp_data *esp = x->data; | 145 | struct esp_data *esp = x->data; |
146 | struct sk_buff *trailer; | 146 | struct sk_buff *trailer; |
147 | int blksize = crypto_tfm_alg_blocksize(esp->conf.tfm); | 147 | int blksize = ALIGN(crypto_tfm_alg_blocksize(esp->conf.tfm), 4); |
148 | int alen = esp->auth.icv_trunc_len; | 148 | int alen = esp->auth.icv_trunc_len; |
149 | int elen = skb->len - sizeof(struct ip_esp_hdr) - esp->conf.ivlen - alen; | 149 | int elen = skb->len - sizeof(struct ip_esp_hdr) - esp->conf.ivlen - alen; |
150 | int nfrags; | 150 | int nfrags; |
@@ -305,13 +305,13 @@ static int esp_post_input(struct xfrm_state *x, struct xfrm_decap_state *decap, | |||
305 | static u32 esp4_get_max_size(struct xfrm_state *x, int mtu) | 305 | static u32 esp4_get_max_size(struct xfrm_state *x, int mtu) |
306 | { | 306 | { |
307 | struct esp_data *esp = x->data; | 307 | struct esp_data *esp = x->data; |
308 | u32 blksize = crypto_tfm_alg_blocksize(esp->conf.tfm); | 308 | u32 blksize = ALIGN(crypto_tfm_alg_blocksize(esp->conf.tfm), 4); |
309 | 309 | ||
310 | if (x->props.mode) { | 310 | if (x->props.mode) { |
311 | mtu = ALIGN(mtu + 2, blksize); | 311 | mtu = ALIGN(mtu + 2, blksize); |
312 | } else { | 312 | } else { |
313 | /* The worst case. */ | 313 | /* The worst case. */ |
314 | mtu += 2 + blksize; | 314 | mtu = ALIGN(mtu + 2, 4) + blksize - 4; |
315 | } | 315 | } |
316 | if (esp->conf.padlen) | 316 | if (esp->conf.padlen) |
317 | mtu = ALIGN(mtu, esp->conf.padlen); | 317 | mtu = ALIGN(mtu, esp->conf.padlen); |