diff options
author | Steffen Klassert <steffen.klassert@secunet.com> | 2012-03-06 16:21:10 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-03-08 03:30:32 -0500 |
commit | ac3f48de09d8f4b73397047e413fadff7f65cfa7 (patch) | |
tree | ae13a0ca68397df2792e064b0877376d106a2030 | |
parent | 5faa5df1fa2024bd750089ff21dcc4191798263d (diff) |
route: Remove redirect_genid
As we invalidate the inetpeer tree along with the routing cache now,
we don't need a genid to reset the redirect handling when the routing
cache is flushed.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/inetpeer.h | 1 | ||||
-rw-r--r-- | net/ipv4/inetpeer.c | 1 | ||||
-rw-r--r-- | net/ipv4/route.c | 11 |
3 files changed, 2 insertions, 11 deletions
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h index ff04a33acf00..b94765e38e80 100644 --- a/include/net/inetpeer.h +++ b/include/net/inetpeer.h | |||
@@ -35,7 +35,6 @@ struct inet_peer { | |||
35 | 35 | ||
36 | u32 metrics[RTAX_MAX]; | 36 | u32 metrics[RTAX_MAX]; |
37 | u32 rate_tokens; /* rate limiting for ICMP */ | 37 | u32 rate_tokens; /* rate limiting for ICMP */ |
38 | int redirect_genid; | ||
39 | unsigned long rate_last; | 38 | unsigned long rate_last; |
40 | unsigned long pmtu_expires; | 39 | unsigned long pmtu_expires; |
41 | u32 pmtu_orig; | 40 | u32 pmtu_orig; |
diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c index deea2e96b7f2..d4d61b694fab 100644 --- a/net/ipv4/inetpeer.c +++ b/net/ipv4/inetpeer.c | |||
@@ -498,7 +498,6 @@ relookup: | |||
498 | p->rate_last = 0; | 498 | p->rate_last = 0; |
499 | p->pmtu_expires = 0; | 499 | p->pmtu_expires = 0; |
500 | p->pmtu_orig = 0; | 500 | p->pmtu_orig = 0; |
501 | p->redirect_genid = 0; | ||
502 | memset(&p->redirect_learned, 0, sizeof(p->redirect_learned)); | 501 | memset(&p->redirect_learned, 0, sizeof(p->redirect_learned)); |
503 | INIT_LIST_HEAD(&p->gc_list); | 502 | INIT_LIST_HEAD(&p->gc_list); |
504 | 503 | ||
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 23ce0c1287ab..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,6 @@ 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++; | ||
941 | inetpeer_invalidate_tree(AF_INET); | 939 | inetpeer_invalidate_tree(AF_INET); |
942 | } | 940 | } |
943 | 941 | ||
@@ -1486,10 +1484,8 @@ void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 new_gw, | |||
1486 | 1484 | ||
1487 | peer = rt->peer; | 1485 | peer = rt->peer; |
1488 | if (peer) { | 1486 | if (peer) { |
1489 | if (peer->redirect_learned.a4 != new_gw || | 1487 | if (peer->redirect_learned.a4 != new_gw) { |
1490 | peer->redirect_genid != redirect_genid) { | ||
1491 | peer->redirect_learned.a4 = new_gw; | 1488 | peer->redirect_learned.a4 = new_gw; |
1492 | peer->redirect_genid = redirect_genid; | ||
1493 | atomic_inc(&__rt_peer_genid); | 1489 | atomic_inc(&__rt_peer_genid); |
1494 | } | 1490 | } |
1495 | check_peer_redir(&rt->dst, peer); | 1491 | check_peer_redir(&rt->dst, peer); |
@@ -1794,8 +1790,6 @@ static void ipv4_validate_peer(struct rtable *rt) | |||
1794 | if (peer) { | 1790 | if (peer) { |
1795 | check_peer_pmtu(&rt->dst, peer); | 1791 | check_peer_pmtu(&rt->dst, peer); |
1796 | 1792 | ||
1797 | if (peer->redirect_genid != redirect_genid) | ||
1798 | peer->redirect_learned.a4 = 0; | ||
1799 | if (peer->redirect_learned.a4 && | 1793 | if (peer->redirect_learned.a4 && |
1800 | peer->redirect_learned.a4 != rt->rt_gateway) | 1794 | peer->redirect_learned.a4 != rt->rt_gateway) |
1801 | check_peer_redir(&rt->dst, peer); | 1795 | check_peer_redir(&rt->dst, peer); |
@@ -1959,8 +1953,7 @@ static void rt_init_metrics(struct rtable *rt, const struct flowi4 *fl4, | |||
1959 | dst_init_metrics(&rt->dst, peer->metrics, false); | 1953 | dst_init_metrics(&rt->dst, peer->metrics, false); |
1960 | 1954 | ||
1961 | check_peer_pmtu(&rt->dst, peer); | 1955 | check_peer_pmtu(&rt->dst, peer); |
1962 | if (peer->redirect_genid != redirect_genid) | 1956 | |
1963 | peer->redirect_learned.a4 = 0; | ||
1964 | if (peer->redirect_learned.a4 && | 1957 | if (peer->redirect_learned.a4 && |
1965 | peer->redirect_learned.a4 != rt->rt_gateway) { | 1958 | peer->redirect_learned.a4 != rt->rt_gateway) { |
1966 | rt->rt_gateway = peer->redirect_learned.a4; | 1959 | rt->rt_gateway = peer->redirect_learned.a4; |