diff options
author | David S. Miller <davem@davemloft.net> | 2012-07-11 21:27:49 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-11 21:27:49 -0700 |
commit | 55be7a9c6074f749d617a7fc1914c9a23505438c (patch) | |
tree | 507268878abc1c5f5476823264b6f9f8acefa205 /net/ipv4/ah4.c | |
parent | b42597e2f36e2043756aa7462faddf630962f061 (diff) | |
download | linux-stable-55be7a9c6074f749d617a7fc1914c9a23505438c.tar.gz linux-stable-55be7a9c6074f749d617a7fc1914c9a23505438c.tar.bz2 linux-stable-55be7a9c6074f749d617a7fc1914c9a23505438c.zip |
ipv4: Add redirect support to all protocol icmp error handlers.
Signed-off-by: David S. Miller <davem@davemloft.net>
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) struct ip_auth_hdr *ah = (struct ip_auth_hdr *)(skb->data+(iph->ihl<<2)); struct xfrm_state *x; - if (icmp_hdr(skb)->type != ICMP_DEST_UNREACH || - icmp_hdr(skb)->code != ICMP_FRAG_NEEDED) + switch (icmp_hdr(skb)->type) { + case ICMP_DEST_UNREACH: + if (icmp_hdr(skb)->code != ICMP_FRAG_NEEDED) + return; + case ICMP_REDIRECT: + break; + default: return; + } x = xfrm_state_lookup(net, skb->mark, (const xfrm_address_t *)&iph->daddr, ah->spi, IPPROTO_AH, AF_INET); if (!x) return; - pr_debug("pmtu discovery on SA AH/%08x/%08x\n", - ntohl(ah->spi), ntohl(iph->daddr)); - ipv4_update_pmtu(skb, net, info, 0, 0, IPPROTO_AH, 0); + + if (icmp_hdr(skb)->type == ICMP_DEST_UNREACH) + ipv4_update_pmtu(skb, net, info, 0, 0, IPPROTO_AH, 0); + else + ipv4_redirect(skb, net, 0, 0, IPPROTO_AH, 0); xfrm_state_put(x); } |