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