Commit c8752da04c for bind
commit c8752da04c139854b980975128819627ce416fcc
Author: Michal Nowak <mnowak@isc.org>
Date: Fri Oct 9 15:30:57 2026 +0000
Let dnspython prepend the TCP length to rendered queries
Since dnspython 2.5.0, Message.to_wire(prepend_length=True) renders a
message with its two-octet length prefix for TCP and TLS, so the tests
that send a query over a raw stream no longer have to pack the length
themselves.
Assisted-by: Claude:claude-opus-5-5
diff --git a/bin/tests/system/doth/tests_gnutls.py b/bin/tests/system/doth/tests_gnutls.py
index dda956946c..0b38269e78 100644
--- a/bin/tests/system/doth/tests_gnutls.py
+++ b/bin/tests/system/doth/tests_gnutls.py
@@ -10,7 +10,6 @@
# information regarding copyright ownership.
import selectors
-import struct
import subprocess
import time
@@ -42,8 +41,7 @@ pytestmark = [
def test_gnutls_cli_query(gnutls_cli_executable, named_tlsport):
# Prepare the example/SOA query which will be sent over TLS.
query = isctest.query.create("example.", dns.rdatatype.SOA)
- query_wire = query.to_wire()
- query_with_length = struct.pack(">H", len(query_wire)) + query_wire
+ query_with_length = query.to_wire(prepend_length=True)
# Run gnutls-cli.
gnutls_cli_args = [
diff --git a/bin/tests/system/tsiggss/tests_gss_context.py b/bin/tests/system/tsiggss/tests_gss_context.py
index bc311fb80b..04732a6468 100644
--- a/bin/tests/system/tsiggss/tests_gss_context.py
+++ b/bin/tests/system/tsiggss/tests_gss_context.py
@@ -85,9 +85,9 @@ def establish(ns1, monkeypatch):
token,
)
query.additional.append(dns.rrset.from_rdata(name, 0, tkey))
- wire = query.to_wire()
+ wire = query.to_wire(prepend_length=True)
with socket.create_connection((ns1.ip, ns1.ports.dns), timeout=5) as sock:
- sock.sendall(struct.pack("!H", len(wire)) + wire)
+ sock.sendall(wire)
size = struct.unpack("!H", read_exact(sock, 2))[0]
response_wire = read_exact(sock, size)
response = dns.message.from_wire(response_wire, keyring=False)