summaryrefslogtreecommitdiffstats
path: root/rc.inet1
diff options
context:
space:
mode:
authorDarren 'Tadgy' Austin <darren@afterdark.org.uk>2018-07-31 12:05:00 +0100
committerRobby Workman <rworkman@slackware.com>2018-11-25 19:46:45 -0600
commit19b993175e7af945024fe80cbd8331014e6d018d (patch)
tree85e6dbdfb22ead58f3f4c060f52214174a84cc25 /rc.inet1
parent9b399a97a062d2404ec8108bf8e4c09fd57a1600 (diff)
downloadslacknetsetup-19b993175e7af945024fe80cbd8331014e6d018d.tar.xz
Finish up dhcp start block
Signed-off-by: Robby Workman <rworkman@slackware.com>
Diffstat (limited to 'rc.inet1')
-rw-r--r--rc.inet110
1 files changed, 6 insertions, 4 deletions
diff --git a/rc.inet1 b/rc.inet1
index 165672c..61be5b8 100644
--- a/rc.inet1
+++ b/rc.inet1
@@ -169,9 +169,8 @@ if_up() {
. /etc/rc.d/rc.wireless ${1} start
fi
IF_UP=0
- # Slackware historically favours DHCP over fixed IP to configure interfaces, so keep that tradition.
+ # Slackware historically favours DHCP over fixed IP to configure interfaces, so keep that tradition:
if [ "${USE_DHCP[$i]}" = "yes" ] || [ "${USE_DHCP6[$i]}" = "yes" ]; then # use dhcpcd to bring interface up
-# FIXME: This block needs some attention after talking to Robby:
# Disable v6 IP auto configuration before trying to set up the interface:
[ "${USE_DHCP6[$i]}" = "yes" ] && echo "0" >/proc/sys/net/ipv6/conf/$1/autoconf
# Declare DHCP_OPTIONS array before adding new options to it:
@@ -192,8 +191,11 @@ if_up() {
echo "Polling for DHCP server on interface ${1}:"
# 15 seconds should be a reasonable default DHCP timeout. 30 was too much.
echo "/etc/rc.d/rc.inet1: /sbin/dhcpcd -L -t ${DHCP_TIMEOUT[$i]:-15} ${DHCP_OPTIONS[@]} ${1}" | $LOGGER
- /sbin/dhcpcd -L -t "${DHCP_TIMEOUT[$i]:-15}" "${DHCP_OPTIONS[@]}" ${1}
- IF_UP=1
+ if /sbin/dhcpcd -L -t "${DHCP_TIMEOUT[$i]:-15}" "${DHCP_OPTIONS[@]}" ${1}; then
+ IF_UP=1
+ else
+ echo "/etc/rc.d/rc.inet1: failed to obtain DHCP lease for ${1}" | $LOGGER
+ fi
fi
if [ "${USE_DHCP[$i]}" != "yes" ] && [ -n "${IPADDR[$i]}" ]; then # use a fixed v4 IP to bring interface up
if [ -z "${NETMASK[$i]}"; then