aboutsummaryrefslogtreecommitdiffhomepage
path: root/protocol.c
diff options
context:
space:
mode:
authoreihrul <eihrul>2011-05-30 19:00:26 +0000
committereihrul <eihrul>2011-05-30 19:00:26 +0000
commit33e2fc62012978a10a3a7f7f27c33eb2115b884b (patch)
tree14f4d74a91014d1ebb367f4d3bdc98146b41cb48 /protocol.c
parent620e92fa66ee922ea02ee79677945b8e1c537a2b (diff)
downloadenet-33e2fc62012978a10a3a7f7f27c33eb2115b884b.tar.gz
enet-33e2fc62012978a10a3a7f7f27c33eb2115b884b.zip
check received port
Diffstat (limited to 'protocol.c')
-rw-r--r--protocol.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/protocol.c b/protocol.c
index 2237ba8..9791839 100644
--- a/protocol.c
+++ b/protocol.c
@@ -852,7 +852,8 @@ enet_protocol_handle_incoming_commands (ENetHost * host, ENetEvent * event)
if (peer -> state == ENET_PEER_STATE_DISCONNECTED ||
peer -> state == ENET_PEER_STATE_ZOMBIE ||
- (host -> receivedAddress.host != peer -> address.host &&
+ ((host -> receivedAddress.host != peer -> address.host ||
+ host -> receivedAddress.port != peer -> address.port) &&
peer -> address.host != ENET_HOST_BROADCAST) ||
(peer -> outgoingPeerID < ENET_PROTOCOL_MAXIMUM_PEER_ID &&
sessionID != peer -> incomingSessionID))