From aa20dd1eaeecd73e52d656ac3ca4d1a2a558edba Mon Sep 17 00:00:00 2001 From: Jouke Witteveen Date: Wed, 10 Apr 2013 20:33:38 +0200 Subject: Fix DHCPOptions Split them into different variables for different clients. Also, IP6 gets its own, so that it can have options different from the IP4 invocation. --- src/lib/auto.action | 4 ++-- src/lib/ip | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/lib') diff --git a/src/lib/auto.action b/src/lib/auto.action index 6cb6ff5..feebd77 100755 --- a/src/lib/auto.action +++ b/src/lib/auto.action @@ -17,10 +17,10 @@ case $action in if [[ -x "$PROFILE_DIR/interfaces/$interface" ]]; then source "$PROFILE_DIR/interfaces/$interface" fi - dhcpcd -qL -t "${TimeoutDHCP:-10}" $DHCPOptions -K "$interface" + dhcpcd -qL -t "${TimeoutDHCP:-10}" $DhcpcdOptions -K "$interface" exit $? fi - DHCPOptions+=" -K" + DhcpcdOptions+=" -K" ip_set || exit 1 # JP: sandbox the eval if ! ( eval $ExecUpPost ); then diff --git a/src/lib/ip b/src/lib/ip index 8723e5b..c1f1fc7 100644 --- a/src/lib/ip +++ b/src/lib/ip @@ -30,7 +30,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 -qL -t "${TimeoutDHCP:-10}" $DHCPOptions "$Interface" 2>&1 | report_debug "$(cat)" + do_debug dhcpcd -qL -t "${TimeoutDHCP:-10}" $DhcpcdOptions "$Interface" 2>&1 | 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'" @@ -107,9 +107,9 @@ ip_set() { return 1 fi sysctl -q -w "net.ipv6.conf.$interface_sysctl.accept_ra=1" - [[ $IP6 == "dhcp-noaddr" ]] && Dhclient6Options+=" -S" + [[ $IP6 == "dhcp-noaddr" ]] && DhclientOptions6+=" -S" rm -f "/run/dhclient6-${Interface}.pid" - if ! do_debug dhclient -6 -q -e "TIMEOUT=${TimeoutDHCP:-10}" -pf "$Pidfile" $Dhclient6Options "$Interface"; then + if ! do_debug dhclient -6 -q -e "TIMEOUT=${TimeoutDHCP:-10}" -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