From b2de751d73a7136e3785f4f9b3919c6612928d8a Mon Sep 17 00:00:00 2001 From: Saravanan KR Date: Thu, 30 Jan 2020 21:21:02 +0530 Subject: [PATCH] Ignore SR-IOV VFs on dhcp_all_interfaces list When os-net-config fails, it will trigger the configure_safe_defaults function, which will enable dhcp on all interfaces which has link up and having a valid mac address. SR-IOV VFs will also fall in this list, ignore VFs in the dhcp all list. Closes-Bug: #1861473 Change-Id: I563f42dc417ce5e403310ea33b969e19d16ad68f (cherry picked from commit bc014864282372e74839aefd6d7a444a20643af3) --- network/scripts/run-os-net-config.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/network/scripts/run-os-net-config.sh b/network/scripts/run-os-net-config.sh index e463b44aa7..2ec9d2d455 100755 --- a/network/scripts/run-os-net-config.sh +++ b/network/scripts/run-os-net-config.sh @@ -25,8 +25,11 @@ EOF_CAT for iface in $(ls /sys/class/net | grep -v -e ^lo$ -e ^vnet$); do local mac_addr_type="$(cat /sys/class/net/${iface}/addr_assign_type)" + local vf_parent="/sys/class/net/${iface}/device/physfn" if [ "$mac_addr_type" != "0" ]; then echo "Device has generated MAC, skipping." + elif [[ -d $vf_parent ]]; then + echo "Device (${iface}) is a SR-IOV VF, skipping." else HAS_LINK="$(cat /sys/class/net/${iface}/carrier || echo 0)"