diff options
author | Mathias Krause <mathias.krause@secunet.com> | 2013-10-18 06:09:04 -0400 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2013-10-29 01:39:42 -0400 |
commit | 123b0d1ba0a98ef12550d82b79ccb8d89090f871 (patch) | |
tree | 0736319cd06a3bb314a297376bef78cd3ae67265 /net/ipv6 | |
parent | 4d53eff48b5f03ce67f4f301d6acca1d2145cb7a (diff) |
net: esp{4,6}: remove padlen from struct esp_data
The padlen member of struct esp_data is always zero. Get rid of it.
Signed-off-by: Mathias Krause <mathias.krause@secunet.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/esp6.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c index d3618a78fcac..0073cd096984 100644 --- a/net/ipv6/esp6.c +++ b/net/ipv6/esp6.c | |||
@@ -181,8 +181,6 @@ static int esp6_output(struct xfrm_state *x, struct sk_buff *skb) | |||
181 | } | 181 | } |
182 | blksize = ALIGN(crypto_aead_blocksize(aead), 4); | 182 | blksize = ALIGN(crypto_aead_blocksize(aead), 4); |
183 | clen = ALIGN(skb->len + 2 + tfclen, blksize); | 183 | clen = ALIGN(skb->len + 2 + tfclen, blksize); |
184 | if (esp->padlen) | ||
185 | clen = ALIGN(clen, esp->padlen); | ||
186 | plen = clen - skb->len - tfclen; | 184 | plen = clen - skb->len - tfclen; |
187 | 185 | ||
188 | err = skb_cow_data(skb, tfclen + plen + alen, &trailer); | 186 | err = skb_cow_data(skb, tfclen + plen + alen, &trailer); |
@@ -416,7 +414,6 @@ static u32 esp6_get_mtu(struct xfrm_state *x, int mtu) | |||
416 | { | 414 | { |
417 | struct esp_data *esp = x->data; | 415 | struct esp_data *esp = x->data; |
418 | u32 blksize = ALIGN(crypto_aead_blocksize(esp->aead), 4); | 416 | u32 blksize = ALIGN(crypto_aead_blocksize(esp->aead), 4); |
419 | u32 align = max_t(u32, blksize, esp->padlen); | ||
420 | unsigned int net_adj; | 417 | unsigned int net_adj; |
421 | 418 | ||
422 | if (x->props.mode != XFRM_MODE_TUNNEL) | 419 | if (x->props.mode != XFRM_MODE_TUNNEL) |
@@ -425,7 +422,7 @@ static u32 esp6_get_mtu(struct xfrm_state *x, int mtu) | |||
425 | net_adj = 0; | 422 | net_adj = 0; |
426 | 423 | ||
427 | return ((mtu - x->props.header_len - crypto_aead_authsize(esp->aead) - | 424 | return ((mtu - x->props.header_len - crypto_aead_authsize(esp->aead) - |
428 | net_adj) & ~(align - 1)) + net_adj - 2; | 425 | net_adj) & ~(blksize - 1)) + net_adj - 2; |
429 | } | 426 | } |
430 | 427 | ||
431 | static void esp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | 428 | static void esp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, |
@@ -606,8 +603,6 @@ static int esp6_init_state(struct xfrm_state *x) | |||
606 | 603 | ||
607 | aead = esp->aead; | 604 | aead = esp->aead; |
608 | 605 | ||
609 | esp->padlen = 0; | ||
610 | |||
611 | x->props.header_len = sizeof(struct ip_esp_hdr) + | 606 | x->props.header_len = sizeof(struct ip_esp_hdr) + |
612 | crypto_aead_ivsize(aead); | 607 | crypto_aead_ivsize(aead); |
613 | switch (x->props.mode) { | 608 | switch (x->props.mode) { |
@@ -626,8 +621,6 @@ static int esp6_init_state(struct xfrm_state *x) | |||
626 | } | 621 | } |
627 | 622 | ||
628 | align = ALIGN(crypto_aead_blocksize(aead), 4); | 623 | align = ALIGN(crypto_aead_blocksize(aead), 4); |
629 | if (esp->padlen) | ||
630 | align = max_t(u32, align, esp->padlen); | ||
631 | x->props.trailer_len = align + 1 + crypto_aead_authsize(esp->aead); | 624 | x->props.trailer_len = align + 1 + crypto_aead_authsize(esp->aead); |
632 | 625 | ||
633 | error: | 626 | error: |