提交 ac3f48de 编写于 作者: S Steffen Klassert 提交者: David S. Miller

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: NSteffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 5faa5df1
...@@ -35,7 +35,6 @@ struct inet_peer { ...@@ -35,7 +35,6 @@ struct inet_peer {
u32 metrics[RTAX_MAX]; u32 metrics[RTAX_MAX];
u32 rate_tokens; /* rate limiting for ICMP */ u32 rate_tokens; /* rate limiting for ICMP */
int redirect_genid;
unsigned long rate_last; unsigned long rate_last;
unsigned long pmtu_expires; unsigned long pmtu_expires;
u32 pmtu_orig; u32 pmtu_orig;
......
...@@ -498,7 +498,6 @@ struct inet_peer *inet_getpeer(const struct inetpeer_addr *daddr, int create) ...@@ -498,7 +498,6 @@ struct inet_peer *inet_getpeer(const struct inetpeer_addr *daddr, int create)
p->rate_last = 0; p->rate_last = 0;
p->pmtu_expires = 0; p->pmtu_expires = 0;
p->pmtu_orig = 0; p->pmtu_orig = 0;
p->redirect_genid = 0;
memset(&p->redirect_learned, 0, sizeof(p->redirect_learned)); memset(&p->redirect_learned, 0, sizeof(p->redirect_learned));
INIT_LIST_HEAD(&p->gc_list); INIT_LIST_HEAD(&p->gc_list);
......
...@@ -132,7 +132,6 @@ static int ip_rt_mtu_expires __read_mostly = 10 * 60 * HZ; ...@@ -132,7 +132,6 @@ static int ip_rt_mtu_expires __read_mostly = 10 * 60 * HZ;
static int ip_rt_min_pmtu __read_mostly = 512 + 20 + 20; static int ip_rt_min_pmtu __read_mostly = 512 + 20 + 20;
static int ip_rt_min_advmss __read_mostly = 256; static int ip_rt_min_advmss __read_mostly = 256;
static int rt_chain_length_max __read_mostly = 20; static int rt_chain_length_max __read_mostly = 20;
static int redirect_genid;
static struct delayed_work expires_work; static struct delayed_work expires_work;
static unsigned long expires_ljiffies; static unsigned long expires_ljiffies;
...@@ -937,7 +936,6 @@ static void rt_cache_invalidate(struct net *net) ...@@ -937,7 +936,6 @@ static void rt_cache_invalidate(struct net *net)
get_random_bytes(&shuffle, sizeof(shuffle)); get_random_bytes(&shuffle, sizeof(shuffle));
atomic_add(shuffle + 1U, &net->ipv4.rt_genid); atomic_add(shuffle + 1U, &net->ipv4.rt_genid);
redirect_genid++;
inetpeer_invalidate_tree(AF_INET); inetpeer_invalidate_tree(AF_INET);
} }
...@@ -1486,10 +1484,8 @@ void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 new_gw, ...@@ -1486,10 +1484,8 @@ void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 new_gw,
peer = rt->peer; peer = rt->peer;
if (peer) { if (peer) {
if (peer->redirect_learned.a4 != new_gw || if (peer->redirect_learned.a4 != new_gw) {
peer->redirect_genid != redirect_genid) {
peer->redirect_learned.a4 = new_gw; peer->redirect_learned.a4 = new_gw;
peer->redirect_genid = redirect_genid;
atomic_inc(&__rt_peer_genid); atomic_inc(&__rt_peer_genid);
} }
check_peer_redir(&rt->dst, peer); check_peer_redir(&rt->dst, peer);
...@@ -1794,8 +1790,6 @@ static void ipv4_validate_peer(struct rtable *rt) ...@@ -1794,8 +1790,6 @@ static void ipv4_validate_peer(struct rtable *rt)
if (peer) { if (peer) {
check_peer_pmtu(&rt->dst, peer); check_peer_pmtu(&rt->dst, peer);
if (peer->redirect_genid != redirect_genid)
peer->redirect_learned.a4 = 0;
if (peer->redirect_learned.a4 && if (peer->redirect_learned.a4 &&
peer->redirect_learned.a4 != rt->rt_gateway) peer->redirect_learned.a4 != rt->rt_gateway)
check_peer_redir(&rt->dst, peer); check_peer_redir(&rt->dst, peer);
...@@ -1959,8 +1953,7 @@ static void rt_init_metrics(struct rtable *rt, const struct flowi4 *fl4, ...@@ -1959,8 +1953,7 @@ static void rt_init_metrics(struct rtable *rt, const struct flowi4 *fl4,
dst_init_metrics(&rt->dst, peer->metrics, false); dst_init_metrics(&rt->dst, peer->metrics, false);
check_peer_pmtu(&rt->dst, peer); check_peer_pmtu(&rt->dst, peer);
if (peer->redirect_genid != redirect_genid)
peer->redirect_learned.a4 = 0;
if (peer->redirect_learned.a4 && if (peer->redirect_learned.a4 &&
peer->redirect_learned.a4 != rt->rt_gateway) { peer->redirect_learned.a4 != rt->rt_gateway) {
rt->rt_gateway = peer->redirect_learned.a4; rt->rt_gateway = peer->redirect_learned.a4;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册