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)
Oct 8 2024, 2:17 AM
Unknown Object (File)
Oct 8 2024, 2:17 AM
Unknown Object (File)
Oct 8 2024, 2:17 AM
Unknown Object (File)
Oct 8 2024, 1:53 AM
Unknown Object (File)
Oct 1 2024, 1:37 PM
Unknown Object (File)
Sep 30 2024, 7:13 AM
Unknown Object (File)
Sep 26 2024, 8:58 PM
Unknown Object (File)
Sep 21 2024, 4:12 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.