From: Wouter Wijngaards Date: Mon, 29 May 2017 14:27:20 +0000 (+0000) Subject: fixup attach_edns check for streamtcp (in case of future enhancements and smaller... X-Git-Tag: release-1.6.4rc1~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75395a12e591c99f39e0f93a25fc4e5f97399000;p=thirdparty%2Funbound.git fixup attach_edns check for streamtcp (in case of future enhancements and smaller buffer sizes). git-svn-id: file:///svn/unbound/trunk@4196 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/testcode/streamtcp.c b/testcode/streamtcp.c index 34b5c0281..f5eb8fc48 100644 --- a/testcode/streamtcp.c +++ b/testcode/streamtcp.c @@ -143,7 +143,9 @@ write_q(int fd, int udp, SSL* ssl, sldns_buffer* buf, uint16_t id, edns.edns_present = 1; edns.bits = EDNS_DO; edns.udp_size = 4096; - attach_edns_record(buf, &edns); + if(sldns_buffer_capacity(buf) >= + sldns_buffer_limit(buf)+calc_edns_field_size(&edns)) + attach_edns_record(buf, &edns); } /* send it */