Fix uncached CLIENT_RESPONSE'es on stateful transports#208
Merged
wcawijngaards merged 2 commits intomasterfrom Mar 30, 2020
Merged
Conversation
Because repinfo->c->buffer does not contain the response when the it did not came from cache. Only after tcp_req_info_send_reply is called, is the response on the buffer which is used to fill the dnstap protobuf's.
Member
|
No, it may be somewhere else, in a queue. |
Member
|
I think this may be better. Also buffer may no longer be there, because allocated in queue for tcp responses. index 09023838..049c7ff0 100644
--- a/util/netevent.c
+++ b/util/netevent.c
@@ -3157,7 +3157,7 @@ comm_point_send_reply(struct comm_reply *repinfo)
if(repinfo->c->tcp_parent->dtenv != NULL &&
repinfo->c->tcp_parent->dtenv->log_client_response_messages)
dt_msg_send_client_response(repinfo->c->tcp_parent->dtenv,
- &repinfo->addr, repinfo->c->type, repinfo->c->buffer);
+ &repinfo->addr, repinfo->c->type, (repinfo->c->tcp_req_info?repinfo->c->tcp_req_info->spool_buffer:repinfo->c->buffer));
#endif
if(repinfo->c->tcp_req_info) {
tcp_req_info_send_reply(repinfo->c->tcp_req_info); |
When tcp_req_info exists. This fixes that dnstap CLIENT_RESPONSE messages did not contain the response message when answering on statful transport for uncached responses.
Member
Author
|
Yes that works! Thanks! I've done a new commit with your proposed fix. |
Member
|
Okay let's merge it, then. |
Member
Author
|
Do you want me to push the merge button? |
wcawijngaards
added a commit
that referenced
this pull request
Mar 30, 2020
Member
|
Sure! I don't know who should merge, but I just did. Good to have this fixed. |
jedisct1
added a commit
to jedisct1/unbound
that referenced
this pull request
Apr 13, 2020
* nlnet/master: (30 commits) - Merge PR NLnetLabs#214 from gearnode: unbound-control-setup recreate certificates. With the -r option the certificates are created again, without it, only the files that do not exist are created. fix unbound-control-setup is not idempotent - Keep track of number of timeouts. Use this counter to determine if capsforid fallback should be started. - More documentation for redis-expire-records option. - Changes for PR NLnetLabs#206 (formatting and remade lex and yacc output). changed init logic of redis backend as per review request implemented review feedback renamed option from 'redis-set-ttl' to 'redis-expire-records' added option 'redis-set-ttl' to define whether ttl should be added to redis records added check for redis command 'setex' when initializing redis connection updated documentation minor improvements to previous changes - Merge PR NLnetLabs#208: Fix uncached CLIENT_RESPONSE'es on stateful transports. Send tcp_req_info->spool_buffer as dnstap CLIENT_RESPONSE Fix uncached CLIENT_RESPONSE'es on stateful transports nroff fix for dash. - Merge PR NLnetLabs#207: Clarify if-automatic listens on 0.0.0.0 and :: Clarify if-automatic listens on 0.0.0.0 and :: honor 'server_expired_ttl' in redis added logic for redis to honor ttl when serve_expired is not enabled Changelog note for PR NLnetLabs#203. - Merge PR NLnetLabs#203 from noloader: Update README-Travis.md with current procedures. Make unbound-control error returned on missing domain name more user friendly. Update README-Travis.md with current procedures - Fix RPZ concurrency issue when using auth_zone_reload. ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I noticed dnstap CLIENT_RESPONSE did not contain the response sent to the client when:
When investigating the issue, I noticed that repinfo->c->buffer did not contain the response in this case (second half of comm_point_send_reply).
Only after tcp_req_info_send_reply() was called, the the buffer contains the response.
Is it safe to change this order?