diff options
author | David S. Miller <davem@davemloft.net> | 2012-07-12 00:27:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-12 00:27:49 -0400 |
commit | 55be7a9c6074f749d617a7fc1914c9a23505438c (patch) | |
tree | 507268878abc1c5f5476823264b6f9f8acefa205 /net/dccp/ipv4.c | |
parent | b42597e2f36e2043756aa7462faddf630962f061 (diff) |
ipv4: Add redirect support to all protocol icmp error handlers.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/ipv4.c')
-rw-r--r-- | net/dccp/ipv4.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index 3eb76b5f221a..8f41a3190858 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
@@ -195,6 +195,14 @@ static inline void dccp_do_pmtu_discovery(struct sock *sk, | |||
195 | } /* else let the usual retransmit timer handle it */ | 195 | } /* else let the usual retransmit timer handle it */ |
196 | } | 196 | } |
197 | 197 | ||
198 | static void dccp_do_redirect(struct sk_buff *skb, struct sock *sk) | ||
199 | { | ||
200 | struct dst_entry *dst = __sk_dst_check(sk, 0); | ||
201 | |||
202 | if (dst && dst->ops->redirect) | ||
203 | dst->ops->redirect(dst, skb); | ||
204 | } | ||
205 | |||
198 | /* | 206 | /* |
199 | * This routine is called by the ICMP module when it gets some sort of error | 207 | * This routine is called by the ICMP module when it gets some sort of error |
200 | * condition. If err < 0 then the socket should be closed and the error | 208 | * condition. If err < 0 then the socket should be closed and the error |
@@ -259,6 +267,9 @@ static void dccp_v4_err(struct sk_buff *skb, u32 info) | |||
259 | } | 267 | } |
260 | 268 | ||
261 | switch (type) { | 269 | switch (type) { |
270 | case ICMP_REDIRECT: | ||
271 | dccp_do_redirect(skb, sk); | ||
272 | goto out; | ||
262 | case ICMP_SOURCE_QUENCH: | 273 | case ICMP_SOURCE_QUENCH: |
263 | /* Just silently ignore these. */ | 274 | /* Just silently ignore these. */ |
264 | goto out; | 275 | goto out; |