]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-bootp.c
RIPng: Use more ND_TCHECK_SIZE() macros
[tcpdump] / print-bootp.c
index 63a67f2da47a008d28a7c9fc79ee4f8a403f1693..37a053464782be6844bfb39be303803319846a1f 100644 (file)
 /* \summary: BOOTP and IPv4 DHCP printer */
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
 #endif
 
-#include <netdissect-stdinc.h>
+#include "netdissect-stdinc.h"
 
 #include <string.h>
 
@@ -72,7 +72,7 @@ struct bootp {
        nd_byte         bp_sname[64];   /* server host name */
        nd_byte         bp_file[128];   /* boot file name */
        nd_byte         bp_vend[64];    /* vendor-specific area */
-} UNALIGNED;
+} ND_UNALIGNED;
 
 #define BOOTPREPLY     2
 #define BOOTPREQUEST   1
@@ -247,7 +247,7 @@ struct cmu_vend {
        struct in_addr  v_ins1, v_ins2; /* IEN-116 name servers */
        struct in_addr  v_ts1, v_ts2;   /* Time servers */
        nd_byte         v_unused[24];   /* currently unused */
-} UNALIGNED;
+} ND_UNALIGNED;
 
 
 /* v_flags values */
@@ -332,22 +332,22 @@ bootp_print(netdissect_options *ndo,
                ND_PRINT(" (0x%04x)", EXTRACT_BE_U_2(bp->bp_flags));
 
        /* Client's ip address */
-       ND_TCHECK(bp->bp_ciaddr);
+       ND_TCHECK_4(&bp->bp_ciaddr);
        if (EXTRACT_IPV4_TO_HOST_ORDER(&bp->bp_ciaddr.s_addr))
                ND_PRINT("\n\t  Client-IP %s", ipaddr_string(ndo, &bp->bp_ciaddr));
 
        /* 'your' ip address (bootp client) */
-       ND_TCHECK(bp->bp_yiaddr);
+       ND_TCHECK_4(&bp->bp_yiaddr);
        if (EXTRACT_IPV4_TO_HOST_ORDER(&bp->bp_yiaddr.s_addr))
                ND_PRINT("\n\t  Your-IP %s", ipaddr_string(ndo, &bp->bp_yiaddr));
 
        /* Server's ip address */
-       ND_TCHECK(bp->bp_siaddr);
+       ND_TCHECK_4(&bp->bp_siaddr);
        if (EXTRACT_IPV4_TO_HOST_ORDER(&bp->bp_siaddr.s_addr))
                ND_PRINT("\n\t  Server-IP %s", ipaddr_string(ndo, &bp->bp_siaddr));
 
        /* Gateway's ip address */
-       ND_TCHECK(bp->bp_giaddr);
+       ND_TCHECK_4(&bp->bp_giaddr);
        if (EXTRACT_IPV4_TO_HOST_ORDER(&bp->bp_giaddr.s_addr))
                ND_PRINT("\n\t  Gateway-IP %s", ipaddr_string(ndo, &bp->bp_giaddr));
 
@@ -1052,7 +1052,7 @@ trunc:
        ND_PRINT("|[rfc1048]");
 }
 
-#define PRINTCMUADDR(m, s) { ND_TCHECK(cmu->m); \
+#define PRINTCMUADDR(m, s) { ND_TCHECK_4(&cmu->m); \
     if (cmu->m.s_addr != 0) \
        ND_PRINT(" %s:%s", s, ipaddr_string(ndo, &cmu->m.s_addr)); }