Page MenuHomeFreeBSD

ping: Fix the display of Flags/Fragment Offset
ClosedPublic

Authored by jlduran_gmail.com on Feb 10 2023, 12:49 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Mar 8, 10:45 PM
Unknown Object (File)
Fri, Mar 8, 10:45 PM
Unknown Object (File)
Fri, Mar 8, 7:08 AM
Unknown Object (File)
Fri, Mar 8, 6:57 AM
Unknown Object (File)
Jan 5 2024, 7:37 AM
Unknown Object (File)
Dec 23 2023, 1:13 AM
Unknown Object (File)
Dec 10 2023, 10:55 PM
Unknown Object (File)
Oct 31 2023, 12:52 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