diff options
author | James Rayner <james@rayner.id.au> | 2010-11-21 03:23:51 +0100 |
---|---|---|
committer | James Rayner <james@rayner.id.au> | 2010-11-21 03:23:51 +0100 |
commit | b96b428d9ff44d3e007a2b81113390c734f2323d (patch) | |
tree | ed76df4507a870adbcbe541d97f27d38c318d270 /src/connections | |
parent | 6b43b99662e82534388b34258e140374a439dccf (diff) | |
download | netctl-b96b428d9ff44d3e007a2b81113390c734f2323d.tar.gz netctl-b96b428d9ff44d3e007a2b81113390c734f2323d.tar.xz |
FS#20150 - 802.11x: correct state check, handle disconnect
Diffstat (limited to 'src/connections')
-rw-r--r-- | src/connections/ethernet | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/connections/ethernet b/src/connections/ethernet index 36f6b93..cdb45ce 100644 --- a/src/connections/ethernet +++ b/src/connections/ethernet @@ -39,7 +39,7 @@ ethernet_up() { return 1 fi - if ! wpa_check "$INTERFACE"; then + if ! wpa_check "$INTERFACE" 15 "ASSOCIATED"; then bring_interface down "$INTERFACE" report_fail "WPA Authentication/Association Failed" return 1 @@ -53,6 +53,7 @@ ethernet_up() { report_debug ethernet_up dhclient -q -e TIMEOUT="${DHCP_TIMEOUT:-10}" -pf "/var/run/dhclient-$INTERFACE.pid" "$INTERFACE" if ! dhclient -q -e TIMEOUT="${DHCP_TIMEOUT:-10}" -pf "/var/run/dhclient-${INTERFACE}.pid" ${DHCLIENT_OPTIONS} "$INTERFACE"; then report_fail "DHCP IP lease attempt failed." + stop_80211x return 1 fi else @@ -65,6 +66,7 @@ ethernet_up() { dhcpcd -qL -t "${DHCP_TIMEOUT:-10}" $DHCP_OPTIONS "$INTERFACE" 2>&1 | report_debug "$(cat)" if [[ "$PIPESTATUS" -ne 0 ]]; then report_fail "DHCP IP lease attempt failed." + stop_80211x return 1 fi fi @@ -143,6 +145,8 @@ ethernet_down() { fi fi + stop_80211x + report_debug ethernet_down if_down if [[ "$CONNECTION" == "wireless" ]]; then bring_interface flush "$INTERFACE" @@ -159,6 +163,15 @@ ethernet_status() { fi } +# Stop wpa_supplicant if neccessary +stop_80211x() { + if checkyesno "${AUTH8021X:-no}"; then + . "$SUBR_DIR/8021x" + report_debug ethernet_down stop_wpa "$INTERFACE" + stop_wpa "$INTERFACE" + fi +} + ethernet_$1 "$2" exit $? # vim: set ts=4 et sw=4: |