wks02 WKS 10.0.0.1 17 ( 0 1 2 53 )
wks03 WKS 10.0.0.2 6 ( 65535 )
x2501 X25 "123456789"
+large TXT ( 1234567890 1234567890 1234567890 1234567890
+ 1234567890 1234567890 1234567890 1234567890
+ 1234567890 1234567890 1234567890 1234567890
+ 1234567890 1234567890 1234567890 1234567890
+ 1234567890 1234567890 1234567890 1234567890
+ 1234567890 1234567890 1234567890 1234567890
+ 1234567890 1234567890 1234567890 1234567890
+ 1234567890 1234567890 1234567890 1234567890
+ 1234567890 1234567890 1234567890 1234567890
+ 1234567890 1234567890 1234567890 1234567890
+ 1234567890 1234567890 1234567890 1234567890
+ 1234567890 1234567890 1234567890 1234567890
+ 1234567890 1234567890 1234567890 1234567890
+ 1234567890 1234567890 1234567890 1234567890
+ 1234567890 1234567890 1234567890 1234567890
+ 1234567890 1234567890 1234567890 1234567890
+ 1234567890 1234567890 1234567890 1234567890 )
echo "I: failed"; status=1
fi
+echo "I:checking both OPT and TSIG records are returned when TC=1"
+ret=0
+$DIG +ignore +bufsize=512 large.example.nil \
+ -y "hmac-sha1:sha1:$sha1" @10.53.0.1 txt -p 5300 > dig.out.large 2>&1 || ret=1
+grep "flags:.* tc[ ;]" dig.out.large > /dev/null || ret=1
+grep "status: NOERROR" dig.out.large > /dev/null || ret=1
+grep "EDNS:" dig.out.large > /dev/null || ret=1
+grep -i "sha1.*TSIG.*NOERROR" dig.out.sha1 > /dev/null || ret=1
+if [ $ret -eq 1 ] ; then
+ echo "I: failed"; status=1
+fi
exit $status
return (DNS_R_FORMERR);
}
+ /*
+ * If we're adding a OPT, TSIG or SIG(0) to a truncated message,
+ * clear all rdatasets from the message except for the question
+ * before adding the OPT, TSIG or SIG(0). If the question doesn't
+ * fit, don't include it.
+ */
+ if ((msg->tsigkey != NULL || msg->sig0key != NULL || msg->opt) &&
+ (msg->flags & DNS_MESSAGEFLAG_TC) != 0)
+ {
+ isc_buffer_t *buf;
+
+ msgresetnames(msg, DNS_SECTION_ANSWER);
+ buf = msg->buffer;
+ dns_message_renderreset(msg);
+ msg->buffer = buf;
+ isc_buffer_clear(msg->buffer);
+ isc_buffer_add(msg->buffer, DNS_MESSAGE_HEADERLEN);
+ dns_compress_rollback(msg->cctx, 0);
+ result = dns_message_rendersection(msg, DNS_SECTION_QUESTION,
+ 0);
+ if (result != ISC_R_SUCCESS && result != ISC_R_NOSPACE)
+ return (result);
+ }
+
/*
* If we've got an OPT record, render it.
*/
return (result);
}
- /*
- * 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). If the question doesn't fit,
- * don't include it.
- */
- if ((msg->tsigkey != NULL || msg->sig0key != NULL) &&
- (msg->flags & DNS_MESSAGEFLAG_TC) != 0)
- {
- isc_buffer_t *buf;
-
- msgresetnames(msg, DNS_SECTION_ANSWER);
- buf = msg->buffer;
- dns_message_renderreset(msg);
- msg->buffer = buf;
- isc_buffer_clear(msg->buffer);
- isc_buffer_add(msg->buffer, DNS_MESSAGE_HEADERLEN);
- dns_compress_rollback(msg->cctx, 0);
- result = dns_message_rendersection(msg, DNS_SECTION_QUESTION,
- 0);
- if (result != ISC_R_SUCCESS && result != ISC_R_NOSPACE)
- return (result);
- }
-
/*
* If we're adding a TSIG record, generate and render it.
*/
if (buf != NULL)
isc_mem_put(mctx, buf, len);
}
-