diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:52:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:52:31 +0000 |
commit | 31cd589d20ba8d3d6b3fc4fccacc40d38a163c5d (patch) | |
tree | 99d6c086833d530e5d1d33a8128961f8149843f0 /print-lwres.c | |
parent | Adding upstream version 4.99.4. (diff) | |
download | tcpdump-ddb52baf9b7e43d90d652aef109200fa63ba0497.tar.xz tcpdump-ddb52baf9b7e43d90d652aef109200fa63ba0497.zip |
Adding upstream version 4.99.5.upstream/4.99.5upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'print-lwres.c')
-rw-r--r-- | print-lwres.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/print-lwres.c b/print-lwres.c index 97f176c..4e4ae6d 100644 --- a/print-lwres.c +++ b/print-lwres.c @@ -29,9 +29,7 @@ /* \summary: BIND9 Lightweight Resolver protocol printer */ -#ifdef HAVE_CONFIG_H #include <config.h> -#endif #include "netdissect-stdinc.h" @@ -267,7 +265,7 @@ lwres_printaddr(netdissect_options *ndo, } } - return ND_BYTES_BETWEEN(p, p0); + return ND_BYTES_BETWEEN(p0, p); } void @@ -291,7 +289,9 @@ lwres_print(netdissect_options *ndo, 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; } @@ -546,7 +546,7 @@ lwres_print(netdissect_options *ndo, ND_PRINT(" [len: %u != %u]", GET_BE_U_4(np->length), length); } - if (!unsupported && ND_BYTES_BETWEEN(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; |