From: Francois-Xavier Le Bail Date: Sun, 10 May 2020 21:13:27 +0000 (+0200) Subject: DHCP: Fix the option 81 flags field printing X-Git-Tag: tcpdump-4.99-bp~406 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/e2481334a1f4402cf735ec851d14f1428d7a5f58?hp=e4f2e97ad06b55b9fc7bcd3df32ce21cee894c6b DHCP: Fix the option 81 flags field printing The first nibble of the option 81 flags field must be zero. The current flags are in the second nibble. From RFC 4702: 2.1. The Flags Field The format of the 1-octet Flags field is: 0 1 2 3 4 5 6 7 +-+-+-+-+-+-+-+-+ | MBZ |N|E|O|S| +-+-+-+-+-+-+-+-+ [...] The remaining bits in the Flags field are reserved for future assignment. DHCP clients and servers that send the Client FQDN option MUST clear the MBZ bits, and they MUST ignore these bits. --- diff --git a/print-bootp.c b/print-bootp.c index 264a016b..6daf485a 100644 --- a/print-bootp.c +++ b/print-bootp.c @@ -845,7 +845,11 @@ rfc1048_print(netdissect_options *ndo, len = 0; break; } - if (GET_U_1(bp)) + if (GET_U_1(bp) & 0xf0) { + ND_PRINT("[ERROR: MBZ nibble 0x%x != 0] ", + (GET_U_1(bp) & 0xf0) >> 4); + } + if (GET_U_1(bp) & 0x0f) ND_PRINT("[%s] ", client_fqdn_flags(GET_U_1(bp))); bp++;