Remove the route settings from system config
The code was setting multiple [Route] from DBus settings and system
config settings.
This causes issue when there are multiple and different route settings.
Remove the config from system config and only respect the settings from
DBus, this makes sure only DBus settings are written to the network
config files.
This change requires the ipmid's update to set gateway to interface
config instead of system config:
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-host-ipmid/+/45806
Tested: Verify the BMC gets default gateway in the below case:
1. BMC gets DHCP IPv6 address and gateway;
2. The user sets the static IPv6 address and gateway.
Without this commit, the BMC will have no default gateway
because of two different gateways are in the network config.
Fixes openbmc/phosphor-networkd#40
Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: Ice1f2c347f86181f534bc4ce426d4e427487477e
diff --git a/src/ethernet_interface.cpp b/src/ethernet_interface.cpp
index 0be63b0..1c88f2c 100644
--- a/src/ethernet_interface.cpp
+++ b/src/ethernet_interface.cpp
@@ -1077,22 +1077,6 @@
stream << "Gateway=" << gateway6 << "\n";
}
- if (manager.getSystemConf())
- {
- const auto& gateway = manager.getSystemConf()->defaultGateway();
- if (!gateway.empty())
- {
- stream << "[Route]\n";
- stream << "Gateway=" << gateway << "\n";
- }
- const auto& gateway6 = manager.getSystemConf()->defaultGateway6();
- if (!gateway6.empty())
- {
- stream << "[Route]\n";
- stream << "Gateway=" << gateway6 << "\n";
- }
- }
-
// Write the neighbor sections
for (const auto& neighbor : staticNeighbors)
{