From cc183971840b8ca4ca07d135d65270416e7a1c92 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 11 Sep 2003 04:06:17 +0000 Subject: always call 'ip link set *dev* ${DEVICE}', to avoid confusion with other ip parameters (#104187) --- sysconfig/network-scripts/ifdown | 4 ++-- sysconfig/network-scripts/ifup | 20 ++++++++++---------- sysconfig/network-scripts/network-functions | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/sysconfig/network-scripts/ifdown b/sysconfig/network-scripts/ifdown index 9622f0ca..dafc25fe 100755 --- a/sysconfig/network-scripts/ifdown +++ b/sysconfig/network-scripts/ifdown @@ -45,7 +45,7 @@ if [ -x $OTHERSCRIPT ]; then fi if [ -n "${BRIDGE}" -a -x /usr/sbin/brctl ]; then - /sbin/ip link set ${DEVICE} down + /sbin/ip link set dev ${DEVICE} down /usr/sbin/brctl delif ${BRIDGE} ${DEVICE} exit 0 fi @@ -106,7 +106,7 @@ else fi if [ "${REALDEVICE}" = "${DEVICE}" ]; then - ip link set ${DEVICE} down + ip link set dev ${DEVICE} down fi [ "$retcode" = "0" ] && retcode=$? diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup index 96f7128e..074e0d13 100755 --- a/sysconfig/network-scripts/ifup +++ b/sysconfig/network-scripts/ifup @@ -154,7 +154,7 @@ if [ -n "${HWADDR}" ]; then fi if [ "${TYPE}" = "Bridge" -a -x /usr/sbin/brctl ]; then - /sbin/ip link set ${DEVICE} down 2>/dev/null + /sbin/ip link set dev ${DEVICE} down 2>/dev/null /usr/sbin/brctl delbr ${DEVICE} 2>/dev/null /usr/sbin/brctl addbr ${DEVICE} [ -n "${DELAY}" ] && /usr/sbin/brctl setfd ${DEVICE} ${DELAY} @@ -163,7 +163,7 @@ fi if [ -n "${BRIDGE}" -a -x /usr/sbin/brctl ]; then /sbin/ip addr flush dev ${DEVICE} 2>/dev/null - /sbin/ip link set ${DEVICE} up + /sbin/ip link set dev ${DEVICE} up /usr/sbin/brctl addif ${BRIDGE} ${DEVICE} exit $? fi @@ -186,7 +186,7 @@ if [ "${SLAVE}" = yes -a "${ISALIAS}" = no -a "${MASTER}" != "" -a \ -x /sbin/ifenslave ]; then RFLAG="" ; [ "${RECEIVEONLY}" = yes ] && RFLAG="-r" - /sbin/ip link set ${DEVICE} down + /sbin/ip link set dev ${DEVICE} down echo $"Enslaving ${DEVICE} to ${MASTER}" ifenslave ${RFLAG} "${MASTER}" "${DEVICE}" @@ -195,7 +195,7 @@ fi # master device? if [ "${TYPE}" = "Bonding" ] || ethtool -i $DEVICE | grep -q "driver: bonding" ; then - /sbin/ip link set ${DEVICE} up + /sbin/ip link set dev ${DEVICE} up for device in `fgrep -l "MASTER=${DEVICE}" /etc/sysconfig/network-scripts/ifcfg-*` ; do /sbin/ifup ${device##*/} done @@ -205,10 +205,10 @@ fi # available as a configuration option in the config file, forcing the kernel # to think an ethernet card has a different MAC address than it really has. if [ -n "${MACADDR}" ]; then - ip link set ${DEVICE} address ${MACADDR} + ip link set dev ${DEVICE} address ${MACADDR} fi if [ -n "${MTU}" ]; then - ip link set ${DEVICE} mtu ${MTU} + ip link set dev ${DEVICE} mtu ${MTU} fi # Is there a firewall running, and does it look like one we configured? @@ -258,7 +258,7 @@ if [ -n "${DYNCONFIG}" ]; then echo -n $"Determining IP information for ${DEVICE}..." if check_link_down ${DEVICE}; then echo $" failed; no link present. Check cable?" - ip link set ${DEVICE} down >/dev/null 2>&1 + ip link set dev ${DEVICE} down >/dev/null 2>&1 exit 1 fi @@ -299,7 +299,7 @@ if [ -n "${DYNCONFIG}" ]; then else if [ -z "${IPADDR}" ]; then # enable device without IP, useful for e.g. PPPoE - ip link set ${REALDEVICE} up + ip link set dev ${REALDEVICE} up if [ "${NETWORKING_IPV6}" = "yes" ]; then /etc/sysconfig/network-scripts/ifup-ipv6 ${CONFIG} fi @@ -309,9 +309,9 @@ else expand_config [ -n "${ARP}" ] && \ - ip link set ${REALDEVICE} $(toggle_value arp $ARP) + ip link set dev ${REALDEVICE} $(toggle_value arp $ARP) - if ! ip link set ${REALDEVICE} up ; then + if ! ip link set dev ${REALDEVICE} up ; then echo $"Failed to bring up ${DEVICE}." exit 1 fi diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions index a6bbf1de..13f7919f 100644 --- a/sysconfig/network-scripts/network-functions +++ b/sysconfig/network-scripts/network-functions @@ -247,8 +247,8 @@ check_ethtool () check_link_down () { if [ -x /sbin/mii-tool -o -x /sbin/ethtool ]; then - if ! LC_ALL=C ip link show $1 2>/dev/null| grep -q UP ; then - ip link set $1 up >/dev/null 2>&1 + if ! LC_ALL=C ip link show dev $1 2>/dev/null| grep -q UP ; then + ip link set dev $1 up >/dev/null 2>&1 timeout=0 while [ $timeout -le 10 ]; do check_mii_tool $1 -- cgit v1.2.1