Uploaded image for project: 'Rust Driver'
  1. Rust Driver
  2. RUST-255

Driver should not connect to ipv6 addresses on Windows by default

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 0.9.0-alpha
    • Affects Version/s: None
    • Component/s: None
    • None

      TheĀ Stream::connect method when connecting to a DNS name always chooses the first IP address to connect to. As a result, it may connect to IPv6 addresses even if user has not opted into IPv6 support. Since MongoDB does not listen to ipv6 by default, this will result in the rust driver failing to connect to mongod.

      This line https://github.com/10gen/mongo-rust-driver/blob/bb5ff52c0e4f14241f62b78612755498a57acf31/src/cmap/conn/stream.rs#L51 calls to_socket_addrs and uses the first address which may be ipv6. As a result of this, the tests fail if they use the default MONGODB_URI of "localhost:27017"

      I have validated that IPv6 addresses resolve first for "localhost" on my local Windows 10 machine and a Windows 2016 VM.

            Assignee:
            sam.rossi@mongodb.com Samuel Rossi (Inactive)
            Reporter:
            mark.benvenuto@mongodb.com Mark Benvenuto
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: