aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2017-09-01 12:15:17 +0300
committerDavid S. Miller <davem@davemloft.net>2017-09-01 20:33:42 -0700
commit864150dfa31dceab6ec5ca4579a2d35ede985cb7 (patch)
tree1842a544d57e122936518563863aae60f712aa8a /include/net
parentMerge branch 'netvsc-vf-cleanups' (diff)
downloadlinux-dev-864150dfa31dceab6ec5ca4579a2d35ede985cb7.tar.xz
linux-dev-864150dfa31dceab6ec5ca4579a2d35ede985cb7.zip
net: Add module reference to FIB notifiers
When a listener registers to the FIB notification chain it receives a dump of the FIB entries and rules from existing address families by invoking their dump operations. While we call into these modules we need to make sure they aren't removed. Do that by increasing their reference count before invoking their dump operations and decrease it afterwards. Fixes: 04b1d4e50e82 ("net: core: Make the FIB notification chain generic") Signed-off-by: Ido Schimmel <idosch@mellanox.com> Reviewed-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/fib_notifier.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/net/fib_notifier.h b/include/net/fib_notifier.h
index 241475224f74..669b9716dc7a 100644
--- a/include/net/fib_notifier.h
+++ b/include/net/fib_notifier.h
@@ -2,6 +2,7 @@
#define __NET_FIB_NOTIFIER_H
#include <linux/types.h>
+#include <linux/module.h>
#include <linux/notifier.h>
#include <net/net_namespace.h>
@@ -26,6 +27,7 @@ struct fib_notifier_ops {
struct list_head list;
unsigned int (*fib_seq_read)(struct net *net);
int (*fib_dump)(struct net *net, struct notifier_block *nb);
+ struct module *owner;
struct rcu_head rcu;
};