aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/fib_trie.c
diff options
context:
space:
mode:
authorIgor Maravic <igorm@etf.rs>2012-08-13 04:26:08 -0400
committerDavid S. Miller <davem@davemloft.net>2012-08-14 18:02:20 -0400
commitad5b310228da567e35a2ea5dcb2fd62e3a36654e (patch)
tree4c2291a9c0026e8ff3080dc612b9e6bd7dcc54b6 /net/ipv4/fib_trie.c
parent418a99ac6ad487dc9c42e6b0e85f941af56330f2 (diff)
net: ipv4: fib_trie: Don't unnecessarily search for already found fib leaf
We've already found leaf, don't search for it again. Same is for fib leaf info. Signed-off-by: Igor Maravic <igorm@etf.rs> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/fib_trie.c')
-rw-r--r--net/ipv4/fib_trie.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index f84a0e90d675..4587d344046d 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -1656,7 +1656,12 @@ int fib_table_delete(struct fib_table *tb, struct fib_config *cfg)
1656 if (!l) 1656 if (!l)
1657 return -ESRCH; 1657 return -ESRCH;
1658 1658
1659 fa_head = get_fa_head(l, plen); 1659 li = find_leaf_info(l, plen);
1660
1661 if (!li)
1662 return -ESRCH;
1663
1664 fa_head = &li->falh;
1660 fa = fib_find_alias(fa_head, tos, 0); 1665 fa = fib_find_alias(fa_head, tos, 0);
1661 1666
1662 if (!fa) 1667 if (!fa)
@@ -1692,9 +1697,6 @@ int fib_table_delete(struct fib_table *tb, struct fib_config *cfg)
1692 rtmsg_fib(RTM_DELROUTE, htonl(key), fa, plen, tb->tb_id, 1697 rtmsg_fib(RTM_DELROUTE, htonl(key), fa, plen, tb->tb_id,
1693 &cfg->fc_nlinfo, 0); 1698 &cfg->fc_nlinfo, 0);
1694 1699
1695 l = fib_find_node(t, key);
1696 li = find_leaf_info(l, plen);
1697
1698 list_del_rcu(&fa->fa_list); 1700 list_del_rcu(&fa->fa_list);
1699 1701
1700 if (!plen) 1702 if (!plen)