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

SimpleResolver fails when UPDATE response has ZOCOUNT equals to 0. #322

Open
javier-godoy opened this issue Apr 20, 2024 · 0 comments
Open

Comments

@javier-godoy
Copy link

In dnsjava 3.5.3, sending DDNS update to a server that returns NOTIMP with ZOCOUNT=0 results in NPE at SimpleResolver:406 because response.getQuestion() is null. #277 "fixes" that by considering the case an "invalid message", but that interpretation is not consistent with Section 3.8 of RFC 2136:

A response message is generated by copying the ID and Opcode fields from the request, and either copying the ZOCOUNT, PRCOUNT, UPCOUNT, and ADCOUNT fields and associated sections, or placing zeros (0) in the these "count" fields and not including any part of the original update

if (!query.getQuestion().getName().equals(response.getQuestion().getName())) {

if (response.getQuestion() == null) {
f.completeExceptionally(
new WireParseException("invalid message: question section missing"));
return f;
}

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

No branches or pull requests

1 participant