diff options
author | Igor Maravic <igorm@etf.rs> | 2012-08-13 10:26:08 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-08-14 15:02:20 -0700 |
commit | ad5b310228da567e35a2ea5dcb2fd62e3a36654e (patch) | |
tree | 4c2291a9c0026e8ff3080dc612b9e6bd7dcc54b6 /net/ipv4/fib_trie.c | |
parent | 418a99ac6ad487dc9c42e6b0e85f941af56330f2 (diff) | |
download | op-kernel-dev-ad5b310228da567e35a2ea5dcb2fd62e3a36654e.zip op-kernel-dev-ad5b310228da567e35a2ea5dcb2fd62e3a36654e.tar.gz |
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.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index f84a0e9..4587d34 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) if (!l) return -ESRCH; - fa_head = get_fa_head(l, plen); + li = find_leaf_info(l, plen); + + if (!li) + return -ESRCH; + + fa_head = &li->falh; fa = fib_find_alias(fa_head, tos, 0); if (!fa) @@ -1692,9 +1697,6 @@ int fib_table_delete(struct fib_table *tb, struct fib_config *cfg) rtmsg_fib(RTM_DELROUTE, htonl(key), fa, plen, tb->tb_id, &cfg->fc_nlinfo, 0); - l = fib_find_node(t, key); - li = find_leaf_info(l, plen); - list_del_rcu(&fa->fa_list); if (!plen) |