Commit 162af2a4 authored by Jouke Witteveen's avatar Jouke Witteveen
Browse files

Do not allow the kernel to try and be smarter than us

When accept_ra is set to 1, router advertisements are still ignored if
the interface is in forwarding mode. For such configurations, the
interface should have a static configuration and netctl already sets
accept_ra to 0. Setting it to 2 otherwise forces the kernel to accept
router advertisements regardless of the forwarding setting.
parent ea9ccfd2
......@@ -50,13 +50,16 @@ ip_set() {
dhcp|dhcp-noaddr|stateless|static)
[[ -d "/proc/sys/net/ipv6" ]] || modprobe ipv6
sysctl -q -w "net.ipv6.conf.$interface_sysctl.disable_ipv6=0"
[[ $IP6 == "static" ]]
sysctl -q -w "net.ipv6.conf.$interface_sysctl.accept_ra=$?"
if [[ $IP6 == "static" ]]; then
sysctl -q -w "net.ipv6.conf.$interface_sysctl.accept_ra=0"
else # Accept router advertisements regardless of the forwarding setting
sysctl -q -w "net.ipv6.conf.$interface_sysctl.accept_ra=2"
fi
;;
no)
[[ -d "/proc/sys/net/ipv6" ]] && sysctl -q -w "net.ipv6.conf.$interface_sysctl.disable_ipv6=1"
;;
"") # undefined IP6 does not prevent RA's from being received -> nop
"") # Having IP6= unset does not prevent router advertisements from being received
;;
*)
report_error "IP6 must be 'dhcp', 'dhcp-noaddr', 'stateless', 'static' or 'no'"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment