]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-lwres.c
DNS: Sync types with IANA
[tcpdump] / print-lwres.c
index 2518823bc3e1a3164e237c8e7734b3ecb17b4783..b8fc6234237654a45d0e604d721078771182debc 100644 (file)
@@ -35,9 +35,6 @@
 
 #include "netdissect-stdinc.h"
 
-#include <stdio.h>
-#include <string.h>
-
 #define ND_LONGJMP_FROM_TCHECK
 #include "netdissect.h"
 #include "addrtoname.h"
@@ -97,7 +94,7 @@ typedef struct lwres_addr lwres_addr_t;
 struct lwres_addr {
        nd_uint32_t                     family;
        nd_uint16_t                     length;
-       /* address folows */
+       /* address follows */
 };
 #define LWRES_ADDR_LEN                 6
 
@@ -194,7 +191,7 @@ extern const struct tok ns_class2str[];
 
 static unsigned
 lwres_printname(netdissect_options *ndo,
-                size_t l, const u_char *p0)
+                u_int l, const u_char *p0)
 {
        ND_PRINT(" ");
        (void)nd_printn(ndo, p0, l, NULL);
@@ -549,7 +546,7 @@ lwres_print(netdissect_options *ndo,
                ND_PRINT(" [len: %u != %u]", GET_BE_U_4(np->length),
                          length);
        }
-       if (!unsupported && s < bp + GET_BE_U_4(np->length))
+       if (!unsupported && ND_BYTES_BETWEEN(s, bp) < GET_BE_U_4(np->length))
                ND_PRINT("[extra]");
        return;