Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 215174
b: refs/heads/master
c: 874ffa8
h: refs/heads/master
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Oct 16, 2010
1 parent 5ef4f70 commit 0fb34b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 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: a0a4a85a15df6335e3d11f83b2ac06ebebea313f
refs/heads/master: 874ffa8f72444d6253d2669fed304875c128f86b
16 changes: 4 additions & 12 deletions trunk/net/ipv4/fib_trie.c
Original file line number Diff line number Diff line change
Expand Up @@ -1384,8 +1384,7 @@ int fib_table_lookup(struct fib_table *tb, const struct flowi *flp,
t_key cindex = 0;
int current_prefix_length = KEYLENGTH;
struct tnode *cn;
t_key node_prefix, key_prefix, pref_mismatch;
int mp;
t_key pref_mismatch;

rcu_read_lock();

Expand Down Expand Up @@ -1500,24 +1499,17 @@ int fib_table_lookup(struct fib_table *tb, const struct flowi *flp,
* matching prefix.
*/

node_prefix = mask_pfx(cn->key, cn->pos);
key_prefix = mask_pfx(key, cn->pos);
pref_mismatch = key_prefix^node_prefix;
mp = 0;
pref_mismatch = mask_pfx(cn->key ^ key, cn->pos);

/*
* In short: If skipped bits in this node do not match
* the search key, enter the "prefix matching"
* state.directly.
*/
if (pref_mismatch) {
while (!(pref_mismatch & (1<<(KEYLENGTH-1)))) {
mp++;
pref_mismatch = pref_mismatch << 1;
}
key_prefix = tkey_extract_bits(cn->key, mp, cn->pos-mp);
int mp = KEYLENGTH - fls(pref_mismatch);

if (key_prefix != 0)
if (tkey_extract_bits(cn->key, mp, cn->pos - mp) != 0)
goto backtrace;

if (current_prefix_length >= cn->pos)
Expand Down

0 comments on commit 0fb34b3

Please sign in to comment.