aboutsummaryrefslogtreecommitdiff
path: root/src/network/connection.cpp
diff options
context:
space:
mode:
authorred-001 <red-001@outlook.ie>2020-11-02 21:21:03 +0000
committerGitHub <noreply@github.com>2020-11-02 22:21:03 +0100
commit0abb3e89fa6298041faa7e46d437e5a81f71cdd3 (patch)
treea5043443766349fd63d452e4f33dbea65213de70 /src/network/connection.cpp
parent9c9344ceb31892a8563994190f1ec31cb872f12c (diff)
downloadminetest-0abb3e89fa6298041faa7e46d437e5a81f71cdd3.tar.gz
minetest-0abb3e89fa6298041faa7e46d437e5a81f71cdd3.tar.bz2
minetest-0abb3e89fa6298041faa7e46d437e5a81f71cdd3.zip
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.
Diffstat (limited to 'src/network/connection.cpp')
-rw-r--r--src/network/connection.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/connection.cpp b/src/network/connection.cpp
index 1875d1461..0ba8c36b2 100644
--- a/src/network/connection.cpp
+++ b/src/network/connection.cpp
@@ -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");
}