summaryrefslogtreecommitdiff
path: root/src/libs6dns
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2024-06-17 20:20:09 +0000
committerLaurent Bercot <ska@appnovation.com>2024-06-17 20:20:09 +0000
commitea9f0d8f2853b512e841ef2d6ca2afa3792616b8 (patch)
treeacb69c84801470df5a258d2259c775a55acd0e2f /src/libs6dns
parent9fcf7ce4fe48fb60be5fa8deaaa43bd0d1574cb7 (diff)
downloads6-dns-ea9f0d8f2853b512e841ef2d6ca2afa3792616b8.tar.xz
Add packet dump in post-received debug primitive
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/libs6dns')
-rw-r--r--src/libs6dns/s6dns_debug_dumpdt_post_recv.c5
1 files changed, 4 insertions, 1 deletions
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 <skalibs/genwrite.h>
+
+#include <s6-dns/s6dns-analyze.h>
#include <s6-dns/s6dns-debug.h>
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) ;
}