diff options
-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 |