Page MenuHomeFreeBSD

traceroute6: Properly calculate UDP checksum
ClosedPublic

Authored by zlei on Apr 30 2021, 9:14 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 12, 6:32 PM
Unknown Object (File)
Sat, Nov 9, 1:08 AM
Unknown Object (File)
Fri, Nov 8, 9:48 PM
Unknown Object (File)
Thu, Oct 24, 9:41 AM
Unknown Object (File)
Oct 20 2024, 1:38 PM
Unknown Object (File)
Oct 11 2024, 6:54 AM
Unknown Object (File)
Sep 29 2024, 8:58 AM
Unknown Object (File)
Sep 28 2024, 5:34 PM
Subscribers
None

Details

Summary

The revision D25604 capsicumize traceroute6. For UDP the send socket was changed from SOCK_DGRAM to SOCK_RAW and thus the UDP checksum need be calculated by application itself other than the kernel.

outpacket is filled with zeros by line 707, thus the first round the UDP checksum is correct. But subsequent rounds outudp->uh_sum will be left with garbage.

PR: 255507

Test Plan

host A <----> Router <----> host B

  1. traceroute6 hostB
  2. netstat -sp udp | grep 'bad checksum'

Diff Detail

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