X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/0661474e3ea3d3a1f77a7f8df39ce7c0a1f1ddc3..40e7f314ac41d4c6dc542ebb577cfd063df35e19:/print-bootp.c diff --git a/print-bootp.c b/print-bootp.c index 605103c0..d1534c7a 100644 --- a/print-bootp.c +++ b/print-bootp.c @@ -21,8 +21,8 @@ * Format and print bootp packets. */ #ifndef lint -static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-bootp.c,v 1.73 2003-05-01 18:02:12 guy Exp $ (LBL)"; +static const char rcsid[] _U_ = + "@(#) $Header: /tcpdump/master/tcpdump/print-bootp.c,v 1.79 2005-04-20 10:30:52 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -45,6 +45,17 @@ static void cmu_print(const u_char *); static char tstr[] = " [|bootp]"; +static const struct tok bootp_flag_values[] = { + { 0x8000, "Broadcast" }, + { 0, NULL} +}; + +static const struct tok bootp_op_values[] = { + { BOOTPREQUEST, "Request" }, + { BOOTPREPLY, "Reply" }, + { 0, NULL} +}; + /* * Print bootp requests */ @@ -130,7 +141,7 @@ bootp_print(register const u_char *cp, u_int length) } putchar('"'); } - TCHECK2(bp->bp_sname[0], 1); /* check first char only */ + TCHECK2(bp->bp_file[0], 1); /* check first char only */ if (*bp->bp_file) { printf("\n\t file \""); if (fn_print(bp->bp_file, snapend)) { @@ -545,6 +556,11 @@ rfc1048_print(register const u_char *bp) break; case TAG_CLIENT_FQDN: + /* option 81 should be at least 4 bytes long */ + if (len < 4) { + printf("ERROR: options 81 len %u < 4 bytes", len); + break; + } if (*bp++) printf("[svrreg]"); if (*bp)