mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-18 12:56:18 +07:00
[IPSEC] esp: Kill unnecessary block and indentation
We used to keep sg on the stack which is why the extra block was useful. We've long since stopped doing that so let's kill the block and save some indentation. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
de5f503cfb
commit
4bf05eceec
@ -150,6 +150,10 @@ static int esp_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struc
|
||||
int elen = skb->len - sizeof(struct ip_esp_hdr) - esp->conf.ivlen - alen;
|
||||
int nfrags;
|
||||
int encap_len = 0;
|
||||
u8 nexthdr[2];
|
||||
struct scatterlist *sg;
|
||||
u8 workbuf[60];
|
||||
int padlen;
|
||||
|
||||
if (!pskb_may_pull(skb, sizeof(struct ip_esp_hdr)))
|
||||
goto out;
|
||||
@ -185,11 +189,7 @@ static int esp_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struc
|
||||
if (esp->conf.ivlen)
|
||||
crypto_cipher_set_iv(esp->conf.tfm, esph->enc_data, crypto_tfm_alg_ivsize(esp->conf.tfm));
|
||||
|
||||
{
|
||||
u8 nexthdr[2];
|
||||
struct scatterlist *sg = &esp->sgbuf[0];
|
||||
u8 workbuf[60];
|
||||
int padlen;
|
||||
sg = &esp->sgbuf[0];
|
||||
|
||||
if (unlikely(nfrags > ESP_NUM_FAST_SG)) {
|
||||
sg = kmalloc(sizeof(struct scatterlist)*nfrags, GFP_ATOMIC);
|
||||
@ -238,7 +238,6 @@ static int esp_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struc
|
||||
skb->nh.raw += encap_len + sizeof(struct ip_esp_hdr) + esp->conf.ivlen;
|
||||
memcpy(skb->nh.raw, workbuf, iph->ihl*4);
|
||||
skb->nh.iph->tot_len = htons(skb->len);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user