diff options
author | David S. Miller <davem@davemloft.net> | 2018-10-02 07:31:17 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-10-02 07:31:17 +0200 |
commit | 2240c12d7d3de741ffbcf22d7a96358a450051ac (patch) | |
tree | bf64abfcc23e730ffb74ead92213dc95f41fc548 /net/ipv4/esp4.c | |
parent | Merge tag 'mlx5e-updates-2018-10-01' of git://git.kernel.org/pub/scm/linux/ke... (diff) | |
parent | xfrm: allow driver to quietly refuse offload (diff) | |
download | linux-2240c12d7d3de741ffbcf22d7a96358a450051ac.tar.xz linux-2240c12d7d3de741ffbcf22d7a96358a450051ac.zip |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next
Steffen Klassert says:
====================
pull request (net-next): ipsec-next 2018-10-01
1) Make xfrmi_get_link_net() static to silence a sparse warning.
From Wei Yongjun.
2) Remove a unused esph pointer definition in esp_input().
From Haishuang Yan.
3) Allow the NIC driver to quietly refuse xfrm offload
in case it does not support it, the SA is created
without offload in this case.
From Shannon Nelson.
Please pull or let me know if there are problems.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/esp4.c')
-rw-r--r-- | net/ipv4/esp4.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c index 071533dd33c2..9e1c840596c5 100644 --- a/net/ipv4/esp4.c +++ b/net/ipv4/esp4.c @@ -683,12 +683,11 @@ static void esp_input_done_esn(struct crypto_async_request *base, int err) */ static int esp_input(struct xfrm_state *x, struct sk_buff *skb) { - struct ip_esp_hdr *esph; struct crypto_aead *aead = x->data; struct aead_request *req; struct sk_buff *trailer; int ivlen = crypto_aead_ivsize(aead); - int elen = skb->len - sizeof(*esph) - ivlen; + int elen = skb->len - sizeof(struct ip_esp_hdr) - ivlen; int nfrags; int assoclen; int seqhilen; @@ -698,13 +697,13 @@ static int esp_input(struct xfrm_state *x, struct sk_buff *skb) struct scatterlist *sg; int err = -EINVAL; - if (!pskb_may_pull(skb, sizeof(*esph) + ivlen)) + if (!pskb_may_pull(skb, sizeof(struct ip_esp_hdr) + ivlen)) goto out; if (elen <= 0) goto out; - assoclen = sizeof(*esph); + assoclen = sizeof(struct ip_esp_hdr); seqhilen = 0; if (x->props.flags & XFRM_STATE_ESN) { |