aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/esp4.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-07-12 00:27:49 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-12 00:27:49 -0400
commit55be7a9c6074f749d617a7fc1914c9a23505438c (patch)
tree507268878abc1c5f5476823264b6f9f8acefa205 /net/ipv4/esp4.c
parentb42597e2f36e2043756aa7462faddf630962f061 (diff)
ipv4: Add redirect support to all protocol icmp error handlers.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/esp4.c')
-rw-r--r--net/ipv4/esp4.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c
index 7b95b49a36ce..b61e9deb7c7e 100644
--- a/net/ipv4/esp4.c
+++ b/net/ipv4/esp4.c
@@ -484,17 +484,25 @@ static void esp4_err(struct sk_buff *skb, u32 info)
484 struct ip_esp_hdr *esph = (struct ip_esp_hdr *)(skb->data+(iph->ihl<<2)); 484 struct ip_esp_hdr *esph = (struct ip_esp_hdr *)(skb->data+(iph->ihl<<2));
485 struct xfrm_state *x; 485 struct xfrm_state *x;
486 486
487 if (icmp_hdr(skb)->type != ICMP_DEST_UNREACH || 487 switch (icmp_hdr(skb)->type) {
488 icmp_hdr(skb)->code != ICMP_FRAG_NEEDED) 488 case ICMP_DEST_UNREACH:
489 if (icmp_hdr(skb)->code != ICMP_FRAG_NEEDED)
490 return;
491 case ICMP_REDIRECT:
492 break;
493 default:
489 return; 494 return;
495 }
490 496
491 x = xfrm_state_lookup(net, skb->mark, (const xfrm_address_t *)&iph->daddr, 497 x = xfrm_state_lookup(net, skb->mark, (const xfrm_address_t *)&iph->daddr,
492 esph->spi, IPPROTO_ESP, AF_INET); 498 esph->spi, IPPROTO_ESP, AF_INET);
493 if (!x) 499 if (!x)
494 return; 500 return;
495 NETDEBUG(KERN_DEBUG "pmtu discovery on SA ESP/%08x/%08x\n", 501
496 ntohl(esph->spi), ntohl(iph->daddr)); 502 if (icmp_hdr(skb)->type == ICMP_DEST_UNREACH)
497 ipv4_update_pmtu(skb, net, info, 0, 0, IPPROTO_ESP, 0); 503 ipv4_update_pmtu(skb, net, info, 0, 0, IPPROTO_ESP, 0);
504 else
505 ipv4_redirect(skb, net, 0, 0, IPPROTO_ESP, 0);
498 xfrm_state_put(x); 506 xfrm_state_put(x);
499} 507}
500 508