[ovs-dev] [PATCH v2] datapath: Fix checksum update for actions on UDP packets.
jesse at nicira.com
Wed Mar 7 14:26:46 PST 2012
On Wed, Mar 7, 2012 at 10:46 AM, Ben Pfaff <blp at nicira.com> wrote:
> On Tue, Mar 06, 2012 at 03:40:51PM -0800, Jesse Gross wrote:
>> When modifying IP addresses or ports on a UDP packet we don't
>> correctly follow the rules for unchecksummed packets. This meant
>> that packets without a checksum can be given a incorrect new checksum
>> and packets with a checksum can become marked as being unchecksummed.
>> This fixes it to handle those requirements.
>> Bug #8937
>> Signed-off-by: Jesse Gross <jesse at nicira.com>
>> v2: CSUM_MANGLED_0 was not introduced until 2.6.20
> It's not obvious to me why the UDP cases in this file need a check for
> OVS_CSUM_PARTIAL but the TCP cases do not.
There are two things:
* inet_proto_csum_replaceX includes a check for CHECKSUM_PARTIAL and
it is no-op if it's an offloaded checksum and the modified part is not
in the pseudoheader, so both TCP and UDP do handle this (and did
before this patch).
* When using CHECKSUM_PARTIAL with UDP the checksum of the
pseudoheader is stored in the checksum field without using
CSUM_MANGLED_0 so it's possible for it to have the value 0 and be
interpreted as an unchecksummed packet. Actual unchecksummed packets
won't use CHECKSUM_PARTIAL so we know the we always need to update
> It would make the naming more consistent if this patch also renamed
> set_tcp_port() to set_tcp().
I was going to do that but was trying to keep the patch minimal.
However, since it's such a minor change, I'll go ahead and do it.
More information about the dev