On 8/14/25 5:43 PM, Paolo Valerio via dev wrote: > Mike Pattrick via dev <[email protected]> writes: > >> Previously during NAT actions we could calculate a checksum on a packet, >> if this checksum was valid we would mark it as such for offloading. Then >> when modifying the packet we would check if we set the checksum as >> partial. This worked fine for most packets, but fragmented packets can >> not complete their checksum because we process these packets one at a >> time instead of all at once. This breaks NAT of fragmented packets in >> userspace conntrack. >> >> This patch resolves any outstanding checksums on the reassembled >> fragment before adding the fragments to a batch. >> >> Reported-at: https://issues.redhat.com/browse/FDP-1571 >> Reported-by: Hekai Wang <[email protected]> >> Fixes: e36793e11fe8 ("dp-packet: Resolve unknown checksums.") >> Signed-off-by: Mike Pattrick <[email protected]> >> --- > > Hi Mike, > > the patch looks good to me. > > Acked-by: Paolo Valerio <[email protected]> > >> lib/ipf.c | 3 +++ >> tests/ofproto-dpif.at | 51 +++++++++++++++++++++++++++++++++++++++++++ >> 2 files changed, 54 insertions(+) >> >> diff --git a/lib/ipf.c b/lib/ipf.c >> index 6670ef5a9..b16797312 100644 >> --- a/lib/ipf.c >> +++ b/lib/ipf.c >> @@ -1193,6 +1193,9 @@ ipf_post_execute_reass_pkts(struct ipf *ipf, >> const struct ipf_frag *frag_0 = &rp->list->frag_list[0]; >> void *l4_frag = dp_packet_l4(frag_0->pkt); >> void *l4_reass = dp_packet_l4(pkt); >> + >> + /* Complete all L4 checksums before reassembly. */ >> + dp_packet_ol_send_prepare(pkt, 0); >> memcpy(l4_frag, l4_reass, dp_packet_l4_size(frag_0->pkt)); >> >> for (int i = 0; i <= rp->list->last_inuse_idx; i++) {
Thanks Mike, Hekai and Paolo! This solution is a bit slower than just re-calculating checksums while updating the address incrementally, but it seems the most elegant from solutions that would only affect fragmented traffic. So, it should be fine to do it this way. Applied to main and branch-3.6. Best regards, Ilya Maximets. _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
