]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix for #367: only attempt to get the interface for queries
authorGeorge Thessalonikefs <george@nlnetlabs.nl>
Tue, 4 May 2021 12:45:01 +0000 (14:45 +0200)
committerGeorge Thessalonikefs <george@nlnetlabs.nl>
Tue, 4 May 2021 12:45:01 +0000 (14:45 +0200)
  that are no longer on the tcp_waiting_list.

doc/Changelog
services/outside_network.c

index ac80f79b52aa1975067fe0ee9f68bd3e4d6baca8..6edbcf9692eae5835354a7da8aea2ca404752fa3 100644 (file)
@@ -1,3 +1,7 @@
+4 May 2021: George
+       - Fix for #367: only attempt to get the interface for queries that are no
+         longer on the tcp_waiting_list.
+
 4 May 2021: Wouter
        - Merge #478: Allow configuration of TCP timeout while waiting for
          response.
index 5fb4f3faa746a5d38a3245738a480ad2db789e0d..a1c18c6171847106f96fce38097b7b12b219b9d3 100644 (file)
@@ -2783,8 +2783,12 @@ serviced_tcp_callback(struct comm_point* c, void* arg, int error,
        struct comm_reply r2;
 #ifdef USE_DNSTAP
        struct waiting_tcp* w = (struct waiting_tcp*)sq->pending;
-       struct pending_tcp* pend_tcp = (struct pending_tcp*)w->next_waiting;
-       struct port_if* pi = pend_tcp->pi;
+       struct pending_tcp* pend_tcp = NULL;
+       struct port_if* pi = NULL;
+       if(!w->on_tcp_waiting_list && w->next_waiting) {
+               pend_tcp = (struct pending_tcp*)w->next_waiting;
+               pi = pend_tcp->pi;
+       }
 #endif
        sq->pending = NULL; /* removed after this callback */
        if(error != NETEVENT_NOERROR)
@@ -2797,7 +2801,7 @@ serviced_tcp_callback(struct comm_point* c, void* arg, int error,
        /*
         * sending src (local service)/dst (upstream) addresses over DNSTAP
         */
-       if(error==NETEVENT_NOERROR && sq->outnet->dtenv &&
+       if(error==NETEVENT_NOERROR && pi && sq->outnet->dtenv &&
           (sq->outnet->dtenv->log_resolver_response_messages ||
            sq->outnet->dtenv->log_forwarder_response_messages)) {
                log_addr(VERB_ALGO, "response from upstream", &sq->addr, sq->addrlen);