mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Block attempts to connect to the client (#10589)
A Minetest peer initiates a connection by sending a packet with an invalid peer_id, for whatever reason the code for doing this ran on both the client and the server meaning you could connect to a client if you knew what the address:port tuple it was listening on.
This commit is contained in:
parent
9c9344ceb3
commit
0abb3e89fa
3 changed files with 10 additions and 2 deletions
|
@ -1566,7 +1566,7 @@ void Connection::sendAck(session_t peer_id, u8 channelnum, u16 seqnum)
|
|||
|
||||
UDPPeer* Connection::createServerPeer(Address& address)
|
||||
{
|
||||
if (getPeerNoEx(PEER_ID_SERVER) != 0)
|
||||
if (ConnectedToServer())
|
||||
{
|
||||
throw ConnectionException("Already connected to a server");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue