edfbb2
commit b8b53b338f6da91e86d115a39da860cefac736ad
edfbb2
Author: Florian Weimer <fweimer@redhat.com>
edfbb2
Date:   Thu Oct 15 12:33:13 2020 +0200
edfbb2
edfbb2
    resolv: Serialize processing in resolv/tst-resolv-txnid-collision
edfbb2
    
edfbb2
    When switching name servers, response processing by two server
edfbb2
    threads clobbers the global test state.  (There is still some
edfbb2
    risk that this test is negatively impact by packet drops and
edfbb2
    packet reordering, but this applies to many of the resolver tests
edfbb2
    and is difficult to avoid.)
edfbb2
    
edfbb2
    Fixes commit f1f00c072138af90ae6da180f260111f09afe7a3 ("resolv:
edfbb2
    Handle transaction ID collisions in parallel queries (bug 26600)").
edfbb2
edfbb2
diff --git a/resolv/tst-resolv-txnid-collision.c b/resolv/tst-resolv-txnid-collision.c
edfbb2
index 611d37362f3e5e89..189b76f1268f4e4d 100644
edfbb2
--- a/resolv/tst-resolv-txnid-collision.c
edfbb2
+++ b/resolv/tst-resolv-txnid-collision.c
edfbb2
@@ -309,6 +309,11 @@ do_test (void)
edfbb2
     ((struct resolv_redirect_config)
edfbb2
      {
edfbb2
        .response_callback = response,
edfbb2
+
edfbb2
+       /* The response callback use global state (the previous_*
edfbb2
+          variables), and query processing must therefore be
edfbb2
+          serialized.  */
edfbb2
+       .single_thread_udp = true,
edfbb2
      });
edfbb2
 
edfbb2
   for (int rcode = 0; rcode <= 5; ++rcode)