Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-508

phongo_stream_initiator() constructs invalid stream URI for IPv6 literal

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical - P2
    • Resolution: Fixed
    • 1.0.0
    • 1.1.0
    • None
    • None

    Description

      The stream initiator uses the following template for constructing both AF_INET6 and AF_INET connections:

      dsn_len = spprintf(&dsn, 0, "tcp://%s:%d", host->host, host->port);
      

      AF_INET6 requires us to enclose ipv6 literals in brackets (like the MongoDB URI):

      dsn_len = spprintf(&dsn, 0, "tcp://[%s]:%d", host->host, host->port);
      

      This jives with this note from stream_socket_client() in the PHP manual:

      When specifying a numerical IPv6 address (e.g. fe80::1), you must enclose the IP in square brackets—for example, tcp://[fe80::1]:80.

      Attachments

        Issue Links

          Activity

            People

              jmikola@mongodb.com Jeremy Mikola
              jmikola@mongodb.com Jeremy Mikola
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: