lip6-lisp/control-plane — pull request #4 by sassospicco (2014-12-01 11:46:26+00:00)
Title: Fixing inner IP header checksum computation

Encapsulated control packets have an "outer" and an "inner"
IP header. The checksum computation for the inner one is
currently wrong.

In plugin_openlisp.c, it is performed on the whole IP packet,
instead of the header only. In udp.c the length is correct,
but the subsequent htons is not necessary.

This is not a critical bug, since current LISP implementations
apparently do not check for the inner checksum when
decapsulating, but this behavior should not be relied upon.
Moreover, it gives an ugly orange-on-black color in Wireshark
captures.

This commit also changes the "unsigned short*" type of
ip_checksum argument to the almost equivalent "uint16_t*",
for maximum clarity and portability.

The fix is applied only to v3.2b folder, but it would be trivial to
extend it to other branches.