From fff07c1022643da7274d4ba1b086c9c218762dc9 Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Mon, 8 Jan 2001 20:36:14 +0000 Subject: [PATCH] 665. [bug] Signed responses were not sent when the size of the TSIG + question exceeded the maximum message size. [RT #628] --- CHANGES | 3 +++ bin/named/client.c | 6 +++++- lib/dns/message.c | 7 ++++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index aa06722a1f..67e9561566 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ + 665. [bug] Signed responses were not sent when the size of the + TSIG + question exceeded the maximum message size. + [RT #628] 664. [bug] The t_tasks and t_timers module tests are now skipped when building without threads, since they require diff --git a/bin/named/client.c b/bin/named/client.c index 09790c3573..6ca5e5c4d9 100644 --- a/bin/named/client.c +++ b/bin/named/client.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: client.c,v 1.136 2000/12/19 19:21:39 gson Exp $ */ +/* $Id: client.c,v 1.137 2001/01/08 20:36:10 bwelling Exp $ */ #include @@ -835,6 +835,10 @@ ns_client_send(ns_client_t *client) { } result = dns_message_rendersection(client->message, DNS_SECTION_QUESTION, 0); + if (result == ISC_R_NOSPACE) { + client->message->flags |= DNS_MESSAGEFLAG_TC; + goto renderend; + } if (result != ISC_R_SUCCESS) goto done; result = dns_message_rendersection(client->message, diff --git a/lib/dns/message.c b/lib/dns/message.c index 5e1428a937..b41d9c2e86 100644 --- a/lib/dns/message.c +++ b/lib/dns/message.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: message.c,v 1.168 2001/01/05 00:17:29 bwelling Exp $ */ +/* $Id: message.c,v 1.169 2001/01/08 20:36:11 bwelling Exp $ */ /*** *** Imports @@ -1882,7 +1882,8 @@ dns_message_renderend(dns_message_t *msg) { /* * If we're adding a TSIG or SIG(0) to a truncated message, * clear all rdatasets from the message except for the question - * before adding the TSIG or SIG(0). + * before adding the TSIG or SIG(0). If the question doesn't fit, + * don't include it. */ if ((msg->tsigkey != NULL || msg->sig0key != NULL) && (msg->flags & DNS_MESSAGEFLAG_TC) != 0) @@ -1898,7 +1899,7 @@ dns_message_renderend(dns_message_t *msg) { dns_compress_rollback(&msg->cctx, 0); result = dns_message_rendersection(msg, DNS_SECTION_QUESTION, 0); - if (result != ISC_R_SUCCESS) + if (result != ISC_R_SUCCESS && result != ISC_R_NOSPACE) return (result); }