ipv6: delete protocol when cleanup
Subsystems (3)
PATCH 1/1 ipv6: delete protocol when cleanup
pim6_protocol was added when initiation, but it not deleted.
--- net/ipv6/ip6mr.c | 3 +++ 1 file changed, 3 insertions(+)
net/ipv6/ip6mr.c +3 -0
@@ -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);
Signature · 1 line
1.8.3.1
Quoted 13 lines · Duan Jiong
pim6_protocolwas added when initiation, but it not deleted.Signed-off-by Duan Jiong <[email protected]>--- net/ipv6/ip6mr.c | 3 +++ 1 file changed, 3 insertions(+)net/ipv6/ip6mr.c +0
-0
net/ipv6/ip6mr.c reg_pernet_fail: · line 1447
Quoted 9 lines
net/ipv6/ip6mr.c +3
-0@@ -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);
Looks like rtnl_unregister() is missing as well.
Quoted 5 lines · Cong Wang
Quoted 4 lines · Duan Jiong
pim6_protocolwas added when initiation, but it not deleted.Signed-off-by Duan Jiong <[email protected]>
...
Quoted 1 line
Looks like
rtnl_unregister()is missing as well.
Is it really worth bothering ?
May I remind you we took the decision one year ago to not bother about removing ipv6 module.
commit 8ce440610357b77587433d0df647cea69a6890a8
Author: Cong Wang <[email protected]> Date: Sat Sep 21 11:12:21 2013 +0800
ipv6: do not allow ipv6 module to be removed
There was some bug report on ipv6 module removal path before. Also, as Stephen pointed out, after vxlan module gets ipv6 support, the ipv6 stub it used is not safe against this module removal either. So, let's just remove inet6_exit() so that ipv6 module will not be able to be unloaded.
Quoted 7 lines · Eric Dumazet
Quoted 5 lines · Cong Wang
Quoted 4 lines · Duan Jiong
pim6_protocolwas added when initiation, but it not deleted.Signed-off-by Duan Jiong <[email protected]>
Quoted 9 lines
...
Quoted 1 line
Looks like
rtnl_unregister()is missing as well.Is it really worth bothering ?
May I remind you we took the decision one year ago to not bother about removing ipv6 module.
It is still called in error path of init, so just for completeness.
Quoted 15 lines · Cong Wang
Quoted 14 lines · Duan Jiong
pim6_protocolwas added when initiation, but it not deleted.Signed-off-by Duan Jiong <[email protected]>--- net/ipv6/ip6mr.c | 3 +++ 1 file changed, 3 insertions(+)net/ipv6/ip6mr.c +0
-0@@ -1439,6 +1439,9 @@ reg_pernet_fail:
Quoted 12 lines
net/ipv6/ip6mr.c reg_pernet_fail: · line 1447
Quoted 8 lines
net/ipv6/ip6mr.c +3
-0void 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);Looks like
rtnl_unregister()is missing as well.
Thanks for pointing this, i will send v2.
Thanks,
Duan
PATCH v2 1/1 ipv6: delete protocol and unregister rtnetlink when cleanup
In reply to Cong Wangpim6_protocol was added when initiation, but it not deleted. Similarly, unregister RTNL_FAMILY_IP6MR rtnetlink.
---
v2: add missing rtnl_unregister()
net/ipv6/ip6mr.c | 4 ++++ 1 file changed, 4 insertions(+)
net/ipv6/ip6mr.c +4 -0
@@ -1439,6 +1439,10 @@ reg_pernet_fail:void ip6_mr_cleanup (void ) { +rtnl_unregister (RTNL_FAMILY_IP6MR ,RTM_GETROUTE ); +#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);
Signature · 1 line
1.8.3.1
Re: [PATCH v2] ipv6: delete protocol and unregister rtnetlink when cleanup
Quoted 8 lines · Duan Jiong
pim6_protocolwas added when initiation, but it not deleted. Similarly, unregisterRTNL_FAMILY_IP6MRrtnetlink.Signed-off-by Duan Jiong <[email protected]>---
v2: add missingrtnl_unregister()
Re: [PATCH v2] ipv6: delete protocol and unregister rtnetlink when cleanup
In reply to Duan JiongFrom: Duan Jiong <[email protected]>
Date: Wed, 19 Nov 2014 09:35:39 +0800
Quoted 6 lines
pim6_protocolwas added when initiation, but it not deleted. Similarly, unregisterRTNL_FAMILY_IP6MRrtnetlink.Signed-off-by Duan Jiong <[email protected]>---
v2: add missingrtnl_unregister()
Applied, thanks.