Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-3628

Non TXT/SRV records returned by res_nsearch are not filtered out

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.17.0-beta2, 1.17.0
    • Affects Version/s: None
    • Component/s: network, uri
    • None

      Similar to CDRIVER-2789, I observed that CNAME records could be returned by res_nsearch. I discovered this by accident when testing SRV polling but forgetting to override my DNS. Connecting to this URI:

      mongodb+srv://server.mongodb.com/?tls=true&tlsinsecure=true&heartbeatFrequencyMS=1000&directConnection=false
      

      Will attempt to do SRV and TXT lookup on _mongodb._tcp.server.mongodb.com. This gave a strange error, looking like it was applying malformed text to the URI's options. When debugging it seems that the CNAME records returned were being applied as SRV / TXT records. Even querying with dig shows that CNAME records are returned when SRV / TXT is requested:

      $ dig -t txt _mongodb._tcp.server.mongodb.com
      ...
      ;; ANSWER SECTION:
      _mongodb._tcp.server.mongodb.com. 3600 IN CNAME	glb.mongodb.com.
      ...
      

      This may be a misconfigured DNS server, but we should handle that gracefully. Let's apply the same fix of CDRIVER-2789 to the libresolv implementation of seedlist discovery and filter out non matching records.

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: