diff options
Diffstat (limited to 'protocol.c')
-rw-r--r-- | protocol.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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) |