datapath: Correctly update IP checksum with actions.
authorJesse Gross <jesse@nicira.com>
Tue, 7 Dec 2010 01:51:33 +0000 (17:51 -0800)
committerJesse Gross <jesse@nicira.com>
Fri, 10 Dec 2010 01:43:36 +0000 (17:43 -0800)
commit8b69563f9744877ea15bf8cb69a6bdebf8e7f477
treed1182c6393d25d3b096cc67d2944efaa6d3cfcba
parent02a8cc607590c0f13eb3727ffda8e6ea7898a140
datapath: Correctly update IP checksum with actions.

The update_csum() function that we currently use to update
checksums on actions is really intended for L4 checksums.  In
particular, if the packet has a partial checksum and the field
is not in the pseudo header, it doesn't do anything at all.
This doesn't make sense for the IP header because Linux doesn't
use hardware offload for it, so we always need to recompute the
checksum.  Instead, we can use the kernel function csum_replace4(),
which will always do the right thing.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
datapath/actions.c