![](https://seccdn.libravatar.org/avatar/3035b38ff33cf86f480bb169b8500b80.jpg?s=120&d=mm&r=g)
https://bugzilla.novell.com/show_bug.cgi?id=784952 https://bugzilla.novell.com/show_bug.cgi?id=784952#c0 Summary: Interface names with > 15 chars produce wrong status messages upon start/stop Classification: openSUSE Product: openSUSE 12.2 Version: Final Platform: All OS/Version: All Status: NEW Severity: Normal Priority: P5 - None Component: Network AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: doerges@pre-sense.de QAContact: qa-bugs@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1 - No NetworkManager, but manual network configuration. - Example for an interface configuration that breaks: --- snip --- $ cat /etc/sysconfig/network/ifcfg-definitelytoolonginterfacename BOOTPROTO='static' STARTMODE='auto' TUNNEL='tap' TUNNEL_SET_GROUP='' TUNNEL_SET_OWNER='' TUNNEL_SET_PERSISTENT='yes' --- snap --- Reproducible: Always Steps to Reproduce: 1. Create a (tap) device like sketched above 2. rcnetwork restart Actual Results: Starting the interface produces a failure message, even if the interface is started okay. Expected Results: Status message should be correct. Either interface names that are too long should be entirely prohibited or the start/stop scripts should be able to deal with them. For me the following patches work, but I guess I didn't find all the relevant spots: --- snip --- /etc/sysconfig/network/scripts # diff -c functions.orig functions *** functions.orig Fri Oct 12 20:19:31 2012 --- functions Fri Oct 12 21:40:05 2012 *************** *** 100,106 **** } is_iface_available () { ! local IFNAME=${1} local IFTYPE=${2:-$INTERFACETYPE} test -z "$IFNAME" && return 1 test -d /sys/class/net/$IFNAME && return 0 --- 100,106 ---- } is_iface_available () { ! local IFNAME=$(echo ${1} | cut -c 1-15) local IFTYPE=${2:-$INTERFACETYPE} test -z "$IFNAME" && return 1 test -d /sys/class/net/$IFNAME && return 0 *************** *** 120,128 **** is_iface_up () { test -z "$1" && return 1 ! test -d /sys/class/net/$1 || return 1 ! case "`LC_ALL=POSIX ip link show $1 2>/dev/null`" in ! *$1*UP*) ;; *) return 1 ;; esac } --- 120,129 ---- is_iface_up () { test -z "$1" && return 1 ! ifname=$(echo $1 | cut -c 1-15) ! test -d /sys/class/net/$ifname || return 1 ! case "`LC_ALL=POSIX ip link show $ifname 2>/dev/null`" in ! *${ifname}*UP*) ;; *) return 1 ;; esac } *************** *** 143,154 **** } link_ready_check () { ! local c=`cat /sys/class/net/${1}/carrier 2>/dev/null` ! local d=`cat /sys/class/net/${1}/dormant 2>/dev/null` ! local o=`cat /sys/class/net/${1}/operstate 2>/dev/null` ! #debug "link ready ${1}: carrier=$c, dormant=$d, operstate=$o" ! if test -e "/sys/class/net/${1}/operstate" ; then # SLE 11 has carrier + operstate + dormant test "$d" = "0" || return 3 test "$c" = "1" || return 2 --- 144,156 ---- } link_ready_check () { ! ifname=`echo ${1} | cut -c 1-15` ! local c=`cat /sys/class/net/${ifname}/carrier 2>/dev/null` ! local d=`cat /sys/class/net/${ifname}/dormant 2>/dev/null` ! local o=`cat /sys/class/net/${ifname}/operstate 2>/dev/null` ! # debug "link ready ${ifname}: carrier=$c, dormant=$d, operstate=$o" ! if test -e "/sys/class/net/${ifname}/operstate" ; then # SLE 11 has carrier + operstate + dormant test "$d" = "0" || return 3 test "$c" = "1" || return 2 *************** *** 162,168 **** ipv6_addr_dad_check() { ! local iface="$1" word i local nodad=1 tentative=1 dadfailed=1 test -f "/sys/class/net/$iface/ifindex" || return 1 while read -a word ; do --- 164,170 ---- ipv6_addr_dad_check() { ! local iface="$(echo $1 | cut -c 1-15)" word i local nodad=1 tentative=1 dadfailed=1 test -f "/sys/class/net/$iface/ifindex" || return 1 while read -a word ; do *************** *** 241,247 **** } get_iface_type () { ! local IF=$1 TYPE test -n "$IF" || return 1 test -d /sys/class/net/$IF || return 2 case "`cat /sys/class/net/$IF/type`" in --- 243,249 ---- } get_iface_type () { ! local IF=$(echo $1 | cut -c 1-15) TYPE test -n "$IF" || return 1 test -d /sys/class/net/$IF || return 2 case "`cat /sys/class/net/$IF/type`" in /etc/sysconfig/network/scripts # diff -c link_wait.orig link_wait *** link_wait.orig Fri Oct 12 21:20:14 2012 --- link_wait Fri Oct 12 21:21:47 2012 *************** *** 112,124 **** } check_link_detected () { ! local c=`cat /sys/class/net/${1}/carrier 2>/dev/null` ! local d=`cat /sys/class/net/${1}/dormant 2>/dev/null` ! local o=`cat /sys/class/net/${1}/operstate 2>/dev/null` ! debug "link detection ${1}: carrier=$c, dormant=$d, operstate=$o" ! if test -e "/sys/class/net/${1}/operstate" ; then # SLE 11 has carrier + operstate + dormant test "$c" = "1" -a "$d" = "0" -a \ \( "$o" = "up" -o "$o" = "unknown" \) && return 0 --- 112,125 ---- } check_link_detected () { ! ifname=$(echo ${1} | cut -c 1-15) ! local c=`cat /sys/class/net/${ifname}/carrier 2>/dev/null` ! local d=`cat /sys/class/net/${ifname}/dormant 2>/dev/null` ! local o=`cat /sys/class/net/${ifname}/operstate 2>/dev/null` ! debug "link detection ${ifname}: carrier=$c, dormant=$d, operstate=$o" ! if test -e "/sys/class/net/${ifname}/operstate" ; then # SLE 11 has carrier + operstate + dormant test "$c" = "1" -a "$d" = "0" -a \ \( "$o" = "up" -o "$o" = "unknown" \) && return 0 --- snap --- -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.