summaryrefslogtreecommitdiff
path: root/net/ipv6/fib6_notifier.c
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-02 06:33:42 +0300
commit864150dfa31dceab6ec5ca4579a2d35ede985cb7 (patch)
tree1842a544d57e122936518563863aae60f712aa8a /net/ipv6/fib6_notifier.c
parent9e2cf36d5ca03837dc59d389d77282499c64201d (diff)
downloadlinux-864150dfa31dceab6ec5ca4579a2d35ede985cb7.tar.xz
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 'net/ipv6/fib6_notifier.c')
-rw-r--r--net/ipv6/fib6_notifier.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv6/fib6_notifier.c b/net/ipv6/fib6_notifier.c
index 66a103ef7e86..05f82baaa99e 100644
--- a/net/ipv6/fib6_notifier.c
+++ b/net/ipv6/fib6_notifier.c
@@ -1,6 +1,7 @@
#include <linux/notifier.h>
#include <linux/socket.h>
#include <linux/kernel.h>
+#include <linux/export.h>
#include <net/net_namespace.h>
#include <net/fib_notifier.h>
#include <net/netns/ipv6.h>
@@ -41,6 +42,7 @@ static const struct fib_notifier_ops fib6_notifier_ops_template = {
.family = AF_INET6,
.fib_seq_read = fib6_seq_read,
.fib_dump = fib6_dump,
+ .owner = THIS_MODULE,
};
int __net_init fib6_notifier_init(struct net *net)