diff --git a/src/engine/shared/network_conn.cpp b/src/engine/shared/network_conn.cpp index 69001b9ee..27aeaad3f 100644 --- a/src/engine/shared/network_conn.cpp +++ b/src/engine/shared/network_conn.cpp @@ -308,7 +308,20 @@ int CNetConnection::Feed(CNetPacketConstruct *pPacket, NETADDR *pAddr, SECURITY_ if(CtrlMsg == NET_CTRLMSG_CLOSE) { - if(net_addr_comp(&m_PeerAddr, pAddr) == 0) + bool IsPeer; + if(m_State != NET_CONNSTATE_CONNECT) + { + IsPeer = m_PeerAddr == *pAddr; + } + else + { + IsPeer = false; + for(int i = 0; i < m_NumConnectAddrs; i++) + { + IsPeer = IsPeer || m_aConnectAddrs[i] == *pAddr; + } + } + if(IsPeer) { m_State = NET_CONNSTATE_ERROR; m_RemoteClosed = 1;