diff options
Diffstat (limited to 'thirdparty/enet/protocol.c')
-rw-r--r-- | thirdparty/enet/protocol.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/thirdparty/enet/protocol.c b/thirdparty/enet/protocol.c index 4a2a4ed185..cbeea1a763 100644 --- a/thirdparty/enet/protocol.c +++ b/thirdparty/enet/protocol.c @@ -299,7 +299,7 @@ enet_protocol_handle_connect (ENetHost * host, ENetProtocolHeader * header, ENet } else if (currentPeer -> state != ENET_PEER_STATE_CONNECTING && - currentPeer -> address.host == host -> receivedAddress.host) + enet_host_equal(currentPeer -> address.host, host -> receivedAddress.host)) { if (currentPeer -> address.port == host -> receivedAddress.port && currentPeer -> connectID == command -> connect.connectID) @@ -1011,9 +1011,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.port != peer -> address.port) && - peer -> address.host != ENET_HOST_BROADCAST) || + (!enet_host_equal(host -> receivedAddress.host, peer -> address.host) || + host -> receivedAddress.port != peer -> address.port) || (peer -> outgoingPeerID < ENET_PROTOCOL_MAXIMUM_PEER_ID && sessionID != peer -> incomingSessionID)) return 0; @@ -1055,7 +1054,7 @@ enet_protocol_handle_incoming_commands (ENetHost * host, ENetEvent * event) if (peer != NULL) { - peer -> address.host = host -> receivedAddress.host; + enet_address_set_ip(&(peer -> address), host -> receivedAddress.host, 16); peer -> address.port = host -> receivedAddress.port; peer -> incomingDataTotal += host -> receivedDataLength; } |