From 5930a6eebc67b9665ea5d6133306a71030cd94a0 Mon Sep 17 00:00:00 2001 From: Jouke Witteveen Date: Mon, 21 Oct 2013 16:51:00 +0200 Subject: Increase default DHCP timeout New timeout is 30 seconds, which equals the current dhcpcd default. --- docs/netctl.profile.5.txt | 2 +- src/lib/ip | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/netctl.profile.5.txt b/docs/netctl.profile.5.txt index b1ccde1..17f0537 100644 --- a/docs/netctl.profile.5.txt +++ b/docs/netctl.profile.5.txt @@ -172,7 +172,7 @@ network. In particular, these connection types are +ethernet+, 'TimeoutDHCP=':: Maximum time, in seconds, to wait for DHCP to be successful. - Defaults to `++10++'. + Defaults to `++30++'. 'TimeoutDAD=':: Maximum time, in seconds, to wait for IPv6's Duplicate Address diff --git a/src/lib/ip b/src/lib/ip index d62ac0c..a93eaee 100644 --- a/src/lib/ip +++ b/src/lib/ip @@ -48,7 +48,7 @@ ip_set() { rm -f "/run/dhcpcd-$Interface".{pid,cache} # If using own dns, tell dhcpcd to NOT replace resolv.conf [[ $DNS ]] && DhcpcdOptions+=" -C resolv.conf" - do_debug dhcpcd -4qL -t "${TimeoutDHCP:-10}" $DhcpcdOptions "$Interface" |& report_debug "$(cat)" + do_debug dhcpcd -4qL -t "${TimeoutDHCP:-30}" $DhcpcdOptions "$Interface" |& report_debug "$(cat)" # The first array value of PIPESTATUS is the exit status of dhcpcd if (( PIPESTATUS != 0 )); then report_error "DHCP IP lease attempt failed on interface '$Interface'" @@ -57,7 +57,7 @@ ip_set() { ;; dhclient) rm -f "/run/dhclient-${Interface}.pid" - if ! do_debug dhclient -4 -q -e "TIMEOUT=${TimeoutDHCP:-10}" -pf "/run/dhclient-$Interface.pid" $DhclientOptions "$Interface"; then + if ! do_debug dhclient -4 -q -e "TIMEOUT=${TimeoutDHCP:-30}" -pf "/run/dhclient-$Interface.pid" $DhclientOptions "$Interface"; then report_error "DHCP IP lease attempt failed on interface '$Interface'" return 1 fi @@ -110,7 +110,7 @@ ip_set() { fi [[ $IP6 == "dhcp-noaddr" ]] && DhclientOptions6+=" -S" rm -f "/run/dhclient6-${Interface}.pid" - if ! do_debug dhclient -6 -q -e "TIMEOUT=${TimeoutDHCP:-10}" -pf "/run/dhclient6-${Interface}.pid" $DhclientOptions6 "$Interface"; then + if ! do_debug dhclient -6 -q -e "TIMEOUT=${TimeoutDHCP:-30}" -pf "/run/dhclient6-${Interface}.pid" $DhclientOptions6 "$Interface"; then report_error "DHCPv6 IP lease attempt failed on interface '$Interface'" return 1 fi -- cgit v1.2.3-24-g4f1b