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)
Wed, Apr 16, 3:44 PM
Unknown Object (File)
Mar 22 2025, 9:47 PM
Unknown Object (File)
Feb 25 2025, 3:07 AM
Unknown Object (File)
Feb 6 2025, 3:34 AM
Unknown Object (File)
Feb 5 2025, 12:41 PM
Unknown Object (File)
Jan 30 2025, 7:01 AM
Unknown Object (File)
Jan 24 2025, 7:03 PM
Unknown Object (File)
Jan 23 2025, 7:00 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