From e0ef63532f82467d7e59e07e5531347ca6982040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20Bal=C3=A1=C5=BEik?= Date: Tue, 26 May 2026 14:57:47 +0200 Subject: [PATCH] Handle large query IDs in xfer/ans5 properly Previously, the server would crash if it received a query with an ID close to 65535 in the badmessageid case, as adding 50 to it would not fit in uint16. This was an oversight in porting it from Perl to Python in f9ed3650acdc2c5b38d8b36729b045ca63f983ef. --- bin/tests/system/xfer/ans5/ans.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/tests/system/xfer/ans5/ans.py b/bin/tests/system/xfer/ans5/ans.py index d26fb926a8..22a74b2ca8 100644 --- a/bin/tests/system/xfer/ans5/ans.py +++ b/bin/tests/system/xfer/ans5/ans.py @@ -154,7 +154,7 @@ class Add50ToMessageIdFromSecondResponse(ResponseHandlerWrapper): assert isinstance( response_action, DnsResponseSend ), "Add50ToMessageIdFromSecondResponse can only wrap handlers that yield DnsResponseSend from the second response onward" - response_action.response.id += 50 + response_action.response.id = (response_action.response.id + 50) % 65536 else: self._first_yielded = True