diff options
author | Tom Herbert <tom@herbertland.com> | 2015-12-15 15:41:37 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-12-15 23:25:20 -0500 |
commit | fc9e50f5a5a4e1fa9ba2756f745a13e693cf6a06 (patch) | |
tree | 168120764bcdbba0aad5859c9044f7dd84eb4350 /net/netlink/af_netlink.c | |
parent | 3502cad73c4bbf8f6365d539e814159275252c59 (diff) | |
download | linux-fc9e50f5a5a4e1fa9ba2756f745a13e693cf6a06.tar.gz linux-fc9e50f5a5a4e1fa9ba2756f745a13e693cf6a06.tar.bz2 linux-fc9e50f5a5a4e1fa9ba2756f745a13e693cf6a06.zip |
netlink: add a start callback for starting a netlink dump
The start callback allows the caller to set up a context for the
dump callbacks. Presumably, the context can then be destroyed in
the done callback.
Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netlink/af_netlink.c')
-rw-r--r-- | net/netlink/af_netlink.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 59651af8cc27..81dc1bb6e016 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -2915,6 +2915,7 @@ int __netlink_dump_start(struct sock *ssk, struct sk_buff *skb, cb = &nlk->cb; memset(cb, 0, sizeof(*cb)); + cb->start = control->start; cb->dump = control->dump; cb->done = control->done; cb->nlh = nlh; @@ -2927,6 +2928,9 @@ int __netlink_dump_start(struct sock *ssk, struct sk_buff *skb, mutex_unlock(nlk->cb_mutex); + if (cb->start) + cb->start(cb); + ret = netlink_dump(sk); sock_put(sk); |