From f0e4a3b40e5d2df886c43e36418121b5c0830992 Mon Sep 17 00:00:00 2001 From: Fred Suter Date: Tue, 5 Apr 2022 16:53:00 -0400 Subject: [PATCH] allow Engine::link_by_name_or_null(__loopback__) --- src/s4u/s4u_Engine.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/s4u/s4u_Engine.cpp b/src/s4u/s4u_Engine.cpp index 74d9f867cc..7b529b4f8b 100644 --- a/src/s4u/s4u_Engine.cpp +++ b/src/s4u/s4u_Engine.cpp @@ -258,6 +258,9 @@ Link* Engine::link_by_name_or_null(const std::string& name) const { Link* link = nullptr; if (pimpl->netzone_root_) { + /* keep behavior where internal __loopback__ link from network model is given to user */ + if (name == "__loopback__") + return pimpl->netzone_root_->get_network_model()->loopback_->get_iface(); auto* link_impl = pimpl->netzone_root_->get_link_by_name_or_null(name); if (link_impl) link = link_impl->get_iface(); -- 2.20.1