X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Fipv4%2Ffib_trie.c;h=95a639f2e3dbc654df393c3f985b20c4fa036560;hb=9464c7cf61b9433057924c36e6e02f303a00e768;hp=01801c0f885d18d78d360e78653760d00913bca2;hpb=41689045f6a3cbe0550e1d34e9cc20d2e8c432ba;p=linux-2.6.git diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index 01801c0f8..95a639f2e 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c @@ -52,6 +52,7 @@ #define VERSION "0.407" +#include #include #include #include @@ -1252,8 +1253,8 @@ fn_trie_insert(struct fib_table *tb, struct rtmsg *r, struct kern_rta *rta, */ if (!fa_head) { - err = 0; fa_head = fib_insert_node(t, &err, key, plen); + err = 0; if (err) goto out_free_new_fa; } @@ -1281,18 +1282,18 @@ static inline int check_leaf(struct trie *t, struct leaf *l, struct fib_result *res) { int err, i; - __be32 mask; + t_key mask; struct leaf_info *li; struct hlist_head *hhead = &l->list; struct hlist_node *node; hlist_for_each_entry_rcu(li, node, hhead, hlist) { i = li->plen; - mask = inet_make_mask(i); - if (l->key != (key & ntohl(mask))) + mask = ntohl(inet_make_mask(i)); + if (l->key != (key & mask)) continue; - if ((err = fib_semantic_match(&li->falh, flp, res, htonl(l->key), mask, i)) <= 0) { + if ((err = fib_semantic_match(&li->falh, flp, res, l->key, mask, i)) <= 0) { *plen = i; #ifdef CONFIG_IP_FIB_TRIE_STATS t->stats.semantic_match_passed++;