Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a panic in handling forwarded queries #1125

Merged
merged 1 commit into from
Apr 22, 2016
Merged

Fix a panic in handling forwarded queries #1125

merged 1 commit into from
Apr 22, 2016

Conversation

sanimej
Copy link

@sanimej sanimej commented Apr 18, 2016

Fixes #1117
Related to docker/docker #22081

Signed-off-by: Santhosh Manohar santhosh@docker.com

Signed-off-by: Santhosh Manohar <santhosh@docker.com>
@@ -388,7 +391,7 @@ func (r *resolver) ServeDNS(w dns.ResponseWriter, query *dns.Msg) {

// forwardQueryStart stores required context to mux multiple client queries over
// one connection; and limits the number of outstanding concurrent queries.
if r.forwardQueryStart(w, query) == false {
if r.forwardQueryStart(w, query, queryID) == false {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The passed query contains the ID. And queryID seems to initialized to query.ID above so I don't understand the need to pass it separately. What is it fixing?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forwardQueryStart() changes the ID in the query to the one allocated by embedded Server. After sending the query to a first resolver if it timesout or gets a response but couldn't retrieve the context we continue and send it to the next resolver. When doing that the ID we have to save is the one that we got from the client and not the one in the current query because its the changed value.

@mavenugo
Copy link
Contributor

LGTM

1 similar comment
@mrjana
Copy link
Contributor

mrjana commented Apr 22, 2016

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants