aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/fib_trie.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/fib_trie.c')
-rw-r--r--net/ipv4/fib_trie.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index d48a9bbcf54d..c7c5c6c802df 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -1831,10 +1831,7 @@ fn_trie_select_default(struct fib_table *tb, const struct flowi *flp, struct fib
1831 break; 1831 break;
1832 } else if (!fib_detect_death(fi, order, &last_resort, 1832 } else if (!fib_detect_death(fi, order, &last_resort,
1833 &last_idx, trie_last_dflt)) { 1833 &last_idx, trie_last_dflt)) {
1834 if (res->fi) 1834 fib_result_assign(res, fi);
1835 fib_info_put(res->fi);
1836 res->fi = fi;
1837 atomic_inc(&fi->fib_clntref);
1838 trie_last_dflt = order; 1835 trie_last_dflt = order;
1839 goto out; 1836 goto out;
1840 } 1837 }
@@ -1847,20 +1844,12 @@ fn_trie_select_default(struct fib_table *tb, const struct flowi *flp, struct fib
1847 } 1844 }
1848 1845
1849 if (!fib_detect_death(fi, order, &last_resort, &last_idx, trie_last_dflt)) { 1846 if (!fib_detect_death(fi, order, &last_resort, &last_idx, trie_last_dflt)) {
1850 if (res->fi) 1847 fib_result_assign(res, fi);
1851 fib_info_put(res->fi);
1852 res->fi = fi;
1853 atomic_inc(&fi->fib_clntref);
1854 trie_last_dflt = order; 1848 trie_last_dflt = order;
1855 goto out; 1849 goto out;
1856 } 1850 }
1857 if (last_idx >= 0) { 1851 if (last_idx >= 0)
1858 if (res->fi) 1852 fib_result_assign(res, last_resort);
1859 fib_info_put(res->fi);
1860 res->fi = last_resort;
1861 if (last_resort)
1862 atomic_inc(&last_resort->fib_clntref);
1863 }
1864 trie_last_dflt = last_idx; 1853 trie_last_dflt = last_idx;
1865 out:; 1854 out:;
1866 rcu_read_unlock(); 1855 rcu_read_unlock();