diff options
author | Jan Hák <jan.hak@nic.cz> | 2024-12-18 11:03:54 +0100 |
---|---|---|
committer | Daniel Salzman <daniel.salzman@nic.cz> | 2024-12-18 13:13:14 +0100 |
commit | 55ce3c48434cb44fdb4447cbe8ffdf765e4b06f5 (patch) | |
tree | ba019a536ff4c232ea36bec32157550438860ed8 | |
parent | utils: use knsupdate style of output when printing UPDATE message (diff) | |
download | knot-55ce3c48434cb44fdb4447cbe8ffdf765e4b06f5.tar.xz knot-55ce3c48434cb44fdb4447cbe8ffdf765e4b06f5.zip |
mod-dnstap: distinguish between AUTH and UPDATE query/response
-rw-r--r-- | src/knot/modules/dnstap/dnstap.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/knot/modules/dnstap/dnstap.c b/src/knot/modules/dnstap/dnstap.c index 612e48869..636b3f88f 100644 --- a/src/knot/modules/dnstap/dnstap.c +++ b/src/knot/modules/dnstap/dnstap.c @@ -83,8 +83,11 @@ static knotd_state_t log_message(knotd_state_t state, const knot_pkt_t *pkt, /* Determine query / response. */ Dnstap__Message__Type msgtype = DNSTAP__MESSAGE__TYPE__AUTH_QUERY; + if (knot_wire_get_opcode(pkt->wire) == KNOT_OPCODE_UPDATE) { + msgtype = DNSTAP__MESSAGE__TYPE__UPDATE_QUERY; + } if (knot_wire_get_qr(pkt->wire)) { - msgtype = DNSTAP__MESSAGE__TYPE__AUTH_RESPONSE; + msgtype++; // NOTE relies on RESPONSE always being an enum+1 of QUERY } /* Create a dnstap message. */ |