summaryrefslogtreecommitdiffstats
path: root/src/connections/ethernet
diff options
context:
space:
mode:
authorJim Pryor <profjim@jimpryor.net>2009-08-11 14:05:13 +0200
committerJames Rayner <james@archlinux.org>2009-08-15 04:28:30 +0200
commite27d094577f874613c49cc3d93796162230ca2c8 (patch)
treefbd7cb78b7c6d11b6d12febce6a9f99581a64a67 /src/connections/ethernet
parent2282776f1dd928b6c5f56e30cbf2c52a4f26303d (diff)
downloadnetctl-e27d094577f874613c49cc3d93796162230ca2c8.tar.gz
netctl-e27d094577f874613c49cc3d93796162230ca2c8.tar.xz
start consolidation of ifconfig/ip/set_interface
* try to factor all the ifconfig/ip set dev code to single location (currently networks/set_interface, though I recommend a different name for this function because it's too close in name and different in functionality from set_iface, set_profile). * added "forcedown" option to set_interface, meaning "just go down don't worry about 'nodown' quirks" * even with "forcedown", this factoring would introduce "ip addr flush dev $INTERFACE" calls to existing code. I assume that's harmless? or even beneficial? * one code block (in ethernet_iproute) had stdout,stderr of the down calls redirected to /dev/null. I've moved that to set_interface, so now everyone's getting that behavior. I assume that's appropriate... * now no more calls to "ip" or "ifconfig" outside of set_interface, except the checks for NO-CARRIER after ethernet*/set_interface up. They might also be moved to network/set_interface? * as of this commit, all the set_interface calls are now using ip instead of ifconfig. A subsequent commit will isolate the ip-use to ethernet-iproute and the ifconfig-use to ethernet. * ALERT: attend to wireless_down, it seems to be calling set_interface down twice (once in ethernet_down, once in itself). And neither this commit nor the code it's patching respects quirk nodown in the ethernet_down block. Signed-off-by: Jim Pryor <profjim@jimpryor.net>
Diffstat (limited to 'src/connections/ethernet')
-rw-r--r--src/connections/ethernet14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/connections/ethernet b/src/connections/ethernet
index 935bf8b..64a8513 100644
--- a/src/connections/ethernet
+++ b/src/connections/ethernet
@@ -12,7 +12,7 @@ ethernet_up() {
fi
report_debug ethernet_up ifup
- set_interface up $INTERFACE
+ set_interface up "$INTERFACE"
if ip link show $INTERFACE| fgrep -q "NO-CARRIER"; then
report_fail "No connection"
@@ -29,7 +29,9 @@ ethernet_up() {
return 1
fi
if ! wpa_check "$INTERFACE"; then
- ifconfig "$INTERFACE" down
+ # ignore quirk nodown---is that appropriate?
+ # this adds a flush call as well---is that appropriate?
+ set_interface forcedown "$INTERFACE"
report_fail "WPA Authentication/Association Failed"
return 1
fi
@@ -73,6 +75,10 @@ ethernet_up() {
if [[ -n "$GATEWAY" ]]; then
report_debug ethernet_up route add default gw "$GATEWAY"
if ! route add default gw $GATEWAY; then
+ # JP: don't we want to add this to all the aborts?
+ # ignore quirk nodown---is that appropriate?
+ # this adds a flush call as well---is that appropriate?
+ set_interface forcedown "$INTERFACE"
report_fail "Adding gateway $GATEWAY failed."
return 1
fi
@@ -136,7 +142,9 @@ ethernet_down() {
esac
report_debug ethernet_down ifdown
- set_interface down $INTERFACE
+ # ignore quirk nodown---is that appropriate?
+ # this adds a flush call as well---is that appropriate?
+ set_interface forcedown "$INTERFACE"
}
# Returns status of profile - is it still functional?