Commit 28166a23 authored by Alexandre's avatar Alexandre
Browse files

[DoT] Do not raise exception on false message id

parent 6a3639bc
......@@ -223,10 +223,15 @@ class Request:
class RequestDoT(Request):
def check_response(self):
ok = self.ok
if not self.rcode:
return
self.ok = False
return False
if self.response.id != self.message.id:
raise Exception("The ID in the answer does not match the one in the query")
self.response = "The ID in the answer does not match the one in the query"
self.ok = False
return False
return self.ok
class RequestDoH(Request):
......@@ -578,7 +583,7 @@ def print_result(connection, request, prefix=None, display_err=True):
ok = False
print("%s Cannot find \"%s\" in response" % (server, expect))
sys.exit(STATE_CRITICAL)
if size is not None and size > 0:
if ok and size is not None and size > 0:
print("%s OK - %s" % (server, "No error for %s/%s, %i bytes received" % (name, rtype, size)))
else:
print("%s OK - %s" % (server, "No error"))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment