dns_resolver::util::nameserver

Function response_matches_request

Source
fn response_matches_request(request: &Message, response: &Message) -> bool
Expand description

Very basic validation that a nameserver response matches a message:

  • Check the ID, opcode, and questions match the question.

  • Check it is a response.

  • Check the response code is either NoError or NameError.

  • Check it is not truncated.