X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/a97fb2f3ae9731dd13e6854742c090ca9ef454cf..6e12d87355718f309ce9f33183ff8235b9c5eb0d:/print-bootp.c diff --git a/print-bootp.c b/print-bootp.c index 499f9785..1594a398 100644 --- a/print-bootp.c +++ b/print-bootp.c @@ -20,10 +20,6 @@ * * Format and print bootp packets. */ -#ifndef lint -static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/print-bootp.c,v 1.89 2008-04-22 09:45:08 hannes Exp $ (LBL)"; -#endif #ifdef HAVE_CONFIG_H #include "config.h" @@ -96,9 +92,9 @@ bootp_print(register const u_char *cp, u_int length) /* Only print interesting fields */ if (bp->bp_hops) printf(", hops %d", bp->bp_hops); - if (bp->bp_xid) + if (EXTRACT_32BITS(&bp->bp_xid)) printf(", xid 0x%x", EXTRACT_32BITS(&bp->bp_xid)); - if (bp->bp_secs) + if (EXTRACT_16BITS(&bp->bp_secs)) printf(", secs %d", EXTRACT_16BITS(&bp->bp_secs)); printf(", Flags [%s]", @@ -108,22 +104,22 @@ bootp_print(register const u_char *cp, u_int length) /* Client's ip address */ TCHECK(bp->bp_ciaddr); - if (bp->bp_ciaddr.s_addr) + if (EXTRACT_32BITS(&bp->bp_ciaddr.s_addr)) printf("\n\t Client-IP %s", ipaddr_string(&bp->bp_ciaddr)); /* 'your' ip address (bootp client) */ TCHECK(bp->bp_yiaddr); - if (bp->bp_yiaddr.s_addr) + if (EXTRACT_32BITS(&bp->bp_yiaddr.s_addr)) printf("\n\t Your-IP %s", ipaddr_string(&bp->bp_yiaddr)); /* Server's ip address */ TCHECK(bp->bp_siaddr); - if (bp->bp_siaddr.s_addr) + if (EXTRACT_32BITS(&bp->bp_siaddr.s_addr)) printf("\n\t Server-IP %s", ipaddr_string(&bp->bp_siaddr)); /* Gateway's ip address */ TCHECK(bp->bp_giaddr); - if (bp->bp_giaddr.s_addr) + if (EXTRACT_32BITS(&bp->bp_giaddr.s_addr)) printf("\n\t Gateway-IP %s", ipaddr_string(&bp->bp_giaddr)); /* Client's Ethernet address */ @@ -691,7 +687,7 @@ rfc1048_print(register const u_char *bp) break; default: - print_unknown_data(bp, "\n\t\t", suboptlen); + print_unknown_data(gndo,bp, "\n\t\t", suboptlen); } len -= suboptlen;