Page MenuHomeFreeBSD

udplite: fix checksum computation on the sender side
ClosedPublic

Authored by tuexen on Oct 18 2023, 11:08 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jun 21, 8:43 AM
Unknown Object (File)
Mon, Jun 17, 12:10 AM
Unknown Object (File)
Sun, Jun 16, 1:32 PM
Unknown Object (File)
Sun, Jun 16, 2:42 AM
Unknown Object (File)
Sun, Jun 16, 2:25 AM
Unknown Object (File)
Jan 11 2024, 1:30 AM
Unknown Object (File)
Jan 3 2024, 3:39 PM
Unknown Object (File)
Dec 31 2023, 12:26 PM
Subscribers

Details

Summary

When the checksum on the sender side is computed, the pseudo header is considered. This shares the memory with the IPv4 header. Therefore several fields in the header can only be set after the checksum has been computed. These fields include the IP version field and the DF bit.

While there, write fields in the sequence they appear in the header.

Test Plan

Run a client and server using UDPLite and also set the IP_DONTFRAG option on the sender side.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

glebius added inline comments.
sys/netinet/udp_usrreq.c
1332–1338

Now definitely needed :) Can you please remove XXX and add a comment here:

/* Filling only those fields of udpiphdr that participate in the checksum calculation. The rest must be zeroed and will be filled later. */

Wording can be improved or changed, of course.

1397

Let's not keep this XXX unless anybody can remember what it actually warns about.

This revision was not accepted when it landed; it landed in state Needs Review.Nov 1 2023, 9:30 AM
This revision was automatically updated to reflect the committed changes.