aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ah6.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/ah6.c')
-rw-r--r--net/ipv6/ah6.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c
index 2ff0c8233e47..52449f7a1b71 100644
--- a/net/ipv6/ah6.c
+++ b/net/ipv6/ah6.c
@@ -407,6 +407,7 @@ out:
407static void ah6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, 407static void ah6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
408 int type, int code, int offset, __be32 info) 408 int type, int code, int offset, __be32 info)
409{ 409{
410 struct net *net = dev_net(skb->dev);
410 struct ipv6hdr *iph = (struct ipv6hdr*)skb->data; 411 struct ipv6hdr *iph = (struct ipv6hdr*)skb->data;
411 struct ip_auth_hdr *ah = (struct ip_auth_hdr*)(skb->data+offset); 412 struct ip_auth_hdr *ah = (struct ip_auth_hdr*)(skb->data+offset);
412 struct xfrm_state *x; 413 struct xfrm_state *x;
@@ -415,12 +416,12 @@ static void ah6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
415 type != ICMPV6_PKT_TOOBIG) 416 type != ICMPV6_PKT_TOOBIG)
416 return; 417 return;
417 418
418 x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, ah->spi, IPPROTO_AH, AF_INET6); 419 x = xfrm_state_lookup(net, (xfrm_address_t *)&iph->daddr, ah->spi, IPPROTO_AH, AF_INET6);
419 if (!x) 420 if (!x)
420 return; 421 return;
421 422
422 NETDEBUG(KERN_DEBUG "pmtu discovery on SA AH/%08x/" NIP6_FMT "\n", 423 NETDEBUG(KERN_DEBUG "pmtu discovery on SA AH/%08x/%pI6\n",
423 ntohl(ah->spi), NIP6(iph->daddr)); 424 ntohl(ah->spi), &iph->daddr);
424 425
425 xfrm_state_put(x); 426 xfrm_state_put(x);
426} 427}
@@ -509,9 +510,7 @@ static void ah6_destroy(struct xfrm_state *x)
509 return; 510 return;
510 511
511 kfree(ahp->work_icv); 512 kfree(ahp->work_icv);
512 ahp->work_icv = NULL;
513 crypto_free_hash(ahp->tfm); 513 crypto_free_hash(ahp->tfm);
514 ahp->tfm = NULL;
515 kfree(ahp); 514 kfree(ahp);
516} 515}
517 516