Commit d40154ca authored by Evan Hunt's avatar Evan Hunt

[master] cacluate TCP packet sizes correctly

4296.	[bug]		TCP packet sizes were calculated incorrectly in the
			stats channel; they could be counted in the wrong
			histogram bucket. [RT #40587]
parent 2879ee2c
4296. [bug] TCP packet sizes were calculated incorrectly in the
stats channel; they could be counted in the wrong
histogram bucket. [RT #40587]
4295. [bug] An unchecked result in dns_message_pseudosectiontotext()
could allow incorrect text formatting of EDNS EXPIRE
options. [RT #41437]
......
......@@ -1166,7 +1166,8 @@ client_send(ns_client_t *client) {
isc_buffer_putuint16(&tcpbuffer, (isc_uint16_t) r.length);
isc_buffer_add(&tcpbuffer, r.length);
respsize = isc_buffer_usedlength(&tcpbuffer);
/* don't count the 2-octet length header */
respsize = isc_buffer_usedlength(&tcpbuffer) - 2;
result = client_sendpkg(client, &tcpbuffer);
#ifdef HAVE_DNSTAP
......@@ -2145,6 +2146,9 @@ client_request(isc_task_t *task, isc_event_t *event) {
}
reqsize = isc_buffer_usedlength(buffer);
/* don't count the length header */
if (TCP_CLIENT(client))
reqsize -= 2;
if (exit_check(client))
goto cleanup;
......
tcp request-size 16-31: 1
tcp request-size 48-63: 1
tcp response-size 128-143: 1
tcp response-size 112-127: 1
tcp response-size 64-79: 1
udp request-size 48-63: 2
udp response-size 112-127: 1
......
tcp request-size 16-31: 1
tcp request-size 48-63: 2
tcp response-size 128-143: 1
tcp response-size 112-127: 1
tcp response-size 64-79: 1
tcp response-size 848-863: 1
udp request-size 48-63: 2
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment