diff options
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r-- | net/ipv4/route.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index bcacf54e5418..019774796174 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -132,7 +132,6 @@ static int ip_rt_mtu_expires __read_mostly = 10 * 60 * HZ; | |||
132 | static int ip_rt_min_pmtu __read_mostly = 512 + 20 + 20; | 132 | static int ip_rt_min_pmtu __read_mostly = 512 + 20 + 20; |
133 | static int ip_rt_min_advmss __read_mostly = 256; | 133 | static int ip_rt_min_advmss __read_mostly = 256; |
134 | static int rt_chain_length_max __read_mostly = 20; | 134 | static int rt_chain_length_max __read_mostly = 20; |
135 | static int redirect_genid; | ||
136 | 135 | ||
137 | static struct delayed_work expires_work; | 136 | static struct delayed_work expires_work; |
138 | static unsigned long expires_ljiffies; | 137 | static unsigned long expires_ljiffies; |
@@ -937,7 +936,7 @@ static void rt_cache_invalidate(struct net *net) | |||
937 | 936 | ||
938 | get_random_bytes(&shuffle, sizeof(shuffle)); | 937 | get_random_bytes(&shuffle, sizeof(shuffle)); |
939 | atomic_add(shuffle + 1U, &net->ipv4.rt_genid); | 938 | atomic_add(shuffle + 1U, &net->ipv4.rt_genid); |
940 | redirect_genid++; | 939 | inetpeer_invalidate_tree(AF_INET); |
941 | } | 940 | } |
942 | 941 | ||
943 | /* | 942 | /* |
@@ -1485,10 +1484,8 @@ void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 new_gw, | |||
1485 | 1484 | ||
1486 | peer = rt->peer; | 1485 | peer = rt->peer; |
1487 | if (peer) { | 1486 | if (peer) { |
1488 | if (peer->redirect_learned.a4 != new_gw || | 1487 | if (peer->redirect_learned.a4 != new_gw) { |
1489 | peer->redirect_genid != redirect_genid) { | ||
1490 | peer->redirect_learned.a4 = new_gw; | 1488 | peer->redirect_learned.a4 = new_gw; |
1491 | peer->redirect_genid = redirect_genid; | ||
1492 | atomic_inc(&__rt_peer_genid); | 1489 | atomic_inc(&__rt_peer_genid); |
1493 | } | 1490 | } |
1494 | check_peer_redir(&rt->dst, peer); | 1491 | check_peer_redir(&rt->dst, peer); |
@@ -1793,8 +1790,6 @@ static void ipv4_validate_peer(struct rtable *rt) | |||
1793 | if (peer) { | 1790 | if (peer) { |
1794 | check_peer_pmtu(&rt->dst, peer); | 1791 | check_peer_pmtu(&rt->dst, peer); |
1795 | 1792 | ||
1796 | if (peer->redirect_genid != redirect_genid) | ||
1797 | peer->redirect_learned.a4 = 0; | ||
1798 | if (peer->redirect_learned.a4 && | 1793 | if (peer->redirect_learned.a4 && |
1799 | peer->redirect_learned.a4 != rt->rt_gateway) | 1794 | peer->redirect_learned.a4 != rt->rt_gateway) |
1800 | check_peer_redir(&rt->dst, peer); | 1795 | check_peer_redir(&rt->dst, peer); |
@@ -1958,8 +1953,7 @@ static void rt_init_metrics(struct rtable *rt, const struct flowi4 *fl4, | |||
1958 | dst_init_metrics(&rt->dst, peer->metrics, false); | 1953 | dst_init_metrics(&rt->dst, peer->metrics, false); |
1959 | 1954 | ||
1960 | check_peer_pmtu(&rt->dst, peer); | 1955 | check_peer_pmtu(&rt->dst, peer); |
1961 | if (peer->redirect_genid != redirect_genid) | 1956 | |
1962 | peer->redirect_learned.a4 = 0; | ||
1963 | if (peer->redirect_learned.a4 && | 1957 | if (peer->redirect_learned.a4 && |
1964 | peer->redirect_learned.a4 != rt->rt_gateway) { | 1958 | peer->redirect_learned.a4 != rt->rt_gateway) { |
1965 | rt->rt_gateway = peer->redirect_learned.a4; | 1959 | rt->rt_gateway = peer->redirect_learned.a4; |