mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
48e316bc2e
commit
80d326fab5
12 changed files with 87 additions and 43 deletions
|
|
@ -301,10 +301,12 @@ static int unix_diag_handler_dump(struct sk_buff *skb, struct nlmsghdr *h)
|
|||
if (nlmsg_len(h) < hdrlen)
|
||||
return -EINVAL;
|
||||
|
||||
if (h->nlmsg_flags & NLM_F_DUMP)
|
||||
return netlink_dump_start(sock_diag_nlsk, skb, h,
|
||||
unix_diag_dump, NULL, 0);
|
||||
else
|
||||
if (h->nlmsg_flags & NLM_F_DUMP) {
|
||||
struct netlink_dump_control c = {
|
||||
.dump = unix_diag_dump,
|
||||
};
|
||||
return netlink_dump_start(sock_diag_nlsk, skb, h, &c);
|
||||
} else
|
||||
return unix_diag_get_exact(skb, h, (struct unix_diag_req *)NLMSG_DATA(h));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue