Skip to content

Commit

Permalink
Require client to consistently use peer ID
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Jan 6, 2024
1 parent 930dcbf commit bad960a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/network/connectionthreads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,13 @@ void ConnectionReceiveThread::receive(SharedBuffer<u8> &packetdata,
peer->SetFullyOpen();
// Setup phase has a fixed timeout
peer->ResetTimeout();
} else if (!peer->isHalfOpen()) {
// If the peer talks to us without a peer ID when it has done so
// before something is definitely fishy.
LOG(derr_con << m_connection->getDesc()
<< " Peer " << peer_id << " sending without peer id?!"
" Ignoring." << std::endl);
return;
}

auto *udpPeer = dynamic_cast<UDPPeer *>(&peer);
Expand Down

0 comments on commit bad960a

Please sign in to comment.