405 } |
405 } |
406 |
406 |
407 static void ah6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, |
407 static 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; |
413 |
414 |
414 if (type != ICMPV6_DEST_UNREACH && |
415 if (type != ICMPV6_DEST_UNREACH && |
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 } |
427 |
428 |
428 static int ah6_init_state(struct xfrm_state *x) |
429 static int ah6_init_state(struct xfrm_state *x) |