Fix to not restart alias interface

The alias interface may at times be brought up before its parent
interface (ethernet or vlan) depending on how the interface config
files are listed in the filesystem.
The fix is to not restart the alias interface. If there is a
change in the alias interface configuration, the parent interface
would be restarted instead.

Partial-Bug: 1817593

Change-Id: I83b88e1587c6468d85e14a50de934908586cbc9b
Signed-off-by: Teresa Ho <teresa.ho@windriver.com>
This commit is contained in:
Teresa Ho 2019-02-27 09:32:05 -05:00
parent 281e1f1109
commit 575be13d68
1 changed files with 18 additions and 2 deletions

View File

@ -363,8 +363,24 @@ for cfg_path in $(find /var/run/network-scripts.puppet/ -name "${IFNAME_INCLUDE}
is_eq_ifcfg /var/run/network-scripts.puppet/$cfg \
/etc/sysconfig/network-scripts/$cfg
if [ $? -ne 0 ] ; then
log_it "$cfg changed - adding to upDown list"
upDown+=($cfg)
log_it "$cfg changed"
# Remove alias portion in the interface name if any.
# Check if the base interface is already on the list for
# restart. If not, add it to the list.
# The alias interface does not need to be restarted.
base_cfg=${cfg/:*/}
found=0
for chk in ${upDown[@]}; do
if [ "$base_cfg" = "$chk" ]; then
found=1
break
fi
done
if [ $found -eq 0 ]; then
log_it "Adding $base_cfg to upDown list"
upDown+=($base_cfg)
fi
fi
fi
fi