Skip to content

Commit 7fdb862

Browse files
committed
Fix FindBinder TypeId check for modern NS-3 compatibility
Object::GetInstanceTypeId() cannot be overridden in modern NS-3, making TypeId comparison always fail. Type safety ensured by dynamic_cast. Signed-off-by: Anders Martinsson <anders.martinsson@sikabo.com>
1 parent e62c790 commit 7fdb862

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

model/local-socket-fd-factory.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ LocalSocketFdFactory::CreateSocket (int domain, int type, int protocol)
8181
LocalSocketFd*
8282
LocalSocketFdFactory::FindBinder (std::string path, TypeId type) const
8383
{
84+
NS_LOG_FUNCTION (this << path << type.GetName());
8485
BindMap::const_iterator i = m_bindByPath.find (path);
8586
if (m_bindByPath.end () == i)
8687
{
@@ -89,7 +90,7 @@ LocalSocketFdFactory::FindBinder (std::string path, TypeId type) const
8990

9091
LocalSocketFd* winner = i->second;
9192

92-
if ((winner != 0) && (winner->GetInstanceTypeId () == type))
93+
if ((winner != 0))
9394
{
9495
return winner;
9596
}

0 commit comments

Comments
 (0)