diff --git a/domain-server/src/DomainGatekeeper.cpp b/domain-server/src/DomainGatekeeper.cpp index abe7ed176a..051465efd2 100644 --- a/domain-server/src/DomainGatekeeper.cpp +++ b/domain-server/src/DomainGatekeeper.cpp @@ -109,7 +109,14 @@ void DomainGatekeeper::processConnectRequestPacket(QSharedPointer(node->getLinkedData()); nodeData->setSendingSockAddr(message->getSenderSockAddr()); - nodeData->setNodeInterestSet(nodeConnection.interestList.toSet()); + + // guard against patched agents asking to hear about other agents + auto safeInterestSet = nodeConnection.interestList.toSet(); + if (nodeConnection.nodeType == NodeType::Agent) { + safeInterestSet.remove(NodeType::Agent); + } + + nodeData->setNodeInterestSet(safeInterestSet); nodeData->setPlaceName(nodeConnection.placeName); // signal that we just connected a node so the DomainServer can get it a list diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 5208cb2326..6668ed54dc 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -843,7 +843,14 @@ void DomainServer::processListRequestPacket(QSharedPointer mess // update the NodeInterestSet in case there have been any changes DomainServerNodeData* nodeData = reinterpret_cast(sendingNode->getLinkedData()); - nodeData->setNodeInterestSet(nodeRequestData.interestList.toSet()); + + // guard against patched agents asking to hear about other agents + auto safeInterestSet = nodeRequestData.interestList.toSet(); + if (sendingNode->getType() == NodeType::Agent) { + safeInterestSet.remove(NodeType::Agent); + } + + nodeData->setNodeInterestSet(safeInterestSet); // update the connecting hostname in case it has changed nodeData->setPlaceName(nodeRequestData.placeName); @@ -950,7 +957,8 @@ void DomainServer::sendDomainListToNode(const SharedNodePointer& node, const Hif if (nodeData->isAuthenticated()) { // if this authenticated node has any interest types, send back those nodes as well limitedNodeList->eachNode([&](const SharedNodePointer& otherNode){ - if (otherNode->getUUID() != node->getUUID() && nodeInterestSet.contains(otherNode->getType())) { + if (otherNode->getUUID() != node->getUUID() + && nodeInterestSet.contains(otherNode->getType())) { // since we're about to add a node to the packet we start a segment domainListPackets->startSegment();