Fix hash_function().
authorEtienne Dechamps <etienne@edechamps.fr>
Sat, 20 Jul 2013 13:50:28 +0000 (14:50 +0100)
committerGuus Sliepen <guus@tinc-vpn.org>
Sat, 20 Jul 2013 21:31:19 +0000 (23:31 +0200)
The hashing function that tinc uses is currently broken as it only looks
at the first 4 bytes of data.

This leads to interesting bugs, like the node UDP address cache being
subtly broken because two addresses with the same protocol and port (but
not the same IP address) will override each other. This is because
the first four bytes of sockaddr_in contains the IP protocol and port,
while the IP address itself is contained in the four remaining bytes
that are never used when the hash is computed.


No differences found