diff options
author | Darren 'Tadgy' Austin <darren@afterdark.org.uk> | 2018-07-26 02:22:02 +0100 |
---|---|---|
committer | Robby Workman <rworkman@slackware.com> | 2018-11-25 14:18:08 -0600 |
commit | bbf50a821d8134dcec0f00dce94885f7e6de3bcf (patch) | |
tree | 34847d1ff5e7a5b70008e10d26672a65ddb0123e /rc.inet1 | |
parent | 2e95f250e5634b3c6e5a1a9d13a0e3a3310dc566 (diff) | |
download | slacknetsetup-bbf50a821d8134dcec0f00dce94885f7e6de3bcf.tar.xz |
Added code to enable/disable v6 autoconf for an interface
Signed-off-by: Robby Workman <rworkman@slackware.com>
Diffstat (limited to 'rc.inet1')
-rw-r--r-- | rc.inet1 | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -157,6 +157,12 @@ if_up() { if [ -e /sys/class/net/${1%%:*} ]; then # interface exists if ! /sbin/ip address show permanent scope global dev ${1} 2>/dev/null | grep -Ewq '(inet|inet6)' || \ ! /sbin/ip link show dev ${1} | grep -wq "state UP" ; then # interface not up or not configured + # Enable/disable v6 IP auto configuration. + if [ "${USE_STATELESS[$i]}" = "yes" ]; then + echo "1" >/proc/sys/net/ipv6/conf/$1/autoconf + else + echo "0" >/proc/sys/net/ipv6/conf/$1/autoconf + fi if [ -n "${HWADDR[$i]}" ]; then # Set hardware address _before_ the interface goes up: echo "/etc/rc.d/rc.inet1: /sbin/ip link set dev ${1} address ${HWADDR[$i]}" | $LOGGER /sbin/ip link set dev ${1} address ${HWADDR[$i]} @@ -280,6 +286,8 @@ if_down() { if [ -x /etc/rc.d/rc.wireless ]; then . /etc/rc.d/rc.wireless ${1} stop # Kill wireless daemons if any. fi + # Set interface v6 autoconf back to the default (disabled): + echo "0" >/proc/sys/net/ipv6/conf/$1/autoconf # If the interface is a bridge, then destroy it now: if [ -n "${BRNICS[$i]}" ]; then br_close $i |