From 9b0e404e5fc71a2bd4fba8a66296477f815af7d5 Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Mon, 8 Jan 2001 20:50:04 +0000 Subject: [PATCH] 666. [bug] If a request is longer than 512 bytes, send it using TCP. --- CHANGES | 3 +++ bin/dig/dighost.c | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 67e9561566..88e3d771ff 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ + 666. [bug] If a request is longer than 512 bytes, send it using + TCP. + 665. [bug] Signed responses were not sent when the size of the TSIG + question exceeded the maximum message size. [RT #628] diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index 2362897a67..953de5c614 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dighost.c,v 1.176 2001/01/08 19:50:32 bwelling Exp $ */ +/* $Id: dighost.c,v 1.177 2001/01/08 20:50:04 bwelling Exp $ */ /* * Notice to programmers: Do not use this code as an example of how to @@ -1522,6 +1522,12 @@ setup_lookup(dig_lookup_t *lookup) { check_result(result, "dns_message_renderend"); debug("done rendering"); + /* + * Force TCP mode if the request is larger than 512 bytes. + */ + if (isc_buffer_usedlength(&lookup->sendbuf) > 512) + lookup->tcp_mode = ISC_TRUE; + lookup->pending = ISC_FALSE; for (serv = ISC_LIST_HEAD(lookup->my_server_list);