diff options
author | James Rayner <james@archlinux.org> | 2009-09-27 14:04:28 +0200 |
---|---|---|
committer | James Rayner <james@archlinux.org> | 2009-09-27 14:04:28 +0200 |
commit | dce7afd6a8d4bcd6adb7f1d1b330c21fcb8c9957 (patch) | |
tree | f9675d14d4d694245751956e7fa019d3b0ca9ad3 /src/connections | |
parent | 8b355a1e43887b67c327d5c79c488a0a673f35dc (diff) | |
download | netctl-dce7afd6a8d4bcd6adb7f1d1b330c21fcb8c9957.tar.gz netctl-dce7afd6a8d4bcd6adb7f1d1b330c21fcb8c9957.tar.xz |
Only flush when disabling wireless interface, tidy up down/forcedown
Diffstat (limited to 'src/connections')
-rw-r--r-- | src/connections/ethernet | 13 | ||||
-rw-r--r-- | src/connections/wireless | 8 |
2 files changed, 9 insertions, 12 deletions
diff --git a/src/connections/ethernet b/src/connections/ethernet index 20ee545..a0641d0 100644 --- a/src/connections/ethernet +++ b/src/connections/ethernet @@ -40,9 +40,7 @@ ethernet_up() { fi if ! wpa_check "$INTERFACE"; then - # ignore quirk nodown---is that appropriate? or should we just use report_iproute? - # this adds a flush call as well---is that appropriate? - bring_interface forcedown "$INTERFACE" + bring_interface down "$INTERFACE" report_fail "WPA Authentication/Association Failed" return 1 fi @@ -145,10 +143,11 @@ ethernet_down() { fi report_debug ethernet_iproute_down if_down - # ignore quirk nodown---is that appropriate? - # this adds a flush call as well---is that appropriate? - bring_interface forcedown "$INTERFACE" - + if [[ "$CONNECTION" == "wireless" ]]; then + bring_interface flush "$INTERFACE" + else + bring_interface down "$INTERFACE" + fi } # Returns status of profile - is it still functional? diff --git a/src/connections/wireless b/src/connections/wireless index 2d2463d..6de7379 100644 --- a/src/connections/wireless +++ b/src/connections/wireless @@ -43,7 +43,7 @@ iwconfig_up() { fi fi - quirk "predown" && bring_interface forcedown "$INTERFACE" # madwifi FS#10585 + quirk "predown" && bring_interface down "$INTERFACE" # madwifi FS#10585 report_debug wireless_up iwconfig "$INTERFACE" $WEP_OPTS @@ -165,12 +165,10 @@ wireless_up() { # wireless_down PROFILE [ LEAVE ifconfig up? default no ] wireless_down() { - local PROFILE="$1" NOETHERNETDOWN="$2" + local PROFILE="$1" load_profile "$PROFILE" - if ! checkyesno "$NOETHERNETDOWN"; then - "$CONN_DIR/ethernet" down "$PROFILE" - fi + "$CONN_DIR/ethernet" down "$PROFILE" if [[ ${SECURITY:(-4)} == "-old" ]]; then report_debug wireless_down iwconfig "$INTERFACE" essid off key off |