Factor getIfaceNames() from getIfaceList()
getIfaceList first walks the list of interfaces
from the sysfs, then it calls individually for
each of those interfaces to get the ifindex for
them. Because each of the calls to retrieve the
ifindex means a netlink call, this could possibly
cause performance problems (unconfirmed) on the
netlink interface. Since the names are independently
useful and are quick to fetch, this function is
now factored in to 2 parts: one which fetches the
names and a separate function which performs the
original operation of fetching the names and mapping
them to if_indices.
Bug: 74560705
Test: netd_integration_test - GetIfaceListTest
Change-Id: I1f888c31e992c8f7d51f3c67434ffef6d75b065d
3 files changed