From af0a481ef072d220a58ef6a8da1409fb442fa733 Mon Sep 17 00:00:00 2001 From: Darren 'Tadgy' Austin Date: Thu, 26 Jul 2018 12:33:16 +0100 Subject: Account for IPv6 options in interface configuration logic TODO: I (RW) am not convinced that this will behave correctly if the ipv6 address is static while ipv4 is dynamic, or vice versa. Signed-off-by: Robby Workman --- rc.inet1 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'rc.inet1') diff --git a/rc.inet1 b/rc.inet1 index 51ae78f..acdb710 100644 --- a/rc.inet1 +++ b/rc.inet1 @@ -177,7 +177,7 @@ if_up() { if [ -x /etc/rc.d/rc.wireless ]; then . /etc/rc.d/rc.wireless ${1} start # Initialize any wireless parameters fi - if [ "${USE_DHCP[$i]}" = "yes" ]; then # use DHCP to bring interface up + if [ "${USE_DHCP[$i]}" = "yes" ] || [ "${USE_DHCP6[$i]}" = "yes" ]; then # use dhcpcd to bring interface up # Clear DHCP_OPTIONS before adding new options to it: unset DHCP_OPTIONS # Set DHCP_OPTIONS for this interface: @@ -227,7 +227,7 @@ if_up() { /sbin/ip link set dev ${1} promisc on fi fi - else # bring up interface using a static IP address + elif [ -n "${IPADDR[$i]}" ] || [ -n "${IPADDR6[$i]}" ]; then # use a fixed IP to bring interface up 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 @@ -253,6 +253,10 @@ if_up() { else debug_log "${1} interface is not configured in /etc/rc.d/rc.inet1.conf" 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 + else # interface is unconfigured + debug_log "${1} interface is not configured in /etc/rc.d/rc.inet1.conf" fi else debug_log "${1} is already up, skipping" -- cgit v1.2.3