From: Tomasz Pala Date: Mon, 16 Nov 2009 14:07:35 +0000 (+0000) Subject: - don't call check_mii_tool if ethtool or iwconfig reported success X-Git-Tag: 0.4.2.6~8 X-Git-Url: http://git.pld-linux.org/?p=projects%2Frc-scripts.git;a=commitdiff_plain;h=d36ee0fb57977ba382543ce8afb25af937c52cce - don't call check_mii_tool if ethtool or iwconfig reported success svn-id: @10970 --- diff --git a/sysconfig/network-scripts/functions.network b/sysconfig/network-scripts/functions.network index 65d92e50..07ae30a1 100644 --- a/sysconfig/network-scripts/functions.network +++ b/sysconfig/network-scripts/functions.network @@ -14,11 +14,11 @@ source_config () DEVNAME=${DEVNAME##tnlcfg-} if [[ "$CONFIG" = /* ]]; then - if [ -f "$CONFIG" ] ; then + if [ -f "$CONFIG" ]; then . "$CONFIG" foundconfig=1 fi - elif [ -f "/etc/sysconfig/interfaces/$CONFIG" ] ; then + elif [ -f "/etc/sysconfig/interfaces/$CONFIG" ]; then . "/etc/sysconfig/interfaces/$CONFIG" foundconfig=1 fi @@ -205,12 +205,12 @@ setup_ip_param () eval IP4ADDROPT="\$IP_AOPTS${IP4_PRIM_IF:-}" eval IP4ROUTEOPT="\$IP_ROPTS${IP4_PRIM_IF:-}" fi - if [ "${IP6_PRIM_IF}" ] ; then + if [ "${IP6_PRIM_IF}" ]; then eval IP6ADDR="\$IPADDR${IP6_PRIM_IF:-}" eval IP6ADDROPT="\$IPV6_AOPTS${IP6_PRIM_IF:-}" eval IP6ADDRLABEL="\$IP_LABEL${IP6_PRIM_IF:-}" fi - if [ "${IP4_SRC_IF}" ] ; then + if [ "${IP4_SRC_IF}" ]; then eval IP4SRCADDR="\$IPADDR${IP4_SRC_IF}" IP4SRCADDR=$(echo ${IP4SRCADDR} | awk ' { gsub(/\/.*/,NIL); print "src " $0; } ') fi @@ -242,7 +242,7 @@ setup_ip_param () fi # ARP ready devices - if [ "$ARP" ] ; then + if [ "$ARP" ]; then if is_yes "$ARP"; then ARP="arp on" else @@ -313,7 +313,7 @@ setup_routes() local args if [ -f /etc/sysconfig/static-routes ]; then - if [ "$1" = "on" -o "$1" = "yes" ] ; then + if [ "$1" = "on" -o "$1" = "yes" ]; then grep -E "^(none|any)[[:blank:]]" /etc/sysconfig/static-routes | while read device args; do /sbin/ip route add $args done @@ -422,7 +422,7 @@ calcnetmask() # Retrievies PPPD PID and real interface name from /var/run/ppp-*.pid get_ppp_device_and_pid () { - if [ -f "/var/run/ppp-$DEVNAME.pid" ] ; then + if [ -f "/var/run/ppp-$DEVNAME.pid" ]; then eval $( { read PID ; echo "PID='$PID'" @@ -430,7 +430,7 @@ get_ppp_device_and_pid () } < "/var/run/ppp-$DEVNAME.pid") fi - if [ -z "$REALDEVICE" ] ; then + if [ -z "$REALDEVICE" ]; then REALDEVICE=$DEVICE fi } @@ -441,7 +441,7 @@ setup_ip_rules () { local args prio from src - if [ -f /etc/sysconfig/static-routes ] ; then + if [ -f /etc/sysconfig/static-routes ]; then if is_yes "$1"; then grep -E "^(from|to|iif|tos|fwmark|dev|pref|priority|prio)[[:blank:]]" /etc/sysconfig/static-routes | while read args; do /sbin/ip rule add $args @@ -600,18 +600,18 @@ check_link_down () ip link set dev $1 up >/dev/null 2>&1 timeout=0 while [ $timeout -le 6 ]; do - check_mii_tool $1 - m=$? check_ethtool $1 e=$? check_iwconfig $1 i=$? # trust ethtool and iwconfig - if [ $i -eq 1 ] || [ $e -eq 1 ] ; then + if [ $i -eq 1 ] || [ $e -eq 1 ]; then return 1 fi # use mii check only if all other check are unsupported # (mii check lies too often) + check_mii_tool $1 + m=$? if [ $m -eq 1 ] && [ $i -eq 2 ] && [ $e -eq 2 ]; then return 1 fi