summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLorenzo Bianconi <lorenzo.bianconi@redhat.com>2019-02-06 19:18:04 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-02-23 09:04:25 +0100
commitae5e148272fd8a5fb65448c751d78c1c4cde959c (patch)
tree421925278b9eec682ddea1b1189c1d1c60d99a14 /include
parent9954fa277dfb69b4ff3304206197b7cd86920b04 (diff)
downloadlinux-stable-ae5e148272fd8a5fb65448c751d78c1c4cde959c.tar.gz
linux-stable-ae5e148272fd8a5fb65448c751d78c1c4cde959c.tar.bz2
linux-stable-ae5e148272fd8a5fb65448c751d78c1c4cde959c.zip
net: ipv4: use a dedicated counter for icmp_v4 redirect packets
[ Upstream commit c09551c6ff7fe16a79a42133bcecba5fc2fc3291 ] According to the algorithm described in the comment block at the beginning of ip_rt_send_redirect, the host should try to send 'ip_rt_redirect_number' ICMP redirect packets with an exponential backoff and then stop sending them at all assuming that the destination ignores redirects. If the device has previously sent some ICMP error packets that are rate-limited (e.g TTL expired) and continues to receive traffic, the redirect packets will never be transmitted. This happens since peer->rate_tokens will be typically greater than 'ip_rt_redirect_number' and so it will never be reset even if the redirect silence timeout (ip_rt_redirect_silence) has elapsed without receiving any packet requiring redirects. Fix it by using a dedicated counter for the number of ICMP redirect packets that has been sent by the host I have not been able to identify a given commit that introduced the issue since ip_rt_send_redirect implements the same rate-limiting algorithm from commit 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/net/inetpeer.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
index 80479abddf73..43c946450b32 100644
--- a/include/net/inetpeer.h
+++ b/include/net/inetpeer.h
@@ -35,6 +35,7 @@ struct inet_peer {
u32 metrics[RTAX_MAX];
u32 rate_tokens; /* rate limiting for ICMP */
+ u32 n_redirects;
unsigned long rate_last;
union {
struct list_head gc_list;