summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rc.inet112
1 files changed, 8 insertions, 4 deletions
diff --git a/rc.inet1 b/rc.inet1
index 22f788d..02c1193 100644
--- a/rc.inet1
+++ b/rc.inet1
@@ -367,8 +367,10 @@ if_down() {
echo "/etc/rc.d/rc.inet1: failed to stop dhcpcd for interface ${1}" | $LOGGER
fi
# Disable v6 IP auto configuration and RA before trying to clear the IP from the interface:
- echo "0" >/proc/sys/net/ipv6/conf/$1/autoconf
- echo "0" >/proc/sys/net/ipv6/conf/$1/accept_ra
+ if [ -e /proc/sys/net/ipv6 ]; then
+ echo "0" >/proc/sys/net/ipv6/conf/$1/autoconf
+ echo "0" >/proc/sys/net/ipv6/conf/$1/accept_ra
+ fi
sleep 0.5 # allow time for dhcp/ra to unconfigure the interface
# Flush any remaining IPs:
echo "/etc/rc.d/rc.inet1: /sbin/ip address flush dev ${1}" | $LOGGER
@@ -377,8 +379,10 @@ if_down() {
echo "/etc/rc.d/rc.inet1: /sbin/ip link set dev ${1} down" | $LOGGER
/sbin/ip link set dev ${1} down
# Reset autoconf and accept_ra back to defaults:
- cat /proc/sys/net/ipv6/conf/default/autoconf >/proc/sys/net/ipv6/conf/$1/autoconf
- cat /proc/sys/net/ipv6/conf/default/accept_ra >/proc/sys/net/ipv6/conf/$1/accept_ra
+ if [ -e /proc/sys/net/ipv6 ]; then
+ cat /proc/sys/net/ipv6/conf/default/autoconf >/proc/sys/net/ipv6/conf/$1/autoconf
+ cat /proc/sys/net/ipv6/conf/default/accept_ra >/proc/sys/net/ipv6/conf/$1/accept_ra
+ fi
# Kill wireless daemons if any:
if [ -x /etc/rc.d/rc.wireless ]; then
. /etc/rc.d/rc.wireless ${1} stop