Skip to contentSkip to conversation

ipv6: exit early in addrconf_notify() if IPv6 is disabled

PATCH Applied Cong Wang 3 participants 4 messages Sep 11, 2014 – Sep 13, 2014

Subsystems (3)
lore
Share & tools
lore

Cong Wang

author
#0 lore raw

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
index ad4598f..12a2efe 100644
@@ -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. */
Acked-by on v1 1/1
#1 lore raw

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)

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

author
#2 lore raw
Quoted 5 lines · Hannes Frederic Sowa

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.