aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_ipv4.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r--net/ipv4/tcp_ipv4.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 01545a3fc0f2..087a8488843f 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -321,6 +321,14 @@ static void do_pmtu_discovery(struct sock *sk, const struct iphdr *iph, u32 mtu)
321 } /* else let the usual retransmit timer handle it */ 321 } /* else let the usual retransmit timer handle it */
322} 322}
323 323
324static void do_redirect(struct sk_buff *skb, struct sock *sk)
325{
326 struct dst_entry *dst = __sk_dst_check(sk, 0);
327
328 if (dst && dst->ops->redirect)
329 dst->ops->redirect(dst, skb);
330}
331
324/* 332/*
325 * This routine is called by the ICMP module when it gets some 333 * This routine is called by the ICMP module when it gets some
326 * sort of error condition. If err < 0 then the socket should 334 * sort of error condition. If err < 0 then the socket should
@@ -394,6 +402,9 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info)
394 } 402 }
395 403
396 switch (type) { 404 switch (type) {
405 case ICMP_REDIRECT:
406 do_redirect(icmp_skb, sk);
407 goto out;
397 case ICMP_SOURCE_QUENCH: 408 case ICMP_SOURCE_QUENCH:
398 /* Just silently ignore these. */ 409 /* Just silently ignore these. */
399 goto out; 410 goto out;