Turn the unused size field into a useful counter for the number
of routes.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>


--- a/net/ipv4/fib_trie.c       2008-01-11 22:30:28.000000000 -0800
+++ b/net/ipv4/fib_trie.c       2008-01-11 22:30:36.000000000 -0800
@@ -149,10 +149,10 @@ struct trie_stat {
 
 struct trie {
        struct node *trie;
+       unsigned int size;
 #ifdef CONFIG_IP_FIB_TRIE_STATS
        struct trie_use_stats stats;
 #endif
-       int size;
 };
 
 static void put_child(struct trie *t, struct tnode *tn, int i, struct node *n);
@@ -1052,7 +1052,6 @@ fib_insert_node(struct trie *t, int *err
                insert_leaf_info(&l->list, li);
                goto done;
        }
-       t->size++;
        l = leaf_new();
 
        if (!l) {
@@ -1267,6 +1266,7 @@ static int fn_trie_insert(struct fib_tab
 
        list_add_tail_rcu(&new_fa->fa_list,
                          (fa ? &fa->fa_list : fa_head));
+       t->size++;
 
        rt_cache_flush(-1);
        rtmsg_fib(RTM_NEWROUTE, htonl(key), new_fa, plen, tb->tb_id,

-- 
Stephen Hemminger <[EMAIL PROTECTED]>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to