*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-bootp.c,v 1.55 2000-12-03 23:45:37 fenner Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-bootp.c,v 1.56 2000-12-04 00:00:08 fenner Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
else {
u_int32_t ul;
- memcpy((char *)&ul, (char *)bp->bp_vend, sizeof(ul));
+ ul = EXTRACT_32BITS(&bp->bp_vend);
if (ul != 0)
printf("vend-#0x%x", ul);
}
if (tag == TAG_END)
return;
if (tag == TAG_EXTENDED_OPTION) {
- TCHECK(bp + 1, 2);
+ TCHECK2(*(bp + 1), 2);
tag = EXTRACT_16BITS(bp + 1);
/* XXX we don't know yet if the IANA will
* preclude overlap of 1-byte and 2-byte spaces.
while (size >= sizeof(ul)) {
if (!first)
putchar(',');
- memcpy((char *)&ul, (char *)bp, sizeof(ul));
- if (c == 'i')
+ ul = EXTRACT_32BITS(bp);
+ if (c == 'i') {
+ ul = htonl(ul);
printf("%s", ipaddr_string(&ul));
- else if (c == 'L')
+ } else if (c == 'L')
printf("%d", ul);
else
printf("%u", ul);
while (size >= sizeof(us)) {
if (!first)
putchar(',');
- memcpy((char *)&us, (char *)bp, sizeof(us));
+ us = EXTRACT_16BITS(bp);
printf("%d", us);
bp += sizeof(us);
size -= sizeof(us);
if (size)
printf("[len %d]", len);
}
+ return;
+trunc:
+ printf("|[rfc1048]");
}
static void