Commit 169c8177 authored by Darren 'Tadgy' Austin's avatar Darren 'Tadgy' Austin

Set autoconf to 0 for dhcp/fixedIP, and 1 for stateless

parent 5b465604
......@@ -157,12 +157,6 @@ 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]}
......@@ -175,6 +169,8 @@ if_up() {
. /etc/rc.d/rc.wireless ${1} start # Initialize any wireless parameters
fi
if [ "${USE_DHCP[$i]}" = "yes" ] || [ "${USE_DHCP6[$i]}" = "yes" ]; then # use dhcpcd to bring interface up
# Disable v6 IP auto configuration.
echo "0" >/proc/sys/net/ipv6/conf/$1/autoconf
# Clear DHCP_OPTIONS before adding new options to it:
unset DHCP_OPTIONS
# Set DHCP_OPTIONS for this interface:
......@@ -225,6 +221,8 @@ if_up() {
fi
fi
elif [ -n "${IPADDR[$i]}" ] || [ -n "${IPADDR6[$i]}" ]; then # use a fixed IP to bring interface up
# Disable v6 IP auto configuration.
echo "0" >/proc/sys/net/ipv6/conf/$1/autoconf
if [ -n "${IPADDR[$i]}" ]; then # skip unconfigured interfaces
# Set up the network card:
echo "/etc/rc.d/rc.inet1: /sbin/ip address add ${IPADDR[$i]}/${NETMASK[$i]} broadcast + dev ${1}" | $LOGGER
......@@ -252,6 +250,7 @@ if_up() {
fi
elif [ "${USE_STATELESS[$i]}" = "yes" ]; then # interface should configure itself via stateless RA auto config
echo "/etc/rc.d/rc.inet1: using stateless Router Advertisement auto configuration for ${1}" | $LOGGER
echo "1" >/proc/sys/net/ipv6/conf/$1/autoconf
else # interface is unconfigured
debug_log "${1} interface is not configured in /etc/rc.d/rc.inet1.conf"
fi
......
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