[PATCH netifd] system-linux: Do not unconditionally activate IPv6 on devices

Hauke Mehrtens hmehrtens at maxlinear.com
Wed Feb 2 03:57:29 PST 2022


IPv6 can only be activated and deactivated on an interface, not on a
device in netifd. When we call system_set_disable_ipv6(dev, "") in
system_if_clear_state() we will activate IPv6 unconditionally for
devices even when it was deactivated in sysfs before.

When we set this option in /etc/sysctl.d/
	net.ipv6.conf.eth0_0.disable_ipv6 = 1
and add a device setting, but no interface setting in the UCI network
configuration IPv6 will still get activated.

With this change the IPv6 setting will not be changed any more when no
interface is configured. In the interface settings it can still be changed.

Signed-off-by: Hauke Mehrtens <hmehrtens at maxlinear.com>
---
 system-linux.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/system-linux.c b/system-linux.c
index 0b768f8..df36b61 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -1271,7 +1271,6 @@ void system_if_clear_state(struct device *dev)
 	system_if_clear_entries(dev, RTM_GETADDR, AF_INET6);
 	system_if_clear_entries(dev, RTM_GETNEIGH, AF_INET);
 	system_if_clear_entries(dev, RTM_GETNEIGH, AF_INET6);
-	system_set_disable_ipv6(dev, "0");
 }
 
 static inline unsigned long
-- 
2.17.1




More information about the openwrt-devel mailing list