enet icon indicating copy to clipboard operation
enet copied to clipboard

IP address change on peer causes messages to fail in 1 direction behind some routers

Open deltars opened this issue 8 years ago • 0 comments

With our application using enet with win32, we were able to connect over LAN address, but we were unable to connect to the host when using internet IP address.

The ports are forwarded correctly, and putting break points / logging shows the packets are arriving.

However, the first packet that arrives is addressed with the router IP address, rather than the client peers address. Subsequent packets arrive with the correct IP address, just the first packet is addressed from the router.

This means that on the host, enet rejects all packets except for the first one.

Interestingly, on the host, all packets get sent to the routers IP, and they reach the destination without problem.

Removing the check on the host in protocol.c that checks the packets IP matches the peers IP resolves the issue, but obviously that check is useful for security.

The router is an ASUS RT-AC68U.

I don't think the router is behaving correctly by re-addressing the first packet to be from the router, but regardless, I think Enet should work even with strange behaviors on routers. It is also possible that a peer changes IP address during the connection for other reasons and I think Enet should be able to handle this.

deltars avatar Jul 05 '17 07:07 deltars