diff options
Diffstat (limited to 'net/ipv4/ah4.c')
-rw-r--r-- | net/ipv4/ah4.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c index 916d5ecaf6c6..a0d8392491c3 100644 --- a/net/ipv4/ah4.c +++ b/net/ipv4/ah4.c | |||
@@ -398,17 +398,25 @@ static void ah4_err(struct sk_buff *skb, u32 info) | |||
398 | struct ip_auth_hdr *ah = (struct ip_auth_hdr *)(skb->data+(iph->ihl<<2)); | 398 | struct ip_auth_hdr *ah = (struct ip_auth_hdr *)(skb->data+(iph->ihl<<2)); |
399 | struct xfrm_state *x; | 399 | struct xfrm_state *x; |
400 | 400 | ||
401 | if (icmp_hdr(skb)->type != ICMP_DEST_UNREACH || | 401 | switch (icmp_hdr(skb)->type) { |
402 | icmp_hdr(skb)->code != ICMP_FRAG_NEEDED) | 402 | case ICMP_DEST_UNREACH: |
403 | if (icmp_hdr(skb)->code != ICMP_FRAG_NEEDED) | ||
404 | return; | ||
405 | case ICMP_REDIRECT: | ||
406 | break; | ||
407 | default: | ||
403 | return; | 408 | return; |
409 | } | ||
404 | 410 | ||
405 | x = xfrm_state_lookup(net, skb->mark, (const xfrm_address_t *)&iph->daddr, | 411 | x = xfrm_state_lookup(net, skb->mark, (const xfrm_address_t *)&iph->daddr, |
406 | ah->spi, IPPROTO_AH, AF_INET); | 412 | ah->spi, IPPROTO_AH, AF_INET); |
407 | if (!x) | 413 | if (!x) |
408 | return; | 414 | return; |
409 | pr_debug("pmtu discovery on SA AH/%08x/%08x\n", | 415 | |
410 | ntohl(ah->spi), ntohl(iph->daddr)); | 416 | if (icmp_hdr(skb)->type == ICMP_DEST_UNREACH) |
411 | ipv4_update_pmtu(skb, net, info, 0, 0, IPPROTO_AH, 0); | 417 | ipv4_update_pmtu(skb, net, info, 0, 0, IPPROTO_AH, 0); |
418 | else | ||
419 | ipv4_redirect(skb, net, 0, 0, IPPROTO_AH, 0); | ||
412 | xfrm_state_put(x); | 420 | xfrm_state_put(x); |
413 | } | 421 | } |
414 | 422 | ||