]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.6.7/ipv4-fix-flushing-of-cached-routing-informations.patch
Linux 3.6.7
[thirdparty/kernel/stable-queue.git] / releases / 3.6.7 / ipv4-fix-flushing-of-cached-routing-informations.patch
CommitLineData
28cd9a8f
GKH
1From d0469d7ba38ac653c329264326f234440b1c8866 Mon Sep 17 00:00:00 2001
2From: Steffen Klassert <steffen.klassert@secunet.com>
3Date: Wed, 17 Oct 2012 21:17:44 +0000
4Subject: ipv4: Fix flushing of cached routing informations
5
6
7From: Steffen Klassert <steffen.klassert@secunet.com>
8
9[ Upstream commit 13d82bf50dce632355fcccafa4fe44a9b5e706d8 ]
10
11Currently we can not flush cached pmtu/redirect informations via
12the ipv4_sysctl_rtcache_flush sysctl. We need to check the rt_genid
13of the old route and reset the nh exeption if the old route is
14expired when we bind a new route to a nh exeption.
15
16Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
17Acked-by: Eric Dumazet <edumazet@google.com>
18Signed-off-by: David S. Miller <davem@davemloft.net>
19Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20---
21 net/ipv4/route.c | 9 ++++++---
22 1 file changed, 6 insertions(+), 3 deletions(-)
23
24--- a/net/ipv4/route.c
25+++ b/net/ipv4/route.c
26@@ -1166,8 +1166,12 @@ static bool rt_bind_exception(struct rta
27 spin_lock_bh(&fnhe_lock);
28
29 if (daddr == fnhe->fnhe_daddr) {
30- struct rtable *orig;
31-
32+ struct rtable *orig = rcu_dereference(fnhe->fnhe_rth);
33+ if (orig && rt_is_expired(orig)) {
34+ fnhe->fnhe_gw = 0;
35+ fnhe->fnhe_pmtu = 0;
36+ fnhe->fnhe_expires = 0;
37+ }
38 if (fnhe->fnhe_pmtu) {
39 unsigned long expires = fnhe->fnhe_expires;
40 unsigned long diff = expires - jiffies;
41@@ -1184,7 +1188,6 @@ static bool rt_bind_exception(struct rta
42 } else if (!rt->rt_gateway)
43 rt->rt_gateway = daddr;
44
45- orig = rcu_dereference(fnhe->fnhe_rth);
46 rcu_assign_pointer(fnhe->fnhe_rth, rt);
47 if (orig)
48 rt_free(orig);