aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/fib_trie.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/fib_trie.c')
-rw-r--r--net/ipv4/fib_trie.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index d16ae4623be6..f155a66d6ebf 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -1357,17 +1357,17 @@ static int check_leaf(struct trie *t, struct leaf *l,
1357 t->stats.semantic_match_miss++; 1357 t->stats.semantic_match_miss++;
1358#endif 1358#endif
1359 if (err <= 0) 1359 if (err <= 0)
1360 return plen; 1360 return err;
1361 } 1361 }
1362 1362
1363 return -1; 1363 return 1;
1364} 1364}
1365 1365
1366static int fn_trie_lookup(struct fib_table *tb, const struct flowi *flp, 1366static int fn_trie_lookup(struct fib_table *tb, const struct flowi *flp,
1367 struct fib_result *res) 1367 struct fib_result *res)
1368{ 1368{
1369 struct trie *t = (struct trie *) tb->tb_data; 1369 struct trie *t = (struct trie *) tb->tb_data;
1370 int plen, ret = 0; 1370 int ret;
1371 struct node *n; 1371 struct node *n;
1372 struct tnode *pn; 1372 struct tnode *pn;
1373 int pos, bits; 1373 int pos, bits;
@@ -1391,10 +1391,7 @@ static int fn_trie_lookup(struct fib_table *tb, const struct flowi *flp,
1391 1391
1392 /* Just a leaf? */ 1392 /* Just a leaf? */
1393 if (IS_LEAF(n)) { 1393 if (IS_LEAF(n)) {
1394 plen = check_leaf(t, (struct leaf *)n, key, flp, res); 1394 ret = check_leaf(t, (struct leaf *)n, key, flp, res);
1395 if (plen < 0)
1396 goto failed;
1397 ret = 0;
1398 goto found; 1395 goto found;
1399 } 1396 }
1400 1397
@@ -1419,11 +1416,9 @@ static int fn_trie_lookup(struct fib_table *tb, const struct flowi *flp,
1419 } 1416 }
1420 1417
1421 if (IS_LEAF(n)) { 1418 if (IS_LEAF(n)) {
1422 plen = check_leaf(t, (struct leaf *)n, key, flp, res); 1419 ret = check_leaf(t, (struct leaf *)n, key, flp, res);
1423 if (plen < 0) 1420 if (ret > 0)
1424 goto backtrace; 1421 goto backtrace;
1425
1426 ret = 0;
1427 goto found; 1422 goto found;
1428 } 1423 }
1429 1424