[NET]: Fix IPv4/DECnet routing rule dumping
authorPatrick McHardy <kaber@trash.net>
Sat, 8 Jul 2006 20:38:55 +0000 (13:38 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 8 Jul 2006 20:38:55 +0000 (13:38 -0700)
When more rules are present than fit in a single skb, the remaining
rules are incorrectly skipped.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/decnet/dn_rules.c
net/ipv4/fib_rules.c

index 06e785fe575798b5ae736317a44ec67d8ca07c11..22f321d9bf9d233474aa6a2a0d36c7388b0f1387 100644 (file)
@@ -399,9 +399,10 @@ int dn_fib_dump_rules(struct sk_buff *skb, struct netlink_callback *cb)
        rcu_read_lock();
        hlist_for_each_entry(r, node, &dn_fib_rules, r_hlist) {
                if (idx < s_idx)
-                       continue;
+                       goto next;
                if (dn_fib_fill_rule(skb, r, cb, NLM_F_MULTI) < 0)
                        break;
+next:
                idx++;
        }
        rcu_read_unlock();
index 6c642d11d4ca4e18cf2f2da96bbda1ccd41e9f29..773b12ba4e3cf965634df3ad4bf9fb34a8e74433 100644 (file)
@@ -457,13 +457,13 @@ int inet_dump_rules(struct sk_buff *skb, struct netlink_callback *cb)
 
        rcu_read_lock();
        hlist_for_each_entry(r, node, &fib_rules, hlist) {
-
                if (idx < s_idx)
-                       continue;
+                       goto next;
                if (inet_fill_rule(skb, r, NETLINK_CB(cb->skb).pid,
                                   cb->nlh->nlmsg_seq,
                                   RTM_NEWRULE, NLM_F_MULTI) < 0)
                        break;
+next:
                idx++;
        }
        rcu_read_unlock();