aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_ipv4.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-07-11 21:27:49 -0700
committerDavid S. Miller <davem@davemloft.net>2012-07-11 21:27:49 -0700
commit55be7a9c6074f749d617a7fc1914c9a23505438c (patch)
tree507268878abc1c5f5476823264b6f9f8acefa205 /net/ipv4/tcp_ipv4.c
parentipv4: Add ipv4_redirect() and ipv4_sk_redirect() helper functions. (diff)
downloadlinux-dev-55be7a9c6074f749d617a7fc1914c9a23505438c.tar.xz
linux-dev-55be7a9c6074f749d617a7fc1914c9a23505438c.zip
ipv4: Add redirect support to all protocol icmp error handlers.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-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)
} /* else let the usual retransmit timer handle it */
}
+static void do_redirect(struct sk_buff *skb, struct sock *sk)
+{
+ struct dst_entry *dst = __sk_dst_check(sk, 0);
+
+ if (dst && dst->ops->redirect)
+ dst->ops->redirect(dst, skb);
+}
+
/*
* This routine is called by the ICMP module when it gets some
* 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)
}
switch (type) {
+ case ICMP_REDIRECT:
+ do_redirect(icmp_skb, sk);
+ goto out;
case ICMP_SOURCE_QUENCH:
/* Just silently ignore these. */
goto out;