diff options
Diffstat (limited to 'net/ipv4/fib_frontend.c')
-rw-r--r-- | net/ipv4/fib_frontend.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 39bd1edee676..83e3ed258467 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c | |||
@@ -763,7 +763,7 @@ static int inet_dump_fib(struct sk_buff *skb, struct netlink_callback *cb) | |||
763 | unsigned int e = 0, s_e; | 763 | unsigned int e = 0, s_e; |
764 | struct fib_table *tb; | 764 | struct fib_table *tb; |
765 | struct hlist_head *head; | 765 | struct hlist_head *head; |
766 | int dumped = 0; | 766 | int dumped = 0, err; |
767 | 767 | ||
768 | if (nlmsg_len(cb->nlh) >= sizeof(struct rtmsg) && | 768 | if (nlmsg_len(cb->nlh) >= sizeof(struct rtmsg) && |
769 | ((struct rtmsg *) nlmsg_data(cb->nlh))->rtm_flags & RTM_F_CLONED) | 769 | ((struct rtmsg *) nlmsg_data(cb->nlh))->rtm_flags & RTM_F_CLONED) |
@@ -783,20 +783,27 @@ static int inet_dump_fib(struct sk_buff *skb, struct netlink_callback *cb) | |||
783 | if (dumped) | 783 | if (dumped) |
784 | memset(&cb->args[2], 0, sizeof(cb->args) - | 784 | memset(&cb->args[2], 0, sizeof(cb->args) - |
785 | 2 * sizeof(cb->args[0])); | 785 | 2 * sizeof(cb->args[0])); |
786 | if (fib_table_dump(tb, skb, cb) < 0) | 786 | err = fib_table_dump(tb, skb, cb); |
787 | goto out; | 787 | if (err < 0) { |
788 | if (likely(skb->len)) | ||
789 | goto out; | ||
790 | |||
791 | goto out_err; | ||
792 | } | ||
788 | dumped = 1; | 793 | dumped = 1; |
789 | next: | 794 | next: |
790 | e++; | 795 | e++; |
791 | } | 796 | } |
792 | } | 797 | } |
793 | out: | 798 | out: |
799 | err = skb->len; | ||
800 | out_err: | ||
794 | rcu_read_unlock(); | 801 | rcu_read_unlock(); |
795 | 802 | ||
796 | cb->args[1] = e; | 803 | cb->args[1] = e; |
797 | cb->args[0] = h; | 804 | cb->args[0] = h; |
798 | 805 | ||
799 | return skb->len; | 806 | return err; |
800 | } | 807 | } |
801 | 808 | ||
802 | /* Prepare and feed intra-kernel routing request. | 809 | /* Prepare and feed intra-kernel routing request. |