diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2012-02-24 09:30:15 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-02-26 14:10:06 -0500 |
commit | 80d326fab534a5380e8f6e509a0b9076655a9670 (patch) | |
tree | 57c636de934b3f8abb7db9bcde64360ecc4eaf66 /net/netlink/genetlink.c | |
parent | 48e316bc2e045206248c6c75c0d5bbc0c9ddc32c (diff) |
netlink: add netlink_dump_control structure for netlink_dump_start()
Davem considers that the argument list of this interface is getting
out of control. This patch tries to address this issue following
his proposal:
struct netlink_dump_control c = { .dump = dump, .done = done, ... };
netlink_dump_start(..., &c);
Suggested by David S. Miller.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netlink/genetlink.c')
-rw-r--r-- | net/netlink/genetlink.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c index a1154717219..9f40441d7a7 100644 --- a/net/netlink/genetlink.c +++ b/net/netlink/genetlink.c | |||
@@ -563,8 +563,13 @@ static int genl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
563 | return -EOPNOTSUPP; | 563 | return -EOPNOTSUPP; |
564 | 564 | ||
565 | genl_unlock(); | 565 | genl_unlock(); |
566 | err = netlink_dump_start(net->genl_sock, skb, nlh, | 566 | { |
567 | ops->dumpit, ops->done, 0); | 567 | struct netlink_dump_control c = { |
568 | .dump = ops->dumpit, | ||
569 | .done = ops->done, | ||
570 | }; | ||
571 | err = netlink_dump_start(net->genl_sock, skb, nlh, &c); | ||
572 | } | ||
568 | genl_lock(); | 573 | genl_lock(); |
569 | return err; | 574 | return err; |
570 | } | 575 | } |