mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 16:43:33 +02:00
Merge pull request #11701 from birarda/bug/local-ds-inconnect
only respond to expected ICE peers in DS
This commit is contained in:
commit
de4fd269ef
4 changed files with 16 additions and 4 deletions
|
@ -814,9 +814,15 @@ void DomainGatekeeper::processICEPeerInformationPacket(QSharedPointer<ReceivedMe
|
|||
|
||||
void DomainGatekeeper::processICEPingPacket(QSharedPointer<ReceivedMessage> message) {
|
||||
auto limitedNodeList = DependencyManager::get<LimitedNodeList>();
|
||||
auto pingReplyPacket = limitedNodeList->constructICEPingReplyPacket(*message, limitedNodeList->getSessionUUID());
|
||||
|
||||
limitedNodeList->sendPacket(std::move(pingReplyPacket), message->getSenderSockAddr());
|
||||
// before we respond to this ICE ping packet, make sure we have a peer in the list that matches
|
||||
QUuid icePeerID = QUuid::fromRfc4122({ message->getRawMessage(), NUM_BYTES_RFC4122_UUID });
|
||||
|
||||
if (_icePeers.contains(icePeerID)) {
|
||||
auto pingReplyPacket = limitedNodeList->constructICEPingReplyPacket(*message, limitedNodeList->getSessionUUID());
|
||||
|
||||
limitedNodeList->sendPacket(std::move(pingReplyPacket), message->getSenderSockAddr());
|
||||
}
|
||||
}
|
||||
|
||||
void DomainGatekeeper::processICEPingReplyPacket(QSharedPointer<ReceivedMessage> message) {
|
||||
|
|
|
@ -557,10 +557,10 @@ void NodeList::pingPunchForDomainServer() {
|
|||
flagTimeForConnectionStep(LimitedNodeList::ConnectionStep::SendPingsToDS);
|
||||
|
||||
// send the ping packet to the local and public sockets for this node
|
||||
auto localPingPacket = constructICEPingPacket(PingType::Local, _sessionUUID);
|
||||
auto localPingPacket = constructICEPingPacket(PingType::Local, _domainHandler.getICEClientID());
|
||||
sendPacket(std::move(localPingPacket), _domainHandler.getICEPeer().getLocalSocket());
|
||||
|
||||
auto publicPingPacket = constructICEPingPacket(PingType::Public, _sessionUUID);
|
||||
auto publicPingPacket = constructICEPingPacket(PingType::Public, _domainHandler.getICEClientID());
|
||||
sendPacket(std::move(publicPingPacket), _domainHandler.getICEPeer().getPublicSocket());
|
||||
|
||||
_domainHandler.getICEPeer().incrementConnectionAttempts();
|
||||
|
|
|
@ -72,6 +72,8 @@ PacketVersion versionForPacketType(PacketType packetType) {
|
|||
case PacketType::MicrophoneAudioWithEcho:
|
||||
case PacketType::AudioStreamStats:
|
||||
return static_cast<PacketVersion>(AudioVersion::HighDynamicRangeVolume);
|
||||
case PacketType::ICEPing:
|
||||
return static_cast<PacketVersion>(IcePingVersion::SendICEPeerID);
|
||||
default:
|
||||
return 17;
|
||||
}
|
||||
|
|
|
@ -278,4 +278,8 @@ enum class MessageDataVersion : PacketVersion {
|
|||
TextOrBinaryData = 18
|
||||
};
|
||||
|
||||
enum class IcePingVersion : PacketVersion {
|
||||
SendICEPeerID = 18
|
||||
};
|
||||
|
||||
#endif // hifi_PacketHeaders_h
|
||||
|
|
Loading…
Reference in a new issue