diff options
author | Jouke Witteveen <j.witteveen@gmail.com> | 2012-04-03 12:21:19 +0200 |
---|---|---|
committer | Jouke Witteveen <j.witteveen@gmail.com> | 2012-04-03 12:21:19 +0200 |
commit | d560b09b823e5094af9cd6148acd115bfb2c2f41 (patch) | |
tree | c6312e55fe65b320fb15b4d0279e6edc3b623479 | |
parent | 3fab6603d9e31b8887e2d7787edd3da32df425e9 (diff) | |
download | netctl-d560b09b823e5094af9cd6148acd115bfb2c2f41.tar.gz netctl-d560b09b823e5094af9cd6148acd115bfb2c2f41.tar.xz |
auto-wireless: improve dhcpcd call
- Use "-K" to prevent unnecessary remove/re-acquire a lease.
- Respect /etc/network.d/interfaces/$interface and the dhcp options set there when connecting without a matching profile. Also use the same options used in $CONN_DIR/ethernet.
Fixes by Thomas Bächler
-rwxr-xr-x | scripts/netcfg-wpa_actiond-action | 6 | ||||
-rw-r--r-- | src/connections/ethernet | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/scripts/netcfg-wpa_actiond-action b/scripts/netcfg-wpa_actiond-action index 3547fef..1f29364 100755 --- a/scripts/netcfg-wpa_actiond-action +++ b/scripts/netcfg-wpa_actiond-action @@ -11,10 +11,12 @@ action="$4" case $action in CONNECT) if [[ -z $profile ]]; then - dhcpcd "$interface" + # Load interface specific config + [[ -f "$IFACE_DIR/$interface" ]] && source "$IFACE_DIR/$interface" + dhcpcd -qL -t "${DHCP_TIMEOUT:-10}" -K $DHCP_OPTIONS "$interface" exit $? fi - if ! $CONN_DIR/ethernet up "$profile"; then + if ! DHCPCD_INTERNAL_OPTIONS="-K" $CONN_DIR/ethernet up "$profile"; then exit 1 # what to do if fail? fi diff --git a/src/connections/ethernet b/src/connections/ethernet index 3e4a992..420dd1e 100644 --- a/src/connections/ethernet +++ b/src/connections/ethernet @@ -83,8 +83,8 @@ ethernet_up() { # If using own dns, tell dhcpcd to NOT replace resolv.conf [[ -n "$DNS" ]] && DHCP_OPTIONS="-C resolv.conf $DHCP_OPTIONS" # Start dhcpcd - report_debug ethernet_up dhcpcd -qL -t "${DHCP_TIMEOUT:-10}" $DHCP_OPTIONS "$INTERFACE" - dhcpcd -qL -t "${DHCP_TIMEOUT:-10}" $DHCP_OPTIONS "$INTERFACE" 2>&1 | report_debug "$(cat)" + report_debug ethernet_up dhcpcd -qL -t "${DHCP_TIMEOUT:-10}" $DHCPCD_INTERNAL_OPTIONS $DHCP_OPTIONS "$INTERFACE" + dhcpcd -qL -t "${DHCP_TIMEOUT:-10}" $DHCPCD_INTERNAL_OPTIONS $DHCP_OPTIONS "$INTERFACE" 2>&1 | report_debug "$(cat)" if [[ "$PIPESTATUS" -ne 0 ]]; then report_fail "DHCP IP lease attempt failed." stop_80211x |