From: W.C.A. Wijngaards Date: Tue, 5 Dec 2023 12:14:08 +0000 (+0100) Subject: - Fix dnstap that assertion failed on logging other than UDP and TCP X-Git-Tag: release-1.19.3rc1~61 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d8bd9845cc116ab4559a338e3d9e42049f3cb268;p=thirdparty%2Funbound.git - Fix dnstap that assertion failed on logging other than UDP and TCP traffic. It lists it as TCP traffic. --- diff --git a/dnstap/dnstap.c b/dnstap/dnstap.c index d15eb9b00..d9cdf7cea 100644 --- a/dnstap/dnstap.c +++ b/dnstap/dnstap.c @@ -371,7 +371,6 @@ dt_msg_fill_net(struct dt_msg *dm, *has_rport = 1; } - log_assert(cptype == comm_udp || cptype == comm_tcp); if (cptype == comm_udp) { /* socket_protocol */ dm->m.socket_protocol = DNSTAP__SOCKET_PROTOCOL__UDP; @@ -380,6 +379,10 @@ dt_msg_fill_net(struct dt_msg *dm, /* socket_protocol */ dm->m.socket_protocol = DNSTAP__SOCKET_PROTOCOL__TCP; dm->m.has_socket_protocol = 1; + } else { + /* other socket protocol */ + dm->m.socket_protocol = DNSTAP__SOCKET_PROTOCOL__TCP; + dm->m.has_socket_protocol = 1; } } @@ -410,7 +413,6 @@ dt_msg_send_client_query(struct dt_env *env, dt_fill_buffer(qmsg, &dm.m.query_message, &dm.m.has_query_message); /* socket_family, socket_protocol, query_address, query_port, response_address, response_port */ - log_assert(cptype == comm_udp || cptype == comm_tcp); dt_msg_fill_net(&dm, qsock, rsock, cptype, &dm.m.query_address, &dm.m.has_query_address, &dm.m.query_port, &dm.m.has_query_port, @@ -446,7 +448,6 @@ dt_msg_send_client_response(struct dt_env *env, dt_fill_buffer(rmsg, &dm.m.response_message, &dm.m.has_response_message); /* socket_family, socket_protocol, query_address, query_port, response_address, response_port */ - log_assert(cptype == comm_udp || cptype == comm_tcp); dt_msg_fill_net(&dm, qsock, rsock, cptype, &dm.m.query_address, &dm.m.has_query_address, &dm.m.query_port, &dm.m.has_query_port, @@ -497,7 +498,6 @@ dt_msg_send_outside_query(struct dt_env *env, dt_fill_buffer(qmsg, &dm.m.query_message, &dm.m.has_query_message); /* socket_family, socket_protocol, response_address, response_port, query_address, query_port */ - log_assert(cptype == comm_udp || cptype == comm_tcp); dt_msg_fill_net(&dm, rsock, qsock, cptype, &dm.m.response_address, &dm.m.has_response_address, &dm.m.response_port, &dm.m.has_response_port, @@ -556,7 +556,6 @@ dt_msg_send_outside_response(struct dt_env *env, dt_fill_buffer(rmsg, &dm.m.response_message, &dm.m.has_response_message); /* socket_family, socket_protocol, response_address, response_port, query_address, query_port */ - log_assert(cptype == comm_udp || cptype == comm_tcp); dt_msg_fill_net(&dm, rsock, qsock, cptype, &dm.m.response_address, &dm.m.has_response_address, &dm.m.response_port, &dm.m.has_response_port, diff --git a/doc/Changelog b/doc/Changelog index f42d19837..f6aa9ab6c 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,6 +1,8 @@ 5 December 2023: Wouter - Merge #971: fix 'WARNING: Message has 41 extra bytes at end'. - Fix #969: [FR] distinguish Do53, DoT and DoH in the logs. + - Fix dnstap that assertion failed on logging other than UDP and TCP + traffic. It lists it as TCP traffic. 27 November 2023: Yorgos - Merge #968: Replace the obsolescent fgrep with grep -F in tests.