summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren 'Tadgy' Austin <darren@afterdark.org.uk>2018-07-26 12:33:16 +0100
committerRobby Workman <rworkman@slackware.com>2018-11-25 18:58:51 -0600
commitaf0a481ef072d220a58ef6a8da1409fb442fa733 (patch)
treea2975a34c953b959d45db3fab1c5ace939cabf85
parent053c460b5308b45adf551adf56ac0ef4ba5d7e41 (diff)
downloadslacknetsetup-af0a481ef072d220a58ef6a8da1409fb442fa733.tar.xz
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 <rworkman@slackware.com>
-rw-r--r--rc.inet18
1 files changed, 6 insertions, 2 deletions
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"