resolved: don't choke on NULL DNS transactions when determining query candidate state
authorLennart Poettering <lennart@poettering.net>
Mon, 14 Dec 2015 20:21:59 +0000 (21:21 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 14 Dec 2015 20:28:39 +0000 (21:28 +0100)
src/resolve/resolved-dns-query.c

index a6565f2..405882a 100644 (file)
@@ -185,6 +185,14 @@ static DnsTransactionState dns_query_candidate_state(DnsQueryCandidate *c) {
 
                 switch (t->state) {
 
+                case DNS_TRANSACTION_NULL:
+                        /* If there's a NULL transaction pending, then
+                         * this means not all transactions where
+                         * started yet, and we were called from within
+                         * the stackframe that is supposed to start
+                         * remaining transactions. In this case,
+                         * simply claim the candidate is pending. */
+
                 case DNS_TRANSACTION_PENDING:
                 case DNS_TRANSACTION_VALIDATING:
                         /* If there's one transaction currently in
@@ -197,9 +205,6 @@ static DnsTransactionState dns_query_candidate_state(DnsQueryCandidate *c) {
                         state = t->state;
                         break;
 
-                case DNS_TRANSACTION_NULL:
-                        assert_not_reached("Transaction not started?");
-
                 default:
                         if (state != DNS_TRANSACTION_SUCCESS)
                                 state = t->state;