aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipcomp.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/ipcomp.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/ipcomp.c')
-rw-r--r--net/ipv4/ipcomp.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c
index b91375482d84..d3ab47e19a89 100644
--- a/net/ipv4/ipcomp.c
+++ b/net/ipv4/ipcomp.c
@@ -31,18 +31,26 @@ static void ipcomp4_err(struct sk_buff *skb, u32 info)
31 struct ip_comp_hdr *ipch = (struct ip_comp_hdr *)(skb->data+(iph->ihl<<2)); 31 struct ip_comp_hdr *ipch = (struct ip_comp_hdr *)(skb->data+(iph->ihl<<2));
32 struct xfrm_state *x; 32 struct xfrm_state *x;
33 33
34 if (icmp_hdr(skb)->type != ICMP_DEST_UNREACH || 34 switch (icmp_hdr(skb)->type) {
35 icmp_hdr(skb)->code != ICMP_FRAG_NEEDED) 35 case ICMP_DEST_UNREACH:
36 if (icmp_hdr(skb)->code != ICMP_FRAG_NEEDED)
37 return;
38 case ICMP_REDIRECT:
39 break;
40 default:
36 return; 41 return;
42 }
37 43
38 spi = htonl(ntohs(ipch->cpi)); 44 spi = htonl(ntohs(ipch->cpi));
39 x = xfrm_state_lookup(net, skb->mark, (const xfrm_address_t *)&iph->daddr, 45 x = xfrm_state_lookup(net, skb->mark, (const xfrm_address_t *)&iph->daddr,
40 spi, IPPROTO_COMP, AF_INET); 46 spi, IPPROTO_COMP, AF_INET);
41 if (!x) 47 if (!x)
42 return; 48 return;
43 NETDEBUG(KERN_DEBUG "pmtu discovery on SA IPCOMP/%08x/%pI4\n", 49
44 spi, &iph->daddr); 50 if (icmp_hdr(skb)->type == ICMP_DEST_UNREACH)
45 ipv4_update_pmtu(skb, net, info, 0, 0, IPPROTO_COMP, 0); 51 ipv4_update_pmtu(skb, net, info, 0, 0, IPPROTO_COMP, 0);
52 else
53 ipv4_redirect(skb, net, 0, 0, IPPROTO_COMP, 0);
46 xfrm_state_put(x); 54 xfrm_state_put(x);
47} 55}
48 56