aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorPatrick McLean <chutzpah@gentoo.org>2024-08-28 11:51:30 -0700
committerPatrick McLean <chutzpah@gentoo.org>2024-08-28 11:54:05 -0700
commite04d54da670198ce0aff2fe1577fbd3c44b15c26 (patch)
tree0f2e194a85fb7fe5d4b2f5b4cdc397556ea3a112 /net
parentImplement ip-token(8) addressing for IPv6. (diff)
downloadnetifrc-e04d54da670198ce0aff2fe1577fbd3c44b15c26.tar.gz
netifrc-e04d54da670198ce0aff2fe1577fbd3c44b15c26.tar.bz2
netifrc-e04d54da670198ce0aff2fe1577fbd3c44b15c26.zip
Disable IPv6 on subdevices for bonding and bridges0.7.9
Rather than shelling out to the `sysctl` command like the PR does, let's write directly to `/proc/sys` after checking that it exists. This likely needs work to do the same thing on BSD. Closes: https://bugs.gentoo.org/515640 Closes: https://github.com/gentoo/netifrc/pull/55 Signed-off-by: Patrick McLean <chutzpah@gentoo.org>
Diffstat (limited to 'net')
-rw-r--r--net/bonding.sh2
-rw-r--r--net/bridge.sh2
2 files changed, 4 insertions, 0 deletions
diff --git a/net/bonding.sh b/net/bonding.sh
index e3fcaa7..bb8b061 100644
--- a/net/bonding.sh
+++ b/net/bonding.sh
@@ -133,6 +133,8 @@ bonding_pre_start()
for IFACE in ${slaves}; do
_delete_addresses
_down
+ local disable_ipv6="/proc/sys/net/ipv6/conf/${IFACE}/disable_ipv6"
+ [ -f "${disable_ipv6}" ] && printf '1\n' > "${disable_ipv6}"
done
fi
)
diff --git a/net/bridge.sh b/net/bridge.sh
index a380f6a..cea8a49 100644
--- a/net/bridge.sh
+++ b/net/bridge.sh
@@ -152,6 +152,8 @@ bridge_pre_start()
return 1
fi
# The interface is known to exist now
+ local disable_ipv6="/proc/sys/net/ipv6/conf/${IFACE}/disable_ipv6"
+ [ -f "${disable_ipv6}" ] && printf '1\n' > "${disable_ipv6}"
_up
if ${do_iproute2}; then
_netns ip link set "${x}" master "${BR_IFACE}"