From ec3714dbcbe262f55be626ac8058c6273d7cea50 Mon Sep 17 00:00:00 2001 From: Darren 'Tadgy' Austin Date: Sat, 28 Jul 2018 09:43:11 +0100 Subject: Removed old code and comments from dhcp section Signed-off-by: Robby Workman --- rc.inet1 | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/rc.inet1 b/rc.inet1 index 9911182..0094b42 100644 --- a/rc.inet1 +++ b/rc.inet1 @@ -182,40 +182,9 @@ if_up() { [ "${DHCP_NOIPV4LL[$i]}" = "yes" ] && DHCP_OPTIONS="$DHCP_OPTIONS -L" [ -n "${DHCP_IPADDR[$i]}" ] && DHCP_OPTIONS="$DHCP_OPTIONS -r ${DHCP_IPADDR[$i]}" echo "Polling for DHCP server on interface ${1}:" - # If you set a timeout, you get one, even if the kernel doesn't think that - # your device is connected, in case /sys isn't right (which it usually isn't - # except right after the device is loaded, when it usually is): - #### (start commented out) - # This is deactivated for now since the kernel has been returning incorrect - # results concerning whether the interface carrier is detected. - #if [ -z "${DHCP_TIMEOUT[$i]}" ]; then - # /sbin/ip link set dev ${1} up && sleep 1 - # CONNSTATUS="$(cat /sys/class/net/${1}/carrier 2> /dev/null)" - # /sbin/ip link set dev ${1} down - # if [ "$CONNSTATUS" = "0" ]; then - # # The kernel has just told us the cable isn't even plugged in, but we will - # # give any DHCP server a short chance to reply anyway: - # echo "No carrier detected on ${1}. Reducing DHCP timeout to 15 seconds." - # DHCP_TIMEOUT[$i]=15 - # fi - #fi - #### (end commented out) # 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 [ "$?" == "0" ]; then # the dhcp call has succeeded - if [ -n "${IPALIASES[$i]}" ]; then - # Add extra IP addresses, if defined, to interface - num=0 - for ipalias in ${IPALIASES[$i]}; do - ip="${ipalias%/*}" - nm="${ipalias#*/}" - [ -z "$nm" ] || [ "$ip" == "$nm" ] && nm="32" - /sbin/ip address add ${ip}/${nm} dev ${1} label ${1}:${num} - num=$(($num + 1)) - done - 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 @@ -254,7 +223,8 @@ if_up() { echo "1" >/proc/sys/net/ipv6/conf/$1/autoconf # Bring the interface up: /sbin/ip link set dev ${1} up - for ((j = 20; j--;)); do # give some time for the interface to configure + echo "Waiting for Router Announcement on ${1}..." + for ((j = 20; j--;)); do # wait a max of 10 seconds for the interface to configure /sbin/ip -6 address show dynamic dev ${1} 2>/dev/null | grep -Ewq 'inet6' && break sleep 0.5 done -- cgit v1.2.3