Page MenuHomeFreeBSD

traceroute6: Properly calculate UDP checksum
ClosedPublic

Authored by zlei on Apr 30 2021, 9:14 AM.
Tags
None
Referenced Files
F161565074: D30042.diff
Sat, Jul 4, 10:15 PM
F161565001: D30042.diff
Sat, Jul 4, 10:15 PM
Unknown Object (File)
Mon, Jun 15, 2:32 PM
Unknown Object (File)
Mon, Jun 15, 1:52 PM
Unknown Object (File)
Apr 30 2026, 5:36 AM
Unknown Object (File)
Apr 29 2026, 3:14 PM
Unknown Object (File)
Apr 29 2026, 3:08 PM
Unknown Object (File)
Apr 29 2026, 2:36 AM
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