Bug 1635313 - starting a bridge interface via ifup with stp enabled results in input error from expr
Summary: starting a bridge interface via ifup with stp enabled results in input error ...
Status: CLOSED DUPLICATE of bug 1609687
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: initscripts
Version: 7.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: David Kaspar [Dee'Kej]
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-10-02 15:14 UTC by Richard Achmatowicz
Modified: 2018-10-08 10:05 UTC (History)
2 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2018-10-08 10:05:24 UTC


Attachments (Terms of Use)

Description Richard Achmatowicz 2018-10-02 15:14:27 UTC
Description of problem:

When I start a bridge interface with stp enabled using ifup, if DELAY is not defined in the ifcfg-br1 file, the ifup script tries to calculate a value for LINKDELAY:

convert2sec $(forward_delay) centi

This calculation returns a decimal number. When this number is fed into the next calculation

forward_delay=$(expr $(forward_delay) \* 2 + 7)

it results in an error 

/etc/sysconfig/network-scripts/ifup-eth: line 91: [: 0: unary operator expected

Version-Release number of selected component (if applicable):


How reproducible:
create a bridge device which has stp enabled and start the device

Steps to Reproduce:
1.
2.
3.

Actual results:
an error processing the value of LINK_DELAY occurs

Expected results:
the value of LINK_DELAY should be correctly processed, despite the fact that the calculated value of forward_delay is a non-integer


Additional info:

Here is a trace of running ifup br1 on my host:

[root@clusterdev02 ~]# ifdown br1
[root@clusterdev02 ~]# ifup br1
+ . /etc/init.d/functions
++ TEXTDOMAIN=initscripts
++ umask 022
++ PATH=/sbin:/usr/sbin:/bin:/usr/bin
++ export PATH
++ '[' 13247 -ne 1 -a -z '' ']'
++ '[' -d /run/systemd/system ']'
++ case "$0" in
++ '[' -z '' ']'
++ COLUMNS=80
++ '[' -z '' ']'
++ '[' -c /dev/stderr -a -r /dev/stderr ']'
+++ /sbin/consoletype
++ CONSOLETYPE=pty
++ '[' -z '' ']'
++ '[' -z '' ']'
++ '[' -f /etc/sysconfig/i18n -o -f /etc/locale.conf ']'
++ . /etc/profile.d/lang.sh
++ unset LANGSH_SOURCED
++ '[' -z '' ']'
++ '[' -f /etc/sysconfig/init ']'
++ . /etc/sysconfig/init
+++ BOOTUP=color
+++ RES_COL=60
+++ MOVE_TO_COL='echo -en \033[60G'
+++ SETCOLOR_SUCCESS='echo -en \033[0;32m'
+++ SETCOLOR_FAILURE='echo -en \033[0;31m'
+++ SETCOLOR_WARNING='echo -en \033[0;33m'
+++ SETCOLOR_NORMAL='echo -en \033[0;39m'
++ '[' pty = serial ']'
++ __sed_discard_ignored_files='/\(~\|\.bak\|\.old\|\.orig\|\.rpmnew\|\.rpmorig\|\.rpmsave\)$/d'
++ '[' '' = 1 ']'
+++ cat /proc/cmdline
++ strstr 'BOOT_IMAGE=/vmlinuz-3.10.0-862.14.4.el7.x86_64 root=/dev/mapper/rhel_clusterdev02-root ro crashkernel=auto rd.lvm.lv=rhel_clusterdev02/root rd.lvm.lv=rhel_clusterdev02/swap rhgb quiet transparent_hugepage=never LANG=en_GB.UTF-8' rc.debug
++ '[' 'BOOT_IMAGE=/vmlinuz-3.10.0-862.14.4.el7.x86_64 root=/dev/mapper/rhel_clusterdev02-root ro crashkernel=auto rd.lvm.lv=rhel_clusterdev02/root rd.lvm.lv=rhel_clusterdev02/swap rhgb quiet transparent_hugepage=never LANG=en_GB.UTF-8' = 'BOOT_IMAGE=/vmlinuz-3.10.0-862.14.4.el7.x86_64 root=/dev/mapper/rhel_clusterdev02-root ro crashkernel=auto rd.lvm.lv=rhel_clusterdev02/root rd.lvm.lv=rhel_clusterdev02/swap rhgb quiet transparent_hugepage=never LANG=en_GB.UTF-8' ']'
++ return 1
++ return 0
+ cd /etc/sysconfig/network-scripts
+ . ./network-functions
++ PATH=/sbin:/usr/sbin:/bin:/usr/bin
++ export PATH
+++ hostname
++ HOSTNAME=clusterdev02.lab.eng.brq.redhat.com
++ '[' -z '/\(~\|\.bak\|\.old\|\.orig\|\.rpmnew\|\.rpmorig\|\.rpmsave\)$/d' ']'
+ '[' -f ../network ']'
+ . ../network
+ CONFIG=br1
+ '[' -z br1 ']'
+ need_config br1
+ local nconfig
+ CONFIG=ifcfg-br1
+ '[' -f ifcfg-br1 ']'
+ return
+ '[' -f ifcfg-br1 ']'
+ '[' 0 '!=' 0 ']'
+ source_config
+ CONFIG=ifcfg-br1
+ DEVNAME=br1
+ . /etc/sysconfig/network-scripts/ifcfg-br1
++ DEVICE=br1
++ STP=yes
++ TYPE=Bridge
++ BOOTPROTO=none
++ DEFROUTE=yes
++ IPV4_FAILURE_FATAL=no
++ IPV6INIT=yes
++ IPV6_AUTOCONF=yes
++ IPV6_DEFROUTE=yes
++ IPV6_FAILURE_FATAL=no
++ IPV6_ADDR_GEN_MODE=stable-privacy
++ NAME=br1
++ UUID=8e9f719e-ed4c-4c21-b6e6-8c6acd42699e
++ ONBOOT=yes
++ BRIDGING_OPTS=priority=32768
++ IPADDR=192.168.0.120
++ PREFIX=24
++ IPV6_PEERDNS=yes
++ IPV6_PEERROUTES=yes
+ '[' -r keys-br1 ']'
+ case "$TYPE" in
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -z br1 -a -n '' ']'
+ '[' -z '' ']'
++ echo br1
++ sed 's/[0-9]*$//'
+ DEVICETYPE=br
+ '[' -z '' -a -n '' ']'
+ '[' -z '' ']'
+ REALDEVICE=br1
+ '[' -z '' ']'
+ SYSCTLDEVICE=br1
+ '[' br1 '!=' br1 ']'
+ ISALIAS=no
+ is_nm_running
+ dbus-send --system --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.freedesktop.NetworkManager
+ '[' foo = fooboot ']'
+ '[' -n '' ']'
+ '[' -n '' -a Bridge = Bridge ']'
+ '[' '' = true -a -n 8e9f719e-ed4c-4c21-b6e6-8c6acd42699e -a br1 '!=' lo ']'
+ '[' '' = yes ']'
+ '[' none = bootp -o none = dhcp ']'
+ '[' -x /sbin/ifup-pre-local ']'
+ OTHERSCRIPT=/etc/sysconfig/network-scripts/ifup-br
+ '[' '!' -x /etc/sysconfig/network-scripts/ifup-br ']'
+ OTHERSCRIPT=/etc/sysconfig/network-scripts/ifup-Bridge
+ '[' '!' -x /etc/sysconfig/network-scripts/ifup-Bridge ']'
+ OTHERSCRIPT=/etc/sysconfig/network-scripts/ifup-eth
+ exec /etc/sysconfig/network-scripts/ifup-eth ifcfg-br1
expr: non-integer argument
/etc/sysconfig/network-scripts/ifup-eth: line 91: [: 0: unary operator expected
rx unmodified, ignoring
no ring parameters changed, aborting
rx unmodified, ignoring
no ring parameters changed, aborting

Comment 2 David Kaspar [Dee'Kej] 2018-10-08 10:05:24 UTC

*** This bug has been marked as a duplicate of bug 1609687 ***


Note You need to log in before you can comment on or make changes to this bug.