aboutsummaryrefslogtreecommitdiffhomepage
path: root/protocol.c
diff options
context:
space:
mode:
Diffstat (limited to 'protocol.c')
-rw-r--r--protocol.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/protocol.c b/protocol.c
index d0014f0..ef8935b 100644
--- a/protocol.c
+++ b/protocol.c
@@ -643,11 +643,15 @@ 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 &&
+ peer -> address.host != ENET_HOST_BROADCAST) ||
header -> challenge != peer -> challenge)
return 0;
else
- peer -> address.port = host -> receivedAddress.port;
+ {
+ peer -> address.host = host -> receivedAddress.host;
+ peer -> address.port = host -> receivedAddress.port;
+ }
}
if (peer != NULL)