dhcp-all-interfaces.sh may faild when interface remains in DOWN state

Bug #1777396 reported by Radoslaw Smigielski on 2018-06-18
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
diskimage-builder
Undecided
Radoslaw Smigielski

Bug Description

In diskimage_builder/elements/dhcp-all-interfaces/install.d/dhcp-all-interfaces.sh
before get_if_link() is called, the interface suppose to be set up:

>> ip link set dev $interface up &>/dev/null

but if for whatever reason the link remains down entire script fails on get_if_link()

for ((; tries > 0; tries--)); do
  # Need to set the link up on each iteration
  ip link set dev $interface up &>/dev/null
  has_link=$(get_if_link $interface)
  [ "$has_link" == "1" ] && break
  sleep 1
done

get_if_link() should ignore links in DOWN state so the above loop can carry on and check other interfaces.

Changed in diskimage-builder:
assignee: nobody → Radoslaw Smigielski (radoslaw-smigielski)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers