From ea9f0d8f2853b512e841ef2d6ca2afa3792616b8 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 17 Jun 2024 20:20:09 +0000 Subject: Add packet dump in post-received debug primitive Signed-off-by: Laurent Bercot --- src/libs6dns/s6dns_debug_dumpdt_post_recv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/libs6dns') diff --git a/src/libs6dns/s6dns_debug_dumpdt_post_recv.c b/src/libs6dns/s6dns_debug_dumpdt_post_recv.c index 8e64953..bde1411 100644 --- a/src/libs6dns/s6dns_debug_dumpdt_post_recv.c +++ b/src/libs6dns/s6dns_debug_dumpdt_post_recv.c @@ -1,13 +1,16 @@ /* ISC license */ #include + +#include #include int s6dns_debug_dumpdt_post_recv (s6dns_engine_t const *dt, void *data) { genwrite *gp = data ; (void)dt ; - if ((*gp->put)(gp->target, "Received a packet\n", 19) < 19) return 0 ; + if ((*gp->put)(gp->target, "Received a packet:\n", 19) < 19) return 0 ; + if (!s6dns_analyze_packet(gp, dt->sa.s + dt->querylen, dt->sa.len - dt->querylen, 1)) return 0 ; if ((*gp->put)(gp->target, "\n", 1) < 1) return 0 ; return (*gp->flush)(gp->target) ; } -- cgit v1.2.3