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