Page MenuHomeFreeBSD

ping: Fix the display of Flags/Fragment Offset
ClosedPublic

Authored by jlduran on Feb 10 2023, 12:49 AM.
Tags
None
Referenced Files
F153610665: D38479.diff
Wed, Apr 22, 7:55 AM
F153547981: D38479.diff
Tue, Apr 21, 7:54 PM
Unknown Object (File)
Mon, Apr 6, 8:53 PM
Unknown Object (File)
Mar 15 2026, 8:55 PM
Unknown Object (File)
Mar 9 2026, 7:50 AM
Unknown Object (File)
Mar 9 2026, 1:34 AM
Unknown Object (File)
Mar 2 2026, 7:02 AM
Unknown Object (File)
Mar 1 2026, 3:53 AM

Details

Summary

In the IP header, Flags + Fragment Offset is a 16-bit field.

Use ntohs() instead of ntohl(), otherwise the Flags/Fragment Offset values may not display correctly.

Before (DF set)

Vr HL TOS  Len   ID Flg  off TTL Pro  cks      Src      Dst
 4  5  00 0054 0001   0 0000  40  01 b6a4 192.0.2.1  192.0.2.2

After (DF set)

Vr HL TOS  Len   ID Flg  off TTL Pro  cks      Src      Dst
 4  5  00 0054 0001   2 0000  40  01 b6a4 192.0.2.1  192.0.2.2

Diff Detail

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