diff options
Diffstat (limited to 'net/ipv6/ip6_fib.c')
-rw-r--r-- | net/ipv6/ip6_fib.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index 710cafd2e1a9..192dd1a0e188 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c | |||
@@ -224,7 +224,6 @@ struct fib6_table *fib6_get_table(struct net *net, u32 id) | |||
224 | { | 224 | { |
225 | struct fib6_table *tb; | 225 | struct fib6_table *tb; |
226 | struct hlist_head *head; | 226 | struct hlist_head *head; |
227 | struct hlist_node *node; | ||
228 | unsigned int h; | 227 | unsigned int h; |
229 | 228 | ||
230 | if (id == 0) | 229 | if (id == 0) |
@@ -232,7 +231,7 @@ struct fib6_table *fib6_get_table(struct net *net, u32 id) | |||
232 | h = id & (FIB6_TABLE_HASHSZ - 1); | 231 | h = id & (FIB6_TABLE_HASHSZ - 1); |
233 | rcu_read_lock(); | 232 | rcu_read_lock(); |
234 | head = &net->ipv6.fib_table_hash[h]; | 233 | head = &net->ipv6.fib_table_hash[h]; |
235 | hlist_for_each_entry_rcu(tb, node, head, tb6_hlist) { | 234 | hlist_for_each_entry_rcu(tb, head, tb6_hlist) { |
236 | if (tb->tb6_id == id) { | 235 | if (tb->tb6_id == id) { |
237 | rcu_read_unlock(); | 236 | rcu_read_unlock(); |
238 | return tb; | 237 | return tb; |
@@ -363,7 +362,6 @@ static int inet6_dump_fib(struct sk_buff *skb, struct netlink_callback *cb) | |||
363 | struct rt6_rtnl_dump_arg arg; | 362 | struct rt6_rtnl_dump_arg arg; |
364 | struct fib6_walker_t *w; | 363 | struct fib6_walker_t *w; |
365 | struct fib6_table *tb; | 364 | struct fib6_table *tb; |
366 | struct hlist_node *node; | ||
367 | struct hlist_head *head; | 365 | struct hlist_head *head; |
368 | int res = 0; | 366 | int res = 0; |
369 | 367 | ||
@@ -398,7 +396,7 @@ static int inet6_dump_fib(struct sk_buff *skb, struct netlink_callback *cb) | |||
398 | for (h = s_h; h < FIB6_TABLE_HASHSZ; h++, s_e = 0) { | 396 | for (h = s_h; h < FIB6_TABLE_HASHSZ; h++, s_e = 0) { |
399 | e = 0; | 397 | e = 0; |
400 | head = &net->ipv6.fib_table_hash[h]; | 398 | head = &net->ipv6.fib_table_hash[h]; |
401 | hlist_for_each_entry_rcu(tb, node, head, tb6_hlist) { | 399 | hlist_for_each_entry_rcu(tb, head, tb6_hlist) { |
402 | if (e < s_e) | 400 | if (e < s_e) |
403 | goto next; | 401 | goto next; |
404 | res = fib6_dump_table(tb, skb, cb); | 402 | res = fib6_dump_table(tb, skb, cb); |
@@ -1520,14 +1518,13 @@ void fib6_clean_all_ro(struct net *net, int (*func)(struct rt6_info *, void *arg | |||
1520 | int prune, void *arg) | 1518 | int prune, void *arg) |
1521 | { | 1519 | { |
1522 | struct fib6_table *table; | 1520 | struct fib6_table *table; |
1523 | struct hlist_node *node; | ||
1524 | struct hlist_head *head; | 1521 | struct hlist_head *head; |
1525 | unsigned int h; | 1522 | unsigned int h; |
1526 | 1523 | ||
1527 | rcu_read_lock(); | 1524 | rcu_read_lock(); |
1528 | for (h = 0; h < FIB6_TABLE_HASHSZ; h++) { | 1525 | for (h = 0; h < FIB6_TABLE_HASHSZ; h++) { |
1529 | head = &net->ipv6.fib_table_hash[h]; | 1526 | head = &net->ipv6.fib_table_hash[h]; |
1530 | hlist_for_each_entry_rcu(table, node, head, tb6_hlist) { | 1527 | hlist_for_each_entry_rcu(table, head, tb6_hlist) { |
1531 | read_lock_bh(&table->tb6_lock); | 1528 | read_lock_bh(&table->tb6_lock); |
1532 | fib6_clean_tree(net, &table->tb6_root, | 1529 | fib6_clean_tree(net, &table->tb6_root, |
1533 | func, prune, arg); | 1530 | func, prune, arg); |
@@ -1540,14 +1537,13 @@ void fib6_clean_all(struct net *net, int (*func)(struct rt6_info *, void *arg), | |||
1540 | int prune, void *arg) | 1537 | int prune, void *arg) |
1541 | { | 1538 | { |
1542 | struct fib6_table *table; | 1539 | struct fib6_table *table; |
1543 | struct hlist_node *node; | ||
1544 | struct hlist_head *head; | 1540 | struct hlist_head *head; |
1545 | unsigned int h; | 1541 | unsigned int h; |
1546 | 1542 | ||
1547 | rcu_read_lock(); | 1543 | rcu_read_lock(); |
1548 | for (h = 0; h < FIB6_TABLE_HASHSZ; h++) { | 1544 | for (h = 0; h < FIB6_TABLE_HASHSZ; h++) { |
1549 | head = &net->ipv6.fib_table_hash[h]; | 1545 | head = &net->ipv6.fib_table_hash[h]; |
1550 | hlist_for_each_entry_rcu(table, node, head, tb6_hlist) { | 1546 | hlist_for_each_entry_rcu(table, head, tb6_hlist) { |
1551 | write_lock_bh(&table->tb6_lock); | 1547 | write_lock_bh(&table->tb6_lock); |
1552 | fib6_clean_tree(net, &table->tb6_root, | 1548 | fib6_clean_tree(net, &table->tb6_root, |
1553 | func, prune, arg); | 1549 | func, prune, arg); |