Revert to Fedora kernel-2.6.17-1.2187_FC5 patched with vs2.0.2.1; there are too many...
[linux-2.6.git] / net / ipv4 / fib_trie.c
index 01801c0..95a639f 100644 (file)
@@ -52,6 +52,7 @@
 
 #define VERSION "0.407"
 
+#include <linux/config.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <asm/bitops.h>
@@ -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++;