From 5dcfe32331185127e8424414a7bc7cf05b5f95cd Mon Sep 17 00:00:00 2001 From: Darren 'Tadgy' Austin Date: Fri, 14 Sep 2018 00:27:13 +0100 Subject: Added USE_RA[x] option to explicitly enable/disable RA support Signed-off-by: Robby Workman --- rc.inet1 | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'rc.inet1') diff --git a/rc.inet1 b/rc.inet1 index 6668c44..ca916b4 100644 --- a/rc.inet1 +++ b/rc.inet1 @@ -186,7 +186,11 @@ if_up() { # Disable v6 IP auto configuration before trying to bring up the interface: echo "0" >/proc/sys/net/ipv6/conf/$1/autoconf # Disable Router Advertisment for this interface until it's needed: - echo "0" >/proc/sys/net/ipv6/conf/$1/accept_ra + if [ "${USE_RA[$i]}" = "yes" ]; then + echo "1" >/proc/sys/net/ipv6/conf/$1/accept_ra + else + echo "0" >/proc/sys/net/ipv6/conf/$1/accept_ra + fi fi local IF_UP=0 # Slackware historically favours dynamic configuration over fixed IP to configure interfaces, so keep that tradition: @@ -225,8 +229,13 @@ if_up() { fi if [ -e /proc/sys/net/ipv6 ] && [ "${USE_DHCP6[$i]}" != "yes" ] && [ "${USE_SLAAC[$i]}" = "yes" ]; then # configure via SLAAC echo "/etc/rc.d/rc.inet1: using Router Advertisement stateless auto configuration for ${1}" | $LOGGER - # Enable accepting of router advertisment packets, and auto configuration of interfaces: - echo "1" >/proc/sys/net/ipv6/conf/$1/accept_ra + # Enable accepting of RA packets, unless explicitly configured not to. + if [ "${USE_RA[$i]}" = "no" ]; then + echo "0" >/proc/sys/net/ipv6/conf/$1/accept_ra + else + echo "1" >/proc/sys/net/ipv6/conf/$1/accept_ra + fi + # Enable auto configuration of interfaces: echo "1" >/proc/sys/net/ipv6/conf/$1/autoconf # Bring the interface up: /sbin/ip link set dev ${1} up -- cgit v1.2.3