Commit ac3f48de09d8f4b73397047e413fadff7f65cfa7
Committed by
David S. Miller
1 parent
5faa5df1fa
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
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>
Showing 3 changed files with 2 additions and 11 deletions Side-by-side Diff
include/net/inetpeer.h
net/ipv4/inetpeer.c
net/ipv4/route.c
... | ... | @@ -132,7 +132,6 @@ |
132 | 132 | static int ip_rt_min_pmtu __read_mostly = 512 + 20 + 20; |
133 | 133 | static int ip_rt_min_advmss __read_mostly = 256; |
134 | 134 | static int rt_chain_length_max __read_mostly = 20; |
135 | -static int redirect_genid; | |
136 | 135 | |
137 | 136 | static struct delayed_work expires_work; |
138 | 137 | static unsigned long expires_ljiffies; |
... | ... | @@ -937,7 +936,6 @@ |
937 | 936 | |
938 | 937 | get_random_bytes(&shuffle, sizeof(shuffle)); |
939 | 938 | atomic_add(shuffle + 1U, &net->ipv4.rt_genid); |
940 | - redirect_genid++; | |
941 | 939 | inetpeer_invalidate_tree(AF_INET); |
942 | 940 | } |
943 | 941 | |
944 | 942 | |
... | ... | @@ -1486,10 +1484,8 @@ |
1486 | 1484 | |
1487 | 1485 | peer = rt->peer; |
1488 | 1486 | if (peer) { |
1489 | - if (peer->redirect_learned.a4 != new_gw || | |
1490 | - peer->redirect_genid != redirect_genid) { | |
1487 | + if (peer->redirect_learned.a4 != new_gw) { | |
1491 | 1488 | peer->redirect_learned.a4 = new_gw; |
1492 | - peer->redirect_genid = redirect_genid; | |
1493 | 1489 | atomic_inc(&__rt_peer_genid); |
1494 | 1490 | } |
1495 | 1491 | check_peer_redir(&rt->dst, peer); |
... | ... | @@ -1794,8 +1790,6 @@ |
1794 | 1790 | if (peer) { |
1795 | 1791 | check_peer_pmtu(&rt->dst, peer); |
1796 | 1792 | |
1797 | - if (peer->redirect_genid != redirect_genid) | |
1798 | - peer->redirect_learned.a4 = 0; | |
1799 | 1793 | if (peer->redirect_learned.a4 && |
1800 | 1794 | peer->redirect_learned.a4 != rt->rt_gateway) |
1801 | 1795 | check_peer_redir(&rt->dst, peer); |
... | ... | @@ -1959,8 +1953,7 @@ |
1959 | 1953 | dst_init_metrics(&rt->dst, peer->metrics, false); |
1960 | 1954 | |
1961 | 1955 | check_peer_pmtu(&rt->dst, peer); |
1962 | - if (peer->redirect_genid != redirect_genid) | |
1963 | - peer->redirect_learned.a4 = 0; | |
1956 | + | |
1964 | 1957 | if (peer->redirect_learned.a4 && |
1965 | 1958 | peer->redirect_learned.a4 != rt->rt_gateway) { |
1966 | 1959 | rt->rt_gateway = peer->redirect_learned.a4; |