Reset keepalive per new tcp session #562
Merged
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.
Before, if edns-tcp-keepalive was configured, it was not sent along in responses unless a client on a TCP (or TLS) session signaled support for it, but then the options was sent along in responses to all clients using TCP (or TLS), also to the clients that did not signal support by sending a initial query with the option if they would reuse the internal comm_point for the TCP session.
Although according to RFC7828 Section 3.3.2. a server does not need an initial query with keepalive option to sent along the option in responses, it is peculiar that a random client was needed to sent the option for unbound to start sending along the option on all responses (on TCP sessions that reused that comm_point). Clearly the intention was to sent along the option in responses only to those clients that signaled support by sending an initial query with the option. This PR makes it behave just like that.