packet: Match userspace and kernel definition of ICMP header.
authorJesse Gross <jesse@nicira.com>
Tue, 27 Dec 2011 01:33:03 +0000 (17:33 -0800)
committerJesse Gross <jesse@nicira.com>
Tue, 27 Dec 2011 19:18:54 +0000 (11:18 -0800)
commit090b95eaad37d4db390aafa12a6ac37f18976034
tree7558bfc8659d091521900e0e205c48510cf55736
parent2a71b8db7d120fbf22aa8f39c64a6fed1f5188ed
packet: Match userspace and kernel definition of ICMP header.

Current userspace considers an ICMP header to be 4 bytes consisting
of the type, code, and checksum.  The kernel considers it to be 8
bytes because it also counts the two data fields that contain
type-specific information (and are always present).  Since flow
extract will zero out headers that are not completely present this
means that an ICMP packet that has a header of 5-7 bytes will be
interpreted differently by userspace and kernel.  This fixes the
problem by adopting the kernel's version of the ICMP header in
userspace.

Signed-off-by: Jesse Gross <jesse@nicira.com>
lib/packets.h