Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 1 | #include "config.h" |
| 2 | |
Ratan Gupta | 6811f82 | 2017-04-14 16:34:56 +0530 | [diff] [blame] | 3 | #include "network_manager.hpp" |
Patrick Venture | 189d44e | 2018-07-09 12:30:59 -0700 | [diff] [blame] | 4 | |
Ratan Gupta | 5978dd1 | 2017-07-25 13:47:13 +0530 | [diff] [blame] | 5 | #include "ipaddress.hpp" |
Patrick Venture | 189d44e | 2018-07-09 12:30:59 -0700 | [diff] [blame] | 6 | #include "network_config.hpp" |
William A. Kennington III | 3a70fa2 | 2018-09-20 18:48:20 -0700 | [diff] [blame] | 7 | #include "types.hpp" |
Patrick Venture | 189d44e | 2018-07-09 12:30:59 -0700 | [diff] [blame] | 8 | #include "util.hpp" |
Ratan Gupta | 738a67f | 2017-04-21 10:38:05 +0530 | [diff] [blame] | 9 | |
Ratan Gupta | 6811f82 | 2017-04-14 16:34:56 +0530 | [diff] [blame] | 10 | #include <arpa/inet.h> |
| 11 | #include <dirent.h> |
| 12 | #include <net/if.h> |
| 13 | |
Patrick Venture | 189d44e | 2018-07-09 12:30:59 -0700 | [diff] [blame] | 14 | #include <algorithm> |
William A. Kennington III | 085bbdc | 2022-10-05 02:45:37 -0700 | [diff] [blame] | 15 | #include <charconv> |
Manojkiran Eda | cc099a8 | 2020-05-11 14:25:16 +0530 | [diff] [blame] | 16 | #include <filesystem> |
Patrick Venture | 189d44e | 2018-07-09 12:30:59 -0700 | [diff] [blame] | 17 | #include <fstream> |
Patrick Venture | 189d44e | 2018-07-09 12:30:59 -0700 | [diff] [blame] | 18 | #include <phosphor-logging/elog-errors.hpp> |
| 19 | #include <phosphor-logging/log.hpp> |
Michael Tritz | 29f2fd6 | 2017-05-22 15:27:26 -0500 | [diff] [blame] | 20 | #include <string> |
Patrick Venture | 189d44e | 2018-07-09 12:30:59 -0700 | [diff] [blame] | 21 | #include <xyz/openbmc_project/Common/error.hpp> |
Ratan Gupta | 6811f82 | 2017-04-14 16:34:56 +0530 | [diff] [blame] | 22 | |
William A. Kennington III | f1aa51c | 2019-02-12 19:58:11 -0800 | [diff] [blame] | 23 | constexpr char SYSTEMD_BUSNAME[] = "org.freedesktop.systemd1"; |
| 24 | constexpr char SYSTEMD_PATH[] = "/org/freedesktop/systemd1"; |
| 25 | constexpr char SYSTEMD_INTERFACE[] = "org.freedesktop.systemd1.Manager"; |
Manojkiran Eda | cc099a8 | 2020-05-11 14:25:16 +0530 | [diff] [blame] | 26 | constexpr auto FirstBootFile = "/var/lib/network/firstBoot_"; |
William A. Kennington III | f1aa51c | 2019-02-12 19:58:11 -0800 | [diff] [blame] | 27 | |
William A. Kennington III | 56ecc78 | 2021-10-07 18:44:50 -0700 | [diff] [blame] | 28 | constexpr char NETWORKD_BUSNAME[] = "org.freedesktop.network1"; |
| 29 | constexpr char NETWORKD_PATH[] = "/org/freedesktop/network1"; |
| 30 | constexpr char NETWORKD_INTERFACE[] = "org.freedesktop.network1.Manager"; |
| 31 | |
Ratan Gupta | 6811f82 | 2017-04-14 16:34:56 +0530 | [diff] [blame] | 32 | namespace phosphor |
| 33 | { |
| 34 | namespace network |
| 35 | { |
Ratan Gupta | 82549cc | 2017-04-21 08:45:23 +0530 | [diff] [blame] | 36 | |
William A. Kennington III | d41db38 | 2021-11-09 20:42:29 -0800 | [diff] [blame] | 37 | extern std::unique_ptr<Timer> refreshObjectTimer; |
William A. Kennington III | c7cf25f | 2021-11-09 16:16:59 -0800 | [diff] [blame] | 38 | extern std::unique_ptr<Timer> reloadTimer; |
Ratan Gupta | 6811f82 | 2017-04-14 16:34:56 +0530 | [diff] [blame] | 39 | using namespace phosphor::logging; |
Ratan Gupta | ef85eb9 | 2017-06-15 08:57:54 +0530 | [diff] [blame] | 40 | using namespace sdbusplus::xyz::openbmc_project::Common::Error; |
Jiaqing Zhao | b685cb6 | 2022-04-12 22:57:34 +0800 | [diff] [blame] | 41 | using Argument = xyz::openbmc_project::Common::InvalidArgument; |
Ratan Gupta | 6811f82 | 2017-04-14 16:34:56 +0530 | [diff] [blame] | 42 | |
Patrick Williams | c38b071 | 2022-07-22 19:26:54 -0500 | [diff] [blame] | 43 | Manager::Manager(sdbusplus::bus_t& bus, const char* objPath, |
William A. Kennington III | be3bd2f | 2022-10-11 14:11:27 -0700 | [diff] [blame^] | 44 | const fs::path& confDir) : |
Patrick Williams | 166b959 | 2022-03-30 16:09:16 -0500 | [diff] [blame] | 45 | details::VLANCreateIface(bus, objPath, |
| 46 | details::VLANCreateIface::action::defer_emit), |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 47 | bus(bus), objectPath(objPath) |
Ratan Gupta | 6811f82 | 2017-04-14 16:34:56 +0530 | [diff] [blame] | 48 | { |
Ratan Gupta | 255d514 | 2017-08-10 09:02:08 +0530 | [diff] [blame] | 49 | setConfDir(confDir); |
Ratan Gupta | ef85eb9 | 2017-06-15 08:57:54 +0530 | [diff] [blame] | 50 | } |
| 51 | |
William A. Kennington III | 9a1d9af | 2021-11-09 17:51:05 -0800 | [diff] [blame] | 52 | bool Manager::createDefaultNetworkFiles() |
Ratan Gupta | b610caf | 2017-09-19 09:33:51 +0530 | [diff] [blame] | 53 | { |
| 54 | auto isCreated = false; |
| 55 | try |
| 56 | { |
William A. Kennington III | 9644479 | 2022-10-05 15:16:22 -0700 | [diff] [blame] | 57 | auto interfaceStrList = getSystemInterfaces(); |
Ratan Gupta | b610caf | 2017-09-19 09:33:51 +0530 | [diff] [blame] | 58 | for (const auto& interface : interfaceStrList) |
| 59 | { |
Michael Tritz | 08c34f4 | 2017-10-16 14:59:09 -0500 | [diff] [blame] | 60 | // if the interface has '.' in the name, it means that this is a |
| 61 | // VLAN - don't create the network file. |
| 62 | if (interface.find(".") != std::string::npos) |
| 63 | { |
| 64 | continue; |
| 65 | } |
| 66 | |
William A. Kennington III | a520a39 | 2022-08-08 12:17:34 -0700 | [diff] [blame] | 67 | fs::path filePath = config::pathForIntfConf(confDir, interface); |
Ratan Gupta | b610caf | 2017-09-19 09:33:51 +0530 | [diff] [blame] | 68 | |
| 69 | // create the interface specific network file |
William A. Kennington III | 9a1d9af | 2021-11-09 17:51:05 -0800 | [diff] [blame] | 70 | // if not existing. |
William A. Kennington III | 87f6813 | 2022-08-21 02:20:43 -0700 | [diff] [blame] | 71 | if (!fs::is_regular_file(filePath)) |
Ratan Gupta | b610caf | 2017-09-19 09:33:51 +0530 | [diff] [blame] | 72 | { |
William A. Kennington III | 87f6813 | 2022-08-21 02:20:43 -0700 | [diff] [blame] | 73 | bmc::writeDHCPDefault(filePath, interface); |
Ratan Gupta | b610caf | 2017-09-19 09:33:51 +0530 | [diff] [blame] | 74 | log<level::INFO>("Created the default network file.", |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 75 | entry("INTERFACE=%s", interface.c_str())); |
Ratan Gupta | b610caf | 2017-09-19 09:33:51 +0530 | [diff] [blame] | 76 | isCreated = true; |
| 77 | } |
| 78 | } |
| 79 | } |
Patrick Williams | 5758db3 | 2021-10-06 12:29:22 -0500 | [diff] [blame] | 80 | catch (const std::exception& e) |
Ratan Gupta | b610caf | 2017-09-19 09:33:51 +0530 | [diff] [blame] | 81 | { |
| 82 | log<level::ERR>("Unable to create the default network file"); |
| 83 | } |
Alexander Filippov | 1ea3599 | 2021-03-26 13:10:05 +0300 | [diff] [blame] | 84 | |
Ratan Gupta | b610caf | 2017-09-19 09:33:51 +0530 | [diff] [blame] | 85 | return isCreated; |
| 86 | } |
| 87 | |
Ratan Gupta | ef85eb9 | 2017-06-15 08:57:54 +0530 | [diff] [blame] | 88 | void Manager::setConfDir(const fs::path& dir) |
| 89 | { |
| 90 | confDir = dir; |
Ratan Gupta | 255d514 | 2017-08-10 09:02:08 +0530 | [diff] [blame] | 91 | |
| 92 | if (!fs::exists(confDir)) |
| 93 | { |
| 94 | if (!fs::create_directories(confDir)) |
| 95 | { |
| 96 | log<level::ERR>("Unable to create the network conf dir", |
| 97 | entry("DIR=%s", confDir.c_str())); |
| 98 | elog<InternalFailure>(); |
| 99 | } |
| 100 | } |
Ratan Gupta | 29b0e43 | 2017-05-25 12:51:40 +0530 | [diff] [blame] | 101 | } |
| 102 | |
| 103 | void Manager::createInterfaces() |
| 104 | { |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 105 | // clear all the interfaces first |
Ratan Gupta | ef85eb9 | 2017-06-15 08:57:54 +0530 | [diff] [blame] | 106 | interfaces.clear(); |
Ratan Gupta | 29b0e43 | 2017-05-25 12:51:40 +0530 | [diff] [blame] | 107 | |
William A. Kennington III | 9644479 | 2022-10-05 15:16:22 -0700 | [diff] [blame] | 108 | auto interfaceStrList = getSystemInterfaces(); |
Ratan Gupta | 6811f82 | 2017-04-14 16:34:56 +0530 | [diff] [blame] | 109 | |
Ratan Gupta | fd4b0f0 | 2017-09-16 06:01:24 +0530 | [diff] [blame] | 110 | for (auto& interface : interfaceStrList) |
Ratan Gupta | 6811f82 | 2017-04-14 16:34:56 +0530 | [diff] [blame] | 111 | { |
Ratan Gupta | 29b0e43 | 2017-05-25 12:51:40 +0530 | [diff] [blame] | 112 | fs::path objPath = objectPath; |
Ratan Gupta | fd4b0f0 | 2017-09-16 06:01:24 +0530 | [diff] [blame] | 113 | auto index = interface.find("."); |
Ratan Gupta | 92bc2fe | 2017-07-26 22:40:21 +0530 | [diff] [blame] | 114 | |
| 115 | // interface can be of vlan type or normal ethernet interface. |
| 116 | // vlan interface looks like "interface.vlanid",so here by looking |
| 117 | // at the interface name we decide that we need |
| 118 | // to create the vlaninterface or normal physical interface. |
| 119 | if (index != std::string::npos) |
| 120 | { |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 121 | // it is vlan interface |
William A. Kennington III | 085bbdc | 2022-10-05 02:45:37 -0700 | [diff] [blame] | 122 | auto sv = std::string_view(interface); |
| 123 | auto interfaceName = sv.substr(0, index); |
| 124 | auto vlanStr = sv.substr(index + 1); |
| 125 | uint16_t vlanId; |
| 126 | auto res = std::from_chars(vlanStr.begin(), vlanStr.end(), vlanId); |
| 127 | if (res.ec != std::errc() || res.ptr != vlanStr.end()) |
| 128 | { |
| 129 | auto msg = fmt::format("Invalid VLAN: {}", vlanStr); |
| 130 | log<level::ERR>(msg.c_str()); |
| 131 | continue; |
| 132 | } |
William A. Kennington III | dd9ef81 | 2022-10-05 02:08:02 -0700 | [diff] [blame] | 133 | auto it = interfaces.find(interfaceName); |
William A. Kennington III | 085bbdc | 2022-10-05 02:45:37 -0700 | [diff] [blame] | 134 | if (it == interfaces.end()) |
| 135 | { |
| 136 | auto msg = fmt::format("Missing interface({}) for VLAN({}): {}", |
| 137 | interfaceName, vlanId, interface); |
| 138 | log<level::ERR>(msg.c_str()); |
| 139 | continue; |
| 140 | } |
| 141 | it->second->loadVLAN(vlanId); |
Ratan Gupta | 6e8df63 | 2017-08-13 09:41:58 +0530 | [diff] [blame] | 142 | continue; |
Ratan Gupta | 92bc2fe | 2017-07-26 22:40:21 +0530 | [diff] [blame] | 143 | } |
Ratan Gupta | fd4b0f0 | 2017-09-16 06:01:24 +0530 | [diff] [blame] | 144 | // normal ethernet interface |
| 145 | objPath /= interface; |
William A. Kennington III | a520a39 | 2022-08-08 12:17:34 -0700 | [diff] [blame] | 146 | config::Parser config(config::pathForIntfConf(confDir, interface)); |
Ratan Gupta | 34f96d6 | 2017-06-15 09:16:22 +0530 | [diff] [blame] | 147 | |
William A. Kennington III | dd9ef81 | 2022-10-05 02:08:02 -0700 | [diff] [blame] | 148 | auto intf = std::make_unique<phosphor::network::EthernetInterface>( |
William A. Kennington III | 0caf221 | 2022-08-18 18:15:51 -0700 | [diff] [blame] | 149 | bus, objPath.string(), config, *this); |
Ratan Gupta | 92bc2fe | 2017-07-26 22:40:21 +0530 | [diff] [blame] | 150 | |
| 151 | intf->createIPAddressObjects(); |
William A. Kennington III | 0850579 | 2019-01-30 16:00:04 -0800 | [diff] [blame] | 152 | intf->createStaticNeighborObjects(); |
William A. Kennington III | a520a39 | 2022-08-08 12:17:34 -0700 | [diff] [blame] | 153 | intf->loadNameServers(config); |
Ratan Gupta | 92bc2fe | 2017-07-26 22:40:21 +0530 | [diff] [blame] | 154 | |
William A. Kennington III | a520a39 | 2022-08-08 12:17:34 -0700 | [diff] [blame] | 155 | this->interfaces.emplace(std::move(interface), std::move(intf)); |
Ratan Gupta | 6811f82 | 2017-04-14 16:34:56 +0530 | [diff] [blame] | 156 | } |
| 157 | } |
| 158 | |
Ratan Gupta | ef85eb9 | 2017-06-15 08:57:54 +0530 | [diff] [blame] | 159 | void Manager::createChildObjects() |
| 160 | { |
William A. Kennington III | e056484 | 2021-10-23 16:02:22 -0700 | [diff] [blame] | 161 | routeTable.refresh(); |
| 162 | |
Ratan Gupta | ef85eb9 | 2017-06-15 08:57:54 +0530 | [diff] [blame] | 163 | // creates the ethernet interface dbus object. |
| 164 | createInterfaces(); |
Ratan Gupta | e05083a | 2017-09-16 07:12:11 +0530 | [diff] [blame] | 165 | |
| 166 | systemConf.reset(nullptr); |
| 167 | dhcpConf.reset(nullptr); |
| 168 | |
Ratan Gupta | ef85eb9 | 2017-06-15 08:57:54 +0530 | [diff] [blame] | 169 | fs::path objPath = objectPath; |
| 170 | objPath /= "config"; |
Ratan Gupta | e05083a | 2017-09-16 07:12:11 +0530 | [diff] [blame] | 171 | |
| 172 | // create the system conf object. |
Ratan Gupta | ef85eb9 | 2017-06-15 08:57:54 +0530 | [diff] [blame] | 173 | systemConf = std::make_unique<phosphor::network::SystemConfiguration>( |
Jiaqing Zhao | 24b5a61 | 2022-04-11 16:46:16 +0800 | [diff] [blame] | 174 | bus, objPath.string()); |
Ratan Gupta | d16f88c | 2017-07-11 17:47:57 +0530 | [diff] [blame] | 175 | // create the dhcp conf object. |
| 176 | objPath /= "dhcp"; |
| 177 | dhcpConf = std::make_unique<phosphor::network::dhcp::Configuration>( |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 178 | bus, objPath.string(), *this); |
Ratan Gupta | ef85eb9 | 2017-06-15 08:57:54 +0530 | [diff] [blame] | 179 | } |
| 180 | |
William A. Kennington III | 085bbdc | 2022-10-05 02:45:37 -0700 | [diff] [blame] | 181 | ObjectPath Manager::vlan(std::string interfaceName, uint32_t id) |
Ratan Gupta | 6811f82 | 2017-04-14 16:34:56 +0530 | [diff] [blame] | 182 | { |
Jiaqing Zhao | b685cb6 | 2022-04-12 22:57:34 +0800 | [diff] [blame] | 183 | if (id == 0 || id >= 4095) |
| 184 | { |
| 185 | log<level::ERR>("VLAN ID is not valid", entry("VLANID=%u", id)); |
| 186 | elog<InvalidArgument>( |
| 187 | Argument::ARGUMENT_NAME("VLANId"), |
| 188 | Argument::ARGUMENT_VALUE(std::to_string(id).c_str())); |
| 189 | } |
| 190 | |
William A. Kennington III | 9644479 | 2022-10-05 15:16:22 -0700 | [diff] [blame] | 191 | auto it = interfaces.find(interfaceName); |
| 192 | if (it == interfaces.end()) |
| 193 | { |
| 194 | using ResourceErr = |
| 195 | phosphor::logging::xyz::openbmc_project::Common::ResourceNotFound; |
| 196 | elog<ResourceNotFound>(ResourceErr::RESOURCE(interfaceName.c_str())); |
| 197 | } |
| 198 | return it->second->createVLAN(id); |
Ratan Gupta | 6811f82 | 2017-04-14 16:34:56 +0530 | [diff] [blame] | 199 | } |
| 200 | |
Michael Tritz | 29f2fd6 | 2017-05-22 15:27:26 -0500 | [diff] [blame] | 201 | void Manager::reset() |
| 202 | { |
William A. Kennington III | 9a1d9af | 2021-11-09 17:51:05 -0800 | [diff] [blame] | 203 | if (fs::is_directory(confDir)) |
Michael Tritz | 29f2fd6 | 2017-05-22 15:27:26 -0500 | [diff] [blame] | 204 | { |
William A. Kennington III | 9a1d9af | 2021-11-09 17:51:05 -0800 | [diff] [blame] | 205 | for (const auto& file : fs::directory_iterator(confDir)) |
| 206 | { |
| 207 | fs::remove(file.path()); |
| 208 | } |
Michael Tritz | 29f2fd6 | 2017-05-22 15:27:26 -0500 | [diff] [blame] | 209 | } |
William A. Kennington III | 9a1d9af | 2021-11-09 17:51:05 -0800 | [diff] [blame] | 210 | createDefaultNetworkFiles(); |
| 211 | log<level::INFO>("Network Factory Reset queued."); |
Michael Tritz | 29f2fd6 | 2017-05-22 15:27:26 -0500 | [diff] [blame] | 212 | } |
| 213 | |
Ratan Gupta | 4f1c18b | 2017-05-25 12:59:35 +0530 | [diff] [blame] | 214 | // Need to merge the below function with the code which writes the |
| 215 | // config file during factory reset. |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 216 | // TODO openbmc/openbmc#1751 |
Ratan Gupta | 4f1c18b | 2017-05-25 12:59:35 +0530 | [diff] [blame] | 217 | void Manager::writeToConfigurationFile() |
| 218 | { |
| 219 | // write all the static ip address in the systemd-network conf file |
Ratan Gupta | 4f1c18b | 2017-05-25 12:59:35 +0530 | [diff] [blame] | 220 | for (const auto& intf : interfaces) |
| 221 | { |
Ratan Gupta | 2b10653 | 2017-07-25 16:05:02 +0530 | [diff] [blame] | 222 | intf.second->writeConfigurationFile(); |
Ratan Gupta | 4f1c18b | 2017-05-25 12:59:35 +0530 | [diff] [blame] | 223 | } |
Ratan Gupta | e05083a | 2017-09-16 07:12:11 +0530 | [diff] [blame] | 224 | } |
| 225 | |
William A. Kennington III | 6f39c5e | 2021-05-13 18:39:23 -0700 | [diff] [blame] | 226 | #ifdef SYNC_MAC_FROM_INVENTORY |
Manojkiran Eda | cc099a8 | 2020-05-11 14:25:16 +0530 | [diff] [blame] | 227 | void Manager::setFistBootMACOnInterface( |
| 228 | const std::pair<std::string, std::string>& inventoryEthPair) |
| 229 | { |
| 230 | for (const auto& interface : interfaces) |
| 231 | { |
| 232 | if (interface.first == inventoryEthPair.first) |
| 233 | { |
| 234 | auto returnMAC = |
Patrick Williams | 6aef769 | 2021-05-01 06:39:41 -0500 | [diff] [blame] | 235 | interface.second->macAddress(inventoryEthPair.second); |
Manojkiran Eda | cc099a8 | 2020-05-11 14:25:16 +0530 | [diff] [blame] | 236 | if (returnMAC == inventoryEthPair.second) |
| 237 | { |
| 238 | log<level::INFO>("Set the MAC on "), |
| 239 | entry("interface : ", interface.first.c_str()), |
| 240 | entry("MAC : ", inventoryEthPair.second.c_str()); |
| 241 | std::error_code ec; |
| 242 | if (std::filesystem::is_directory("/var/lib/network", ec)) |
| 243 | { |
| 244 | std::ofstream persistentFile(FirstBootFile + |
| 245 | interface.first); |
| 246 | } |
| 247 | break; |
| 248 | } |
| 249 | else |
| 250 | { |
| 251 | log<level::INFO>("MAC is Not Set on ethernet Interface"); |
| 252 | } |
| 253 | } |
| 254 | } |
| 255 | } |
| 256 | |
| 257 | #endif |
| 258 | |
William A. Kennington III | 56ecc78 | 2021-10-07 18:44:50 -0700 | [diff] [blame] | 259 | void Manager::reloadConfigs() |
| 260 | { |
William A. Kennington III | c7cf25f | 2021-11-09 16:16:59 -0800 | [diff] [blame] | 261 | reloadTimer->restartOnce(reloadTimeout); |
William A. Kennington III | d41db38 | 2021-11-09 20:42:29 -0800 | [diff] [blame] | 262 | // Ensure that the next refresh happens after reconfiguration |
| 263 | refreshObjectTimer->setRemaining(reloadTimeout + refreshTimeout); |
William A. Kennington III | c7cf25f | 2021-11-09 16:16:59 -0800 | [diff] [blame] | 264 | } |
| 265 | |
| 266 | void Manager::doReloadConfigs() |
| 267 | { |
William A. Kennington III | 6ff633a | 2021-11-09 17:09:12 -0800 | [diff] [blame] | 268 | for (auto& hook : reloadPreHooks) |
| 269 | { |
| 270 | try |
| 271 | { |
| 272 | hook(); |
| 273 | } |
| 274 | catch (const std::exception& ex) |
| 275 | { |
| 276 | log<level::ERR>("Failed executing reload hook, ignoring", |
| 277 | entry("ERR=%s", ex.what())); |
| 278 | } |
| 279 | } |
| 280 | reloadPreHooks.clear(); |
William A. Kennington III | 56ecc78 | 2021-10-07 18:44:50 -0700 | [diff] [blame] | 281 | try |
| 282 | { |
| 283 | auto method = bus.new_method_call(NETWORKD_BUSNAME, NETWORKD_PATH, |
| 284 | NETWORKD_INTERFACE, "Reload"); |
| 285 | bus.call_noreply(method); |
| 286 | } |
Patrick Williams | c38b071 | 2022-07-22 19:26:54 -0500 | [diff] [blame] | 287 | catch (const sdbusplus::exception_t& ex) |
William A. Kennington III | 56ecc78 | 2021-10-07 18:44:50 -0700 | [diff] [blame] | 288 | { |
| 289 | log<level::ERR>("Failed to reload configuration", |
| 290 | entry("ERR=%s", ex.what())); |
| 291 | elog<InternalFailure>(); |
| 292 | } |
William A. Kennington III | d41db38 | 2021-11-09 20:42:29 -0800 | [diff] [blame] | 293 | // Ensure reconfiguration has enough time |
| 294 | refreshObjectTimer->setRemaining(refreshTimeout); |
William A. Kennington III | 56ecc78 | 2021-10-07 18:44:50 -0700 | [diff] [blame] | 295 | } |
| 296 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 297 | } // namespace network |
| 298 | } // namespace phosphor |