use find instead of ls to list interfaces

find is used instead of ls as we can select the 'link' type with find
only the link type is needed because files do not have interface
properties and directories are not used for this area of /sys
As an example, the bonding_masters exists in /sys/class/net/ as a file
without any 'subdirectory' of information to it.

Change-Id: Id31fcfb858c6abff4d44444e019f0d48e4f3c671
This commit is contained in:
Matthew Thode 2018-09-24 00:21:00 -05:00
parent ea5c35e8c4
commit cfd13c561c
No known key found for this signature in database
GPG Key ID: 64A37BEAAE19A4E8

View File

@ -72,8 +72,11 @@
# created through this system. This makes our MTU determination mostly
# idempotent allowing us to create multiple overlays without
# perpetually smaller MTUs.
# find is used instead of ls as we can select the 'link' type with find
# only the link type is needed because files do not have interface
# properties and directories are not used for this area of /sys
SMALLEST_MTU=""
for X in $(ls /sys/class/net) ; do
for X in $(find /sys/class/net/ -maxdepth 1 -type l -exec basename {} ';') ; do
MAC_TYPE=$(cat "/sys/class/net/${X}/addr_assign_type")
if [ "$MAC_TYPE" -ne "0" ] ; then
# Type 0 is a permanent address implying a "real"