netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipv6: delete protocol when cleanup
@ 2014-11-18 10:35 Duan Jiong
  2014-11-18 18:56 ` Cong Wang
  0 siblings, 1 reply; 8+ messages in thread
From: Duan Jiong @ 2014-11-18 10:35 UTC (permalink / raw)
  To: David Miller; +Cc: netdev


pim6_protocol was added when initiation, but it not deleted.

Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
---
 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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] ipv6: delete protocol when cleanup
  2014-11-18 10:35 [PATCH] ipv6: delete protocol when cleanup Duan Jiong
@ 2014-11-18 18:56 ` Cong Wang
  2014-11-18 19:14   ` Eric Dumazet
                     ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Cong Wang @ 2014-11-18 18:56 UTC (permalink / raw)
  To: Duan Jiong; +Cc: David Miller, netdev

On Tue, Nov 18, 2014 at 2:35 AM, Duan Jiong <duanj.fnst@cn.fujitsu.com> wrote:
>
> pim6_protocol was added when initiation, but it not deleted.
>
> Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
> ---
>  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);


Looks like rtnl_unregister() is missing as well.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] ipv6: delete protocol when cleanup
  2014-11-18 18:56 ` Cong Wang
@ 2014-11-18 19:14   ` Eric Dumazet
  2014-11-18 19:46     ` Cong Wang
  2014-11-19  1:10   ` Duan Jiong
  2014-11-19  1:35   ` [PATCH v2] ipv6: delete protocol and unregister rtnetlink " Duan Jiong
  2 siblings, 1 reply; 8+ messages in thread
From: Eric Dumazet @ 2014-11-18 19:14 UTC (permalink / raw)
  To: Cong Wang; +Cc: Duan Jiong, David Miller, netdev

On Tue, 2014-11-18 at 10:56 -0800, Cong Wang wrote:
> On Tue, Nov 18, 2014 at 2:35 AM, Duan Jiong <duanj.fnst@cn.fujitsu.com> wrote:
> >
> > pim6_protocol was added when initiation, but it not deleted.
> >
> > Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>

...

> 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 <amwang@redhat.com>
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.
    
    Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
    Cc: Stephen Hemminger <stephen@networkplumber.org>
    Cc: David S. Miller <davem@davemloft.net>
    Signed-off-by: Cong Wang <amwang@redhat.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] ipv6: delete protocol when cleanup
  2014-11-18 19:14   ` Eric Dumazet
@ 2014-11-18 19:46     ` Cong Wang
  0 siblings, 0 replies; 8+ messages in thread
From: Cong Wang @ 2014-11-18 19:46 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Duan Jiong, David Miller, netdev

On Tue, Nov 18, 2014 at 11:14 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Tue, 2014-11-18 at 10:56 -0800, Cong Wang wrote:
>> On Tue, Nov 18, 2014 at 2:35 AM, Duan Jiong <duanj.fnst@cn.fujitsu.com> wrote:
>> >
>> > pim6_protocol was added when initiation, but it not deleted.
>> >
>> > Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
>
> ...
>
>> 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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] ipv6: delete protocol when cleanup
  2014-11-18 18:56 ` Cong Wang
  2014-11-18 19:14   ` Eric Dumazet
@ 2014-11-19  1:10   ` Duan Jiong
  2014-11-19  1:35   ` [PATCH v2] ipv6: delete protocol and unregister rtnetlink " Duan Jiong
  2 siblings, 0 replies; 8+ messages in thread
From: Duan Jiong @ 2014-11-19  1:10 UTC (permalink / raw)
  To: Cong Wang; +Cc: David Miller, netdev

On 11/19/2014 02:56 AM, Cong Wang wrote:
> On Tue, Nov 18, 2014 at 2:35 AM, Duan Jiong <duanj.fnst@cn.fujitsu.com> wrote:
>>
>> pim6_protocol was added when initiation, but it not deleted.
>>
>> Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
>> ---
>>  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);
> 
> 
> Looks like rtnl_unregister() is missing as well.
> 

Thanks for pointing this, i will send v2.

Thanks,
  Duan

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2] ipv6: delete protocol and unregister rtnetlink when cleanup
  2014-11-18 18:56 ` Cong Wang
  2014-11-18 19:14   ` Eric Dumazet
  2014-11-19  1:10   ` Duan Jiong
@ 2014-11-19  1:35   ` Duan Jiong
  2014-11-19 19:46     ` Cong Wang
  2014-11-19 21:55     ` David Miller
  2 siblings, 2 replies; 8+ messages in thread
From: Duan Jiong @ 2014-11-19  1:35 UTC (permalink / raw)
  To: David Miller; +Cc: Cong Wang, netdev, eric.dumazet



pim6_protocol was added when initiation, but it not deleted.
Similarly, unregister RTNL_FAMILY_IP6MR rtnetlink.

Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
---
v2: add missing rtnl_unregister()

 net/ipv6/ip6mr.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 0171f08..1a01d79 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -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);
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] ipv6: delete protocol and unregister rtnetlink when cleanup
  2014-11-19  1:35   ` [PATCH v2] ipv6: delete protocol and unregister rtnetlink " Duan Jiong
@ 2014-11-19 19:46     ` Cong Wang
  2014-11-19 21:55     ` David Miller
  1 sibling, 0 replies; 8+ messages in thread
From: Cong Wang @ 2014-11-19 19:46 UTC (permalink / raw)
  To: Duan Jiong; +Cc: David Miller, netdev, Eric Dumazet

On Tue, Nov 18, 2014 at 5:35 PM, Duan Jiong <duanj.fnst@cn.fujitsu.com> wrote:
>
>
> pim6_protocol was added when initiation, but it not deleted.
> Similarly, unregister RTNL_FAMILY_IP6MR rtnetlink.
>
> Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
> ---
> v2: add missing rtnl_unregister()

Reviewed-by: Cong Wang <cwang@twopensource.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] ipv6: delete protocol and unregister rtnetlink when cleanup
  2014-11-19  1:35   ` [PATCH v2] ipv6: delete protocol and unregister rtnetlink " Duan Jiong
  2014-11-19 19:46     ` Cong Wang
@ 2014-11-19 21:55     ` David Miller
  1 sibling, 0 replies; 8+ messages in thread
From: David Miller @ 2014-11-19 21:55 UTC (permalink / raw)
  To: duanj.fnst; +Cc: cwang, netdev, eric.dumazet

From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Date: Wed, 19 Nov 2014 09:35:39 +0800

> pim6_protocol was added when initiation, but it not deleted.
> Similarly, unregister RTNL_FAMILY_IP6MR rtnetlink.
> 
> Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
> ---
> v2: add missing rtnl_unregister()

Applied, thanks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-11-19 21:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-18 10:35 [PATCH] ipv6: delete protocol when cleanup Duan Jiong
2014-11-18 18:56 ` Cong Wang
2014-11-18 19:14   ` Eric Dumazet
2014-11-18 19:46     ` Cong Wang
2014-11-19  1:10   ` Duan Jiong
2014-11-19  1:35   ` [PATCH v2] ipv6: delete protocol and unregister rtnetlink " Duan Jiong
2014-11-19 19:46     ` Cong Wang
2014-11-19 21:55     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).