Subject: [PATCH] ipv6: delete protocol when cleanup

From: Duan Jiong <[email-masked]>
Date: Tue, 18 Nov 2014 18:35:36 +0800

pim6_protocol was added when initiation, but it not deleted.

Signed-off-by: Duan Jiong <[email-masked]>
---
 net/ipv6/ip6mr.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 0171f08..6dcdecd 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -1439,6 +1439,9 @@ reg_pernet_fail:
 
 void ip6_mr_cleanup(void)
 {
+#ifdef CONFIG_IPV6_PIMSM_V2
+	inet6_del_protocol(&pim6_protocol, IPPROTO_PIM);
+#endif
 	unregister_netdevice_notifier(&ip6_mr_notifier);
 	unregister_pernet_subsys(&ip6mr_net_ops);
 	kmem_cache_destroy(mrt_cachep);
-- 
1.8.3.1