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

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

    XMLWordPrintable

    Details

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

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              kevin.albertson Kevin Albertson
              Reporter:
              kevin.albertson Kevin Albertson
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: