summaryrefslogtreecommitdiffstats
path: root/src/connections/ethernet
diff options
context:
space:
mode:
Diffstat (limited to 'src/connections/ethernet')
-rw-r--r--src/connections/ethernet11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/connections/ethernet b/src/connections/ethernet
index 64a8513..71124d0 100644
--- a/src/connections/ethernet
+++ b/src/connections/ethernet
@@ -12,9 +12,10 @@ ethernet_up() {
fi
report_debug ethernet_up ifup
- set_interface up "$INTERFACE"
+ set_interface up-old "$INTERFACE"
- if ip link show $INTERFACE| fgrep -q "NO-CARRIER"; then
+ # don't think it's possible to detect carrier using ifconfig alone (at least, not without ifdown/ifupping the interface)
+ if [[ $(cat /sys/class/net/$INTERFACE/carrier 2>/dev/null) -ne 1 ]]; then # gives err if iface inactive (i.e. ifdown)
report_fail "No connection"
return 1
fi
@@ -31,7 +32,7 @@ ethernet_up() {
if ! wpa_check "$INTERFACE"; then
# ignore quirk nodown---is that appropriate?
# this adds a flush call as well---is that appropriate?
- set_interface forcedown "$INTERFACE"
+ set_interface forcedown-old "$INTERFACE"
report_fail "WPA Authentication/Association Failed"
return 1
fi
@@ -78,7 +79,7 @@ ethernet_up() {
# 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"
+ set_interface forcedown-old "$INTERFACE"
report_fail "Adding gateway $GATEWAY failed."
return 1
fi
@@ -144,7 +145,7 @@ ethernet_down() {
report_debug ethernet_down ifdown
# ignore quirk nodown---is that appropriate?
# this adds a flush call as well---is that appropriate?
- set_interface forcedown "$INTERFACE"
+ set_interface forcedown-old "$INTERFACE"
}
# Returns status of profile - is it still functional?