]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix that multiple dns fragments can be carried in one TLS frame.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 21 Jan 2019 13:41:13 +0000 (13:41 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 21 Jan 2019 13:41:13 +0000 (13:41 +0000)
git-svn-id: file:///svn/unbound/trunk@5043 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
services/listen_dnsport.c
services/listen_dnsport.h
util/netevent.c

index 24510fe5b967ffd64a6a23856e9e90e27241bdc4..692e3c57b83ba592a5cac2cf236695a10497fa1e 100644 (file)
@@ -2,6 +2,7 @@
        - Fix tcp idle timeout test, for difference in the tcp reply code.
        - Unit test for tcp request reorder and timeouts.
        - Unit tests for ssl out of order processing.
+       - Fix that multiple dns fragments can be carried in one TLS frame.
 
 17 January 2018: Wouter
        - For caps-for-id fallback, use the whitelist to avoid timeout
index 711319e16747982fdfb917470b914bde791451ff..4c67c46a699950e76e75c97aace4226e355455d1 100644 (file)
@@ -1620,6 +1620,10 @@ tcp_req_info_setup_listen(struct tcp_req_info* req)
                req->cp->tcp_is_reading = 1;
                comm_point_start_listening(req->cp, -1,
                        req->cp->tcp_timeout_msec);
+               /* and also read it (from SSL stack buffers), so
+                * no event read event is expected since the remainder of
+                * the TLS frame is sitting in the buffers. */
+               req->read_again = 1;
        } else {
                comm_point_start_listening(req->cp, -1,
                        req->cp->tcp_timeout_msec);
index 07cb64d17919d60e13e1c9a96fff185d793b4351..ff695495c29825052c68932238cb49ad35817530 100644 (file)
@@ -258,6 +258,8 @@ struct tcp_req_info {
        int is_reply;
        /** read channel has closed, just write pending results */
        int read_is_closed;
+       /** read again */
+       int read_again;
        /** number of outstanding requests */
        int num_open_req;
        /** list of outstanding requests */
index 58c65220ad67b32c59de53a32af3d736f48822b6..52c65eb40996fd5c0280657dbb0e95ff045d02f7 100644 (file)
@@ -1353,6 +1353,17 @@ ssl_handle_write(struct comm_point* c)
 static int
 ssl_handle_it(struct comm_point* c)
 {
+       if(c->tcp_req_info) {
+               do {
+                       int r;
+                       c->tcp_req_info->read_again = 0;
+                       if(c->tcp_is_reading)
+                               r = ssl_handle_read(c);
+                       else r = ssl_handle_write(c);
+                       if(!r) return r;
+               } while (c->tcp_req_info->read_again);
+               return 1;
+       }
        if(c->tcp_is_reading)
                return ssl_handle_read(c);
        return ssl_handle_write(c);