diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/route.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index d2bc6148a737..d3377069ce05 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -2626,11 +2626,10 @@ int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb) | |||
2626 | int idx, s_idx; | 2626 | int idx, s_idx; |
2627 | 2627 | ||
2628 | s_h = cb->args[0]; | 2628 | s_h = cb->args[0]; |
2629 | if (s_h < 0) | ||
2630 | s_h = 0; | ||
2629 | s_idx = idx = cb->args[1]; | 2631 | s_idx = idx = cb->args[1]; |
2630 | for (h = 0; h <= rt_hash_mask; h++) { | 2632 | for (h = s_h; h <= rt_hash_mask; h++) { |
2631 | if (h < s_h) continue; | ||
2632 | if (h > s_h) | ||
2633 | s_idx = 0; | ||
2634 | rcu_read_lock_bh(); | 2633 | rcu_read_lock_bh(); |
2635 | for (rt = rcu_dereference(rt_hash_table[h].chain), idx = 0; rt; | 2634 | for (rt = rcu_dereference(rt_hash_table[h].chain), idx = 0; rt; |
2636 | rt = rcu_dereference(rt->u.dst.rt_next), idx++) { | 2635 | rt = rcu_dereference(rt->u.dst.rt_next), idx++) { |
@@ -2647,6 +2646,7 @@ int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb) | |||
2647 | dst_release(xchg(&skb->dst, NULL)); | 2646 | dst_release(xchg(&skb->dst, NULL)); |
2648 | } | 2647 | } |
2649 | rcu_read_unlock_bh(); | 2648 | rcu_read_unlock_bh(); |
2649 | s_idx = 0; | ||
2650 | } | 2650 | } |
2651 | 2651 | ||
2652 | done: | 2652 | done: |