diff options
author | Jiri Kosina <jkosina@suse.cz> | 2012-10-28 14:28:52 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2012-10-28 14:29:19 -0400 |
commit | 3bd7bf1f0fe14f591c089ae61bbfa9bd356f178a (patch) | |
tree | 0058693cc9e70b7461dae551f8a19aff2efd13ca /net/ipv4/fib_trie.c | |
parent | f16f84937d769c893492160b1a8c3672e3992beb (diff) | |
parent | e657e078d3dfa9f96976db7a2b5fd7d7c9f1f1a6 (diff) |
Merge branch 'master' into for-next
Sync up with Linus' tree to be able to apply Cesar's patch
against newer version of the code.
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'net/ipv4/fib_trie.c')
-rw-r--r-- | net/ipv4/fib_trie.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index d1b93595b4a7..31d771ca9a70 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c | |||
@@ -1550,7 +1550,8 @@ int fib_table_lookup(struct fib_table *tb, const struct flowi4 *flp, | |||
1550 | * state.directly. | 1550 | * state.directly. |
1551 | */ | 1551 | */ |
1552 | if (pref_mismatch) { | 1552 | if (pref_mismatch) { |
1553 | int mp = KEYLENGTH - fls(pref_mismatch); | 1553 | /* fls(x) = __fls(x) + 1 */ |
1554 | int mp = KEYLENGTH - __fls(pref_mismatch) - 1; | ||
1554 | 1555 | ||
1555 | if (tkey_extract_bits(cn->key, mp, cn->pos - mp) != 0) | 1556 | if (tkey_extract_bits(cn->key, mp, cn->pos - mp) != 0) |
1556 | goto backtrace; | 1557 | goto backtrace; |
@@ -1655,7 +1656,12 @@ int fib_table_delete(struct fib_table *tb, struct fib_config *cfg) | |||
1655 | if (!l) | 1656 | if (!l) |
1656 | return -ESRCH; | 1657 | return -ESRCH; |
1657 | 1658 | ||
1658 | fa_head = get_fa_head(l, plen); | 1659 | li = find_leaf_info(l, plen); |
1660 | |||
1661 | if (!li) | ||
1662 | return -ESRCH; | ||
1663 | |||
1664 | fa_head = &li->falh; | ||
1659 | fa = fib_find_alias(fa_head, tos, 0); | 1665 | fa = fib_find_alias(fa_head, tos, 0); |
1660 | 1666 | ||
1661 | if (!fa) | 1667 | if (!fa) |
@@ -1691,9 +1697,6 @@ int fib_table_delete(struct fib_table *tb, struct fib_config *cfg) | |||
1691 | rtmsg_fib(RTM_DELROUTE, htonl(key), fa, plen, tb->tb_id, | 1697 | rtmsg_fib(RTM_DELROUTE, htonl(key), fa, plen, tb->tb_id, |
1692 | &cfg->fc_nlinfo, 0); | 1698 | &cfg->fc_nlinfo, 0); |
1693 | 1699 | ||
1694 | l = fib_find_node(t, key); | ||
1695 | li = find_leaf_info(l, plen); | ||
1696 | |||
1697 | list_del_rcu(&fa->fa_list); | 1700 | list_del_rcu(&fa->fa_list); |
1698 | 1701 | ||
1699 | if (!plen) | 1702 | if (!plen) |
@@ -1870,7 +1873,7 @@ static int fn_trie_dump_fa(t_key key, int plen, struct list_head *fah, | |||
1870 | continue; | 1873 | continue; |
1871 | } | 1874 | } |
1872 | 1875 | ||
1873 | if (fib_dump_info(skb, NETLINK_CB(cb->skb).pid, | 1876 | if (fib_dump_info(skb, NETLINK_CB(cb->skb).portid, |
1874 | cb->nlh->nlmsg_seq, | 1877 | cb->nlh->nlmsg_seq, |
1875 | RTM_NEWROUTE, | 1878 | RTM_NEWROUTE, |
1876 | tb->tb_id, | 1879 | tb->tb_id, |