neighbor: Disallow property changes
These do nothing and would cause the DBus entries to become
inconsistent.
Change-Id: I9bf815534c7098a22e0cc76c0c103b43de310837
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/src/neighbor.cpp b/src/neighbor.cpp
index e35d262..e15085a 100644
--- a/src/neighbor.cpp
+++ b/src/neighbor.cpp
@@ -13,11 +13,14 @@
#include <sys/socket.h>
#include <sys/types.h>
+#include <phosphor-logging/elog-errors.hpp>
+#include <phosphor-logging/elog.hpp>
#include <stdexcept>
#include <stdplus/raw.hpp>
#include <string_view>
#include <utility>
#include <vector>
+#include <xyz/openbmc_project/Common/error.hpp>
namespace phosphor
{
@@ -104,5 +107,25 @@
parent.deleteStaticNeighborObject(ipAddress());
}
+using sdbusplus::xyz::openbmc_project::Common::Error::NotAllowed;
+using REASON =
+ phosphor::logging::xyz::openbmc_project::Common::NotAllowed::REASON;
+using phosphor::logging::elog;
+
+std::string Neighbor::ipAddress(std::string /*ipAddress*/)
+{
+ elog<NotAllowed>(REASON("Property update is not allowed"));
+}
+
+std::string Neighbor::macAddress(std::string /*macAddress*/)
+{
+ elog<NotAllowed>(REASON("Property update is not allowed"));
+}
+
+Neighbor::State Neighbor::state(State /*state*/)
+{
+ elog<NotAllowed>(REASON("Property update is not allowed"));
+}
+
} // namespace network
} // namespace phosphor
diff --git a/src/neighbor.hpp b/src/neighbor.hpp
index 26859c3..4672726 100644
--- a/src/neighbor.hpp
+++ b/src/neighbor.hpp
@@ -88,6 +88,13 @@
*/
void delete_() override;
+ using NeighborObj::ipAddress;
+ std::string ipAddress(std::string) override;
+ using NeighborObj::macAddress;
+ std::string macAddress(std::string) override;
+ using NeighborObj::state;
+ State state(State) override;
+
private:
/** @brief Parent Object. */
EthernetInterface& parent;