about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2024-10-04 13:39:33 +0000
committerLaurent Bercot <ska@appnovation.com>2024-10-04 13:39:33 +0000
commit6fbe5f610abf1dada9f94672643d5fc6c01d4cfc (patch)
tree132e7dd4bad25f538fed2b8e052ab7f6ea8a2afa
parent7019310a94d0661fabc09b1558f6cdfcce7fcc3b (diff)
downloadshibari-6fbe5f610abf1dada9f94672643d5fc6c01d4cfc.tar.gz
shibari-6fbe5f610abf1dada9f94672643d5fc6c01d4cfc.tar.xz
shibari-6fbe5f610abf1dada9f94672643d5fc6c01d4cfc.zip
server: don't log answers to unloggable bogus queries
Signed-off-by: Laurent Bercot <ska@appnovation.com>
-rw-r--r--src/server/shibari-server-tcp.c2
-rw-r--r--src/server/shibari-server-udp.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/server/shibari-server-tcp.c b/src/server/shibari-server-tcp.c
index cd35a9e..9511498 100644
--- a/src/server/shibari-server-tcp.c
+++ b/src/server/shibari-server-tcp.c
@@ -161,7 +161,7 @@ int main (int argc, char const *const *argv)
       pkt.hdr.rcode = rcode ;
       shibari_packet_end(&pkt) ;
     }
-    shibari_log_answer(verbosity, &pkt.hdr, pkt.pos) ;
+    if (rcode != 4 && rcode != 1) shibari_log_answer(verbosity, &pkt.hdr, pkt.pos) ;
     if (!buffer_timed_put_g(buffer_1, buf, pkt.pos + 2, &deadline)
      || !buffer_timed_flush_g(buffer_1, &deadline))
       strerr_diefu1sys(111, "write to stdout") ;
diff --git a/src/server/shibari-server-udp.c b/src/server/shibari-server-udp.c
index 0a723ea..62472a7 100644
--- a/src/server/shibari-server-udp.c
+++ b/src/server/shibari-server-udp.c
@@ -237,7 +237,7 @@ int main (int argc, char const *const *argv)
       pkt.hdr.rcode = rcode ;
       shibari_packet_end(&pkt) ;
     }
-    shibari_log_answer(verbosity, &pkt.hdr, pkt.pos) ;
+    if (rcode != 1 && rcode != 4) shibari_log_answer(verbosity, &pkt.hdr, pkt.pos) ;
     tain_add_g(&wstamp, &wtto) ;
     if (socket_sendnb46_g(x[1].fd, buf, pkt.pos, &remoteip, remoteport, &wstamp) < pkt.pos && verbosity)
       strerr_warnwu1sys("send answer") ;