esp: remove redundant define esph
The pointer 'esph' is defined but is never used hence it is redundant and canbe removed. Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
This commit is contained in:
parent
211d6f2dc8
commit
0c05f98376
@ -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)
|
static int esp_input(struct xfrm_state *x, struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
struct ip_esp_hdr *esph;
|
|
||||||
struct crypto_aead *aead = x->data;
|
struct crypto_aead *aead = x->data;
|
||||||
struct aead_request *req;
|
struct aead_request *req;
|
||||||
struct sk_buff *trailer;
|
struct sk_buff *trailer;
|
||||||
int ivlen = crypto_aead_ivsize(aead);
|
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 nfrags;
|
||||||
int assoclen;
|
int assoclen;
|
||||||
int seqhilen;
|
int seqhilen;
|
||||||
@ -698,13 +697,13 @@ static int esp_input(struct xfrm_state *x, struct sk_buff *skb)
|
|||||||
struct scatterlist *sg;
|
struct scatterlist *sg;
|
||||||
int err = -EINVAL;
|
int err = -EINVAL;
|
||||||
|
|
||||||
if (!pskb_may_pull(skb, sizeof(*esph) + ivlen))
|
if (!pskb_may_pull(skb, sizeof(struct ip_esp_hdr) + ivlen))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (elen <= 0)
|
if (elen <= 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
assoclen = sizeof(*esph);
|
assoclen = sizeof(struct ip_esp_hdr);
|
||||||
seqhilen = 0;
|
seqhilen = 0;
|
||||||
|
|
||||||
if (x->props.flags & XFRM_STATE_ESN) {
|
if (x->props.flags & XFRM_STATE_ESN) {
|
||||||
|
@ -601,12 +601,11 @@ static void esp_input_done_esn(struct crypto_async_request *base, int err)
|
|||||||
|
|
||||||
static int esp6_input(struct xfrm_state *x, struct sk_buff *skb)
|
static int esp6_input(struct xfrm_state *x, struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
struct ip_esp_hdr *esph;
|
|
||||||
struct crypto_aead *aead = x->data;
|
struct crypto_aead *aead = x->data;
|
||||||
struct aead_request *req;
|
struct aead_request *req;
|
||||||
struct sk_buff *trailer;
|
struct sk_buff *trailer;
|
||||||
int ivlen = crypto_aead_ivsize(aead);
|
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 nfrags;
|
||||||
int assoclen;
|
int assoclen;
|
||||||
int seqhilen;
|
int seqhilen;
|
||||||
@ -616,7 +615,7 @@ static int esp6_input(struct xfrm_state *x, struct sk_buff *skb)
|
|||||||
u8 *iv;
|
u8 *iv;
|
||||||
struct scatterlist *sg;
|
struct scatterlist *sg;
|
||||||
|
|
||||||
if (!pskb_may_pull(skb, sizeof(*esph) + ivlen)) {
|
if (!pskb_may_pull(skb, sizeof(struct ip_esp_hdr) + ivlen)) {
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
@ -626,7 +625,7 @@ static int esp6_input(struct xfrm_state *x, struct sk_buff *skb)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
assoclen = sizeof(*esph);
|
assoclen = sizeof(struct ip_esp_hdr);
|
||||||
seqhilen = 0;
|
seqhilen = 0;
|
||||||
|
|
||||||
if (x->props.flags & XFRM_STATE_ESN) {
|
if (x->props.flags & XFRM_STATE_ESN) {
|
||||||
|
Loading…
Reference in New Issue
Block a user