Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256496
b: refs/heads/master
c: 5c74501
h: refs/heads/master
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Jul 18, 2011
1 parent ab526d2 commit 5131751
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d3aaeb38c40e5a6c08dd31a1b64da65c4352be36
refs/heads/master: 5c74501f76360ce6f410730b9b5e5976f38e8504
12 changes: 6 additions & 6 deletions trunk/net/ipv4/fib_trie.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,10 @@ struct leaf {

struct leaf_info {
struct hlist_node hlist;
struct rcu_head rcu;
int plen;
u32 mask_plen; /* ntohl(inet_make_mask(plen)) */
struct list_head falh;
struct rcu_head rcu;
};

struct tnode {
Expand Down Expand Up @@ -451,6 +452,7 @@ static struct leaf_info *leaf_info_new(int plen)
struct leaf_info *li = kmalloc(sizeof(struct leaf_info), GFP_KERNEL);
if (li) {
li->plen = plen;
li->mask_plen = ntohl(inet_make_mask(plen));
INIT_LIST_HEAD(&li->falh);
}
return li;
Expand Down Expand Up @@ -1359,10 +1361,8 @@ static int check_leaf(struct fib_table *tb, struct trie *t, struct leaf *l,

hlist_for_each_entry_rcu(li, node, hhead, hlist) {
struct fib_alias *fa;
int plen = li->plen;
__be32 mask = inet_make_mask(plen);

if (l->key != (key & ntohl(mask)))
if (l->key != (key & li->mask_plen))
continue;

list_for_each_entry_rcu(fa, &li->falh, fa_list) {
Expand Down Expand Up @@ -1394,15 +1394,15 @@ static int check_leaf(struct fib_table *tb, struct trie *t, struct leaf *l,
#ifdef CONFIG_IP_FIB_TRIE_STATS
t->stats.semantic_match_passed++;
#endif
res->prefixlen = plen;
res->prefixlen = li->plen;
res->nh_sel = nhsel;
res->type = fa->fa_type;
res->scope = fa->fa_info->fib_scope;
res->fi = fi;
res->table = tb;
res->fa_head = &li->falh;
if (!(fib_flags & FIB_LOOKUP_NOREF))
atomic_inc(&res->fi->fib_clntref);
atomic_inc(&fi->fib_clntref);
return 0;
}
}
Expand Down

0 comments on commit 5131751

Please sign in to comment.