Skip to content

Commit 16ee7cf

Browse files
committed
- Fix for print of connection type in log-replies for dot and doh.
1 parent 38026a2 commit 16ee7cf

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

daemon/worker.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2055,13 +2055,13 @@ worker_handle_request(struct comm_point* c, void* arg, int error,
20552055
&repinfo->client_addr, repinfo->client_addrlen,
20562056
tv, 1, c->buffer,
20572057
(worker->env.cfg->log_destaddr?(void*)repinfo->c->socket->addr:NULL),
2058-
c->type);
2058+
c->type, c->ssl);
20592059
} else {
20602060
log_reply_info(NO_VERBOSE, &qinfo,
20612061
&repinfo->client_addr, repinfo->client_addrlen,
20622062
tv, 1, c->buffer,
20632063
(worker->env.cfg->log_destaddr?(void*)repinfo->c->socket->addr:NULL),
2064-
c->type);
2064+
c->type, c->ssl);
20652065
}
20662066
}
20672067
#ifdef USE_DNSCRYPT

doc/Changelog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
10 April 2025: Wouter
2+
- Fix for print of connection type in log-replies for dot and doh.
3+
14
9 April 2025: Wouter
25
- Fix to detect if atomic_store links in configure.
36
- Fix #1264: unbound 1.22.0 leaks memory when doing DoH.

services/mesh.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1579,7 +1579,7 @@ mesh_send_reply(struct mesh_state* m, int rcode, struct reply_info* rep,
15791579
&r->query_reply.client_addr,
15801580
r->query_reply.client_addrlen, duration, 0, r_buffer,
15811581
(m->s.env->cfg->log_destaddr?(void*)r->query_reply.c->socket->addr:NULL),
1582-
r->query_reply.c->type);
1582+
r->query_reply.c->type, r->query_reply.c->ssl);
15831583
}
15841584
}
15851585

util/data/msgreply.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ void
965965
log_reply_info(enum verbosity_value v, struct query_info *qinf,
966966
struct sockaddr_storage *addr, socklen_t addrlen, struct timeval dur,
967967
int cached, struct sldns_buffer *rmsg, struct sockaddr_storage* daddr,
968-
enum comm_point_type tp)
968+
enum comm_point_type tp, void* ssl)
969969
{
970970
char clientip_buf[128];
971971
char rcode_buf[16];
@@ -1000,9 +1000,9 @@ log_reply_info(enum verbosity_value v, struct query_info *qinf,
10001000
(int)daddr->ss_family);
10011001
}
10021002
comm = "udp";
1003-
if(tp == comm_tcp) comm = "tcp";
1004-
else if(tp == comm_tcp_accept) comm = "tcp";
1005-
else if(tp == comm_http) comm = "dot";
1003+
if(tp == comm_tcp) comm = (ssl?"dot":"tcp");
1004+
else if(tp == comm_tcp_accept) comm = (ssl?"dot":"tcp");
1005+
else if(tp == comm_http) comm = "doh";
10061006
else if(tp == comm_local) comm = "unix";
10071007
else if(tp == comm_raw) comm = "raw";
10081008
snprintf(dest_buf, sizeof(dest_buf), " on %s %s %d",

util/data/msgreply.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,11 +554,13 @@ void log_dns_msg(const char* str, struct query_info* qinfo,
554554
* @param rmsg: sldns buffer packet.
555555
* @param daddr: if not NULL, the destination address and port are logged.
556556
* @param tp: type of the comm point for logging destination connection type.
557+
* @param ssl: the SSL pointer of the connection, to see if the connection
558+
* type is tcp or dot.
557559
*/
558560
void log_reply_info(enum verbosity_value v, struct query_info *qinf,
559561
struct sockaddr_storage *addr, socklen_t addrlen, struct timeval dur,
560562
int cached, struct sldns_buffer *rmsg, struct sockaddr_storage* daddr,
561-
enum comm_point_type tp);
563+
enum comm_point_type tp, void* ssl);
562564

563565
/**
564566
* Print string with neat domain name, type, class from query info.

0 commit comments

Comments
 (0)