/* \summary: BIND9 Lightweight Resolver protocol printer */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "netdissect-stdinc.h"
{ LWRES_OPCODE_GETADDRSBYNAME, "getaddrsbyname", },
{ LWRES_OPCODE_GETNAMEBYADDR, "getnamebyaddr", },
{ LWRES_OPCODE_GETRDATABYNAME, "getrdatabyname", },
- { 0, NULL, },
+ { 0, NULL, },
};
/* print-domain.c */
static unsigned
lwres_printname(netdissect_options *ndo,
- size_t l, const u_char *p0)
+ u_int l, const u_char *p0)
{
ND_PRINT(" ");
nd_printjn(ndo, p0, l);
}
}
- return ND_BYTES_BETWEEN(p, p0);
+ return ND_BYTES_BETWEEN(p0, p);
}
void
if (ndo->ndo_vflag || v != LWRES_LWPACKETVERSION_0)
ND_PRINT(" v%u", v);
if (v != LWRES_LWPACKETVERSION_0) {
- s = bp + GET_BE_U_4(np->length);
+ uint32_t pkt_len = GET_BE_U_4(np->length);
+ ND_TCHECK_LEN(bp, pkt_len);
+ s = bp + pkt_len;
goto tail;
}
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(bp, s) < GET_BE_U_4(np->length))
ND_PRINT("[extra]");
return;