On Wed, Mar 07, 2012 at 02:26:46PM -0800, Jesse Gross wrote: > On Wed, Mar 7, 2012 at 10:46 AM, Ben Pfaff <b...@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 <je...@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 > these.
Thank you for the explanations. After staring at the code and the changes for a while longer, it all makes sense. Acked-by: Ben Pfaff <b...@nicira.com> (again) _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev