summaryrefslogtreecommitdiffstats
path: root/include/net/rtnetlink.h
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2017-12-02 21:44:06 +0100
committerDavid S. Miller <davem@davemloft.net>2017-12-04 11:32:31 -0500
commite4202511480da5f8e6870d8f6ecbb821aeaa8caf (patch)
treee5fadf5d76149f543fc003154f844b2ca19579bd /include/net/rtnetlink.h
parentaddf9b90de22f7aaad0db39bccb5d51ac47dd4e1 (diff)
downloadtalos-op-linux-e4202511480da5f8e6870d8f6ecbb821aeaa8caf.tar.gz
talos-op-linux-e4202511480da5f8e6870d8f6ecbb821aeaa8caf.zip
rtnetlink: get reference on module before invoking handlers
Add yet another rtnl_register function. It will be used by modules that can be removed. The passed module struct is used to prevent module unload while a netlink dump is in progress or when a DOIT_UNLOCKED doit callback is called. Cc: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/rtnetlink.h')
-rw-r--r--include/net/rtnetlink.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
index ead018744ff5..e326b3f9eb5f 100644
--- a/include/net/rtnetlink.h
+++ b/include/net/rtnetlink.h
@@ -17,6 +17,8 @@ int __rtnl_register(int protocol, int msgtype,
rtnl_doit_func, rtnl_dumpit_func, unsigned int flags);
void rtnl_register(int protocol, int msgtype,
rtnl_doit_func, rtnl_dumpit_func, unsigned int flags);
+int rtnl_register_module(struct module *owner, int protocol, int msgtype,
+ rtnl_doit_func, rtnl_dumpit_func, unsigned int flags);
int rtnl_unregister(int protocol, int msgtype);
void rtnl_unregister_all(int protocol);
OpenPOWER on IntegriCloud