have the DS ignore packets it receives with incorrect headers

This commit is contained in:
Stephen Birarda 2013-05-06 13:49:06 -07:00
parent a4c525e308
commit 9f320568e1

View file

@ -96,7 +96,8 @@ int main(int argc, const char * argv[])
agentList->startSilentAgentRemovalThread();
while (true) {
if (agentList->getAgentSocket().receive((sockaddr *)&agentPublicAddress, packetData, &receivedBytes)) {
if (agentList->getAgentSocket().receive((sockaddr *)&agentPublicAddress, packetData, &receivedBytes) &&
(packetData[0] == PACKET_HEADER_DOMAIN_RFD) || (packetData[0] == PACKET_HEADER_DOMAIN_LIST_REQUEST)) {
std::map<char, Agent *> newestSoloAgents;
agentType = packetData[1];