Network factory reset: don't recreate VLAN interfaces
This commit fixes a defect with the network factory reset. When VLANs
are created on a particular interface and that interface is reset, the
VLANs should disappear. They weren't disappearing; they were being
deleted and recreated during the reset process. This commit stops the
VLAN interfaces from being recreated.
Resolves openbmc/openbmc#2478
Change-Id: I46dd0183185cc57f3dd8680cf1ac8404c9fd316a
Signed-off-by: Michael Tritz <mtritz@us.ibm.com>
diff --git a/network_manager.cpp b/network_manager.cpp
index e9d8ad9..4990ee0 100644
--- a/network_manager.cpp
+++ b/network_manager.cpp
@@ -64,6 +64,13 @@
auto interfaceStrList = getInterfaces();
for (const auto& interface : interfaceStrList)
{
+ // if the interface has '.' in the name, it means that this is a
+ // VLAN - don't create the network file.
+ if (interface.find(".") != std::string::npos)
+ {
+ continue;
+ }
+
auto fileName = systemd::config::networkFilePrefix + interface +
systemd::config::networkFileSuffix;