diff --git a/fpga/lib/ip_node.cpp b/fpga/lib/ip_node.cpp index be5af573c..9435e24a3 100644 --- a/fpga/lib/ip_node.cpp +++ b/fpga/lib/ip_node.cpp @@ -96,6 +96,11 @@ IpNode::getLoopbackPorts() const bool IpNode::connect(const StreamVertex& from, const StreamVertex& to) { + if(from.nodeName != getInstanceName()) { + logger->error("Cannot connect from a foreign StreamVertex: {}", from); + return false; + } + StreamGraph::Path path; if(not streamGraph.getPath(from.getIdentifier(), to.getIdentifier(), path)) { logger->error("No path from {} to {}", from, to); @@ -132,7 +137,7 @@ bool IpNode::connect(const StreamVertex& from, const StreamVertex& to) nextHopNode = secondHopNode; } - auto nextHopNodeIp = reinterpret_cast + auto nextHopNodeIp = dynamic_cast (card->lookupIp(nextHopNode->nodeName)); if(nextHopNodeIp == nullptr) {