[CDRIVER-3628] Non TXT/SRV records returned by res_nsearch are not filtered out Created: 16/Apr/20  Updated: 28/Oct/23  Resolved: 07/May/20

Status: Closed
Project: C Driver
Component/s: network, uri
Affects Version/s: None
Fix Version/s: 1.17.0-beta2, 1.17.0

Type: Bug Priority: Major - P3
Reporter: Kevin Albertson Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CDRIVER-2789 Occasional crash with mongodb+srv URI... Closed

 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.



 Comments   
Comment by Githook User [ 25/May/20 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CDRIVER-3614 fix SRV polling

Comment by Githook User [ 06/May/20 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CDRIVER-3614 fix SRV polling

Generated at Wed Feb 07 21:18:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.