Verify packet integrity with CRC32
Created attachment 329 [details]
Patch for r2714 that implements packet CRC32 checking
UDP provides a 16-bit checksum for verifying the integrity of a packet. While this is relatively sufficient (only 1 in 65536 corrupted packets would be accepted), the UDP checksum is optional, which poses a greater problem. If a client's TCP/IP stack does not use the checksum or (more likely) some router between the client and the server does not use the checksum, corrupted packets are not being detected.
While I am not sure of the impact this has for Odamex, other non-Doom games implement their own CRC32 check for each packet sent and received, dropping corrupted packets. I have implemented this for Odamex and plan to test it in the near future with a few players I've come across who experience higher than normal network related bugs. Hopefully this will allow me to gauge whether adding CRC32 checks to packets would be worth the extra 4-byte overhead per packet.
if other multiplayer games use this and what you say about the field being optional, I think its a must then
another thing is VLAs are a gcc extension, line 524 of i_net.cpp uses one which is msvc incompatible, if you can could you update the patch to use either alloca() or malloc/free combo instead?