netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch net-next] ipv6: exit early in addrconf_notify() if IPv6 is disabled
@ 2014-09-11 22:07 Cong Wang
  2014-09-12 20:18 ` Hannes Frederic Sowa
  2014-09-13 20:39 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Cong Wang @ 2014-09-11 22:07 UTC (permalink / raw)
  To: netdev; +Cc: Hideaki YOSHIFUJI, David S. Miller, Cong Wang

If IPv6 is explicitly disabled before the interface comes up,
it makes no sense to continue when it comes up, even just
print a message.

(I am not sure about other cases though, so I prefer not to touch)

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>

---
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index ad4598f..12a2efe 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -2844,6 +2844,9 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
 		if (dev->flags & IFF_SLAVE)
 			break;
 
+		if (idev && idev->cnf.disable_ipv6)
+			break;
+
 		if (event == NETDEV_UP) {
 			if (!addrconf_qdisc_ok(dev)) {
 				/* device is not ready yet. */

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

* Re: [Patch net-next] ipv6: exit early in addrconf_notify() if IPv6 is disabled
  2014-09-11 22:07 [Patch net-next] ipv6: exit early in addrconf_notify() if IPv6 is disabled Cong Wang
@ 2014-09-12 20:18 ` Hannes Frederic Sowa
  2014-09-13  0:10   ` Cong Wang
  2014-09-13 20:39 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Hannes Frederic Sowa @ 2014-09-12 20:18 UTC (permalink / raw)
  To: Cong Wang; +Cc: netdev, Hideaki YOSHIFUJI, David S. Miller

Hi Cong,

On Do, 2014-09-11 at 15:07 -0700, Cong Wang wrote:
> If IPv6 is explicitly disabled before the interface comes up,
> it makes no sense to continue when it comes up, even just
> print a message.
> 
> (I am not sure about other cases though, so I prefer not to touch)
> 
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>

I checked the other notifier_blocks, I don't think we need to change
anything there.

disable_ipv6 is absolutely bad implemented. It should not be in the ipv6
procfs namespace at all. An inet6_dev must be available to manage this
knob! Thus we are automagically subscribed to all ipv6 LL multicast
groups.

I don't see any problems with this patch:
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>

Thanks,
Hannes

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

* Re: [Patch net-next] ipv6: exit early in addrconf_notify() if IPv6 is disabled
  2014-09-12 20:18 ` Hannes Frederic Sowa
@ 2014-09-13  0:10   ` Cong Wang
  0 siblings, 0 replies; 4+ messages in thread
From: Cong Wang @ 2014-09-13  0:10 UTC (permalink / raw)
  To: Hannes Frederic Sowa
  Cc: Linux Kernel Network Developers, Hideaki YOSHIFUJI,
	David S. Miller

On Fri, Sep 12, 2014 at 1:18 PM, Hannes Frederic Sowa <hannes@redhat.com> wrote:
>
> disable_ipv6 is absolutely bad implemented. It should not be in the ipv6
> procfs namespace at all. An inet6_dev must be available to manage this
> knob! Thus we are automagically subscribed to all ipv6 LL multicast
> groups.


Exactly, this is chicken and egg problem and is why we have ipv6_idev_add()
in the NETDEV_REGISTER event.

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

* Re: [Patch net-next] ipv6: exit early in addrconf_notify() if IPv6 is disabled
  2014-09-11 22:07 [Patch net-next] ipv6: exit early in addrconf_notify() if IPv6 is disabled Cong Wang
  2014-09-12 20:18 ` Hannes Frederic Sowa
@ 2014-09-13 20:39 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2014-09-13 20:39 UTC (permalink / raw)
  To: xiyou.wangcong; +Cc: netdev, yoshfuji

From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Thu, 11 Sep 2014 15:07:16 -0700

> If IPv6 is explicitly disabled before the interface comes up,
> it makes no sense to continue when it comes up, even just
> print a message.
> 
> (I am not sure about other cases though, so I prefer not to touch)
> 
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>

Applied.

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

end of thread, other threads:[~2014-09-13 20:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-11 22:07 [Patch net-next] ipv6: exit early in addrconf_notify() if IPv6 is disabled Cong Wang
2014-09-12 20:18 ` Hannes Frederic Sowa
2014-09-13  0:10   ` Cong Wang
2014-09-13 20:39 ` 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).