ipv6: exit early in addrconf_notify() if IPv6 is disabled
Subsystems (3)
PATCH 1/1 ipv6: exit early in addrconf_notify() if IPv6 is disabled
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)
---
net/ipv6/addrconf.c +3 -0
@@ -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. */
Hi Cong,
Quoted 7 lines · 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 <[email protected]>
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:
Thanks,
Hannes
Quoted 5 lines · Hannes Frederic Sowa
disable_ipv6is absolutely bad implemented. It should not be in the ipv6 procfs namespace at all. Aninet6_devmust 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.
From: Cong Wang <[email protected]>
Date: Thu, 11 Sep 2014 15:07:16 -0700
Quoted 7 lines
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 <[email protected]>
Applied.