[PATCH] netifd: Do not set disable_ipv6=0 in system_if_clear_state()
Jan Venekamp
jan at venekamp.net
Mon Jun 26 12:37:55 PDT 2023
When not configuring anything ipv6-related within uci and disabling
ipv6 by default for all interfaces with sysctl
net.ipv6.conf.all.disable_ipv6=1 some interfaces still get ipv6 turned
on due to system_set_disable_ipv6(dev, "0") at the end of
system_if_clear_state().
The line containing this call is a remnant of these two commits:
53f8ed2c 19/10/2011 [1] disable ipv6 for bridge member interfaces
98ca6746 07/04/2014 [2] netifd: Add interface config support to
enable/disable IPv6 in the kernel per device
In 53f8ed2c ipv6 is disabled for bridge members and enabled for all
ohter interfaces by adding calls to system_set_disable_ipv6() in
system_bridge_addif(), system_bridge_delif() and
system_if_clear_state().
In 98ca6746 the logic is reworked so that ipv6 can be optionally
configured per interface and ipv6 gets disabled by default for bridge
members in bridge_enable_member(). The calls to
system_set_disable_ipv6() are removed from system_bridge_addif() and
system_bridge_delif(). However, the line in system_if_clear_state() is
forgotten here and remains, having the effect that each interface will
have disable_ipv6=0 set.
Fix this by removing the remnant line.
[1] https://git.openwrt.org/?p=project/netifd.git;a=commitdiff;h=53f8ed2c
[2] https://git.openwrt.org/?p=project/netifd.git;a=commitdiff;h=98ca6746
Signed-off-by: Jan Venekamp <jan at venekamp.net>
---
system-linux.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/system-linux.c b/system-linux.c
index 0760e73..4cfd95b 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -1353,7 +1353,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.32.0 (Apple Git-132)
More information about the openwrt-devel
mailing list