diff options
author | Colin Guthrie <colin@mageia.org> | 2012-04-02 22:21:59 +0100 |
---|---|---|
committer | Colin Guthrie <colin@mageia.org> | 2012-04-02 23:29:08 +0100 |
commit | 25e26735664e1d8391da988e124b45026cc40bfc (patch) | |
tree | 4276f8128577d86f85ebd6a2702834ee638e13f5 /mandriva | |
parent | 28b1f3fcf8477a057ba43ac25a6c13aa516df115 (diff) | |
download | initscripts-25e26735664e1d8391da988e124b45026cc40bfc.tar initscripts-25e26735664e1d8391da988e124b45026cc40bfc.tar.gz initscripts-25e26735664e1d8391da988e124b45026cc40bfc.tar.bz2 initscripts-25e26735664e1d8391da988e124b45026cc40bfc.tar.xz initscripts-25e26735664e1d8391da988e124b45026cc40bfc.zip |
network-up: Let NM do more work when waiting for network to be up.
Trust link detection to Network Manager rather than doing more work ourselves.
Also ensure we wait for resolvconf even when we are using NM as this is still
needed.
Diffstat (limited to 'mandriva')
-rwxr-xr-x | mandriva/network-up | 52 |
1 files changed, 35 insertions, 17 deletions
diff --git a/mandriva/network-up b/mandriva/network-up index 10150410..1a1d338b 100755 --- a/mandriva/network-up +++ b/mandriva/network-up @@ -101,27 +101,45 @@ function should_wait_network() { # ignore devices that are not present ip -o link show ${DEVICE} &>/dev/null || continue - # check link beat - if ! may_have_link ${DEVICE}; then - # before configured delay, consider a lack of link beat - # as not ready, and unplugged thereafter - if [ $ELAPSED_TIME -lt $LINK_DETECTION_DELAY ]; then - return 0 - fi - # no need to wait for unplugged devices to come up - continue - fi - ! is_false $NM_CONTROLLED && is_nm_running && USE_NM=true # for NM controlled just ask NetworkManager if [ "$USE_NM" = "true" ]; then - is_nm_active ${DEVICE} && continue || return 0 - fi + # Ignore disabled wifi h/w + if is_nm_device_unavailable ${DEVICE}; then + # Question: Is NM cleverer than us here? Does it do this delay + # internally and mark it as disconnected until it knows better? + + # before configured delay, consider a lack of link beat + # as not ready, and unplugged thereafter + if [ $ELAPSED_TIME -lt $LINK_DETECTION_DELAY ]; then + return 0 + fi + # no need to wait for unplugged devices to come up + continue + fi - # check address is set - ADDR=`ip addr show scope global ${DEVICE} | awk '/inet/ {print $2;}'` - if [ -z "$ADDR" ]; then - return 0 + is_nm_active ${DEVICE} || return 0 + + # The resolvconf check below uses a single generic "NetworkManager" + # DNS file, rather than device specific ones, so fudge the device. + DEVICE=NetworkManager + else + # check link beat + if ! may_have_link ${DEVICE}; then + # before configured delay, consider a lack of link beat + # as not ready, and unplugged thereafter + if [ $ELAPSED_TIME -lt $LINK_DETECTION_DELAY ]; then + return 0 + fi + # no need to wait for unplugged devices to come up + continue + fi + + # check address is set + ADDR=`ip addr show scope global ${DEVICE} | awk '/inet/ {print $2;}'` + if [ -z "$ADDR" ]; then + return 0 + fi fi # wait for changes to be propagated by resolvconf if needed |