Open Bug 1770914 Opened 3 years ago Updated 3 years ago

geckodriver only listens on IPv4 by default and refuses connections via IPv6

Categories

(Testing :: geckodriver, defect, P3)

Default
defect

Tracking

(Not tracked)

People

(Reporter: whimboo, Unassigned)

Details

(Whiteboard: [webdriver:backlog])

Originally reported as: https://github.com/mozilla/geckodriver/issues/2017

It's not possible to have a IPv6 client connect to geckodriver when it was started on localhost. Reason it that it defaults then to 127.0.0.1 which is IPv4 only.

This can be reproduced with the following steps:

  1. Launch geckodriver: geckodriver --host localhost
  2. Use netcat to connect to geckodriver via IPv6: nc -vz ::1 4444

After step 1 you will see that geckodriver only listens on IPV4: Listening on 127.0.0.1:4444. As such no connection over IPv6 is possible.

It only works when I start geckodriver with --host "::1" but then it only allows connections via IPv6.

We may want to allow connections from all local interfaces when no host as IP but localhost was specified.

Note that this is identical to the behavior of our Remote Agent (WebDriver BiDi WebSocket) which is covered on bug 1769994.

Flags: needinfo?(james)

In server_address we actually prefer IPv4 when multiple IP addresses are assigned to the given host name and only return that one:
https://searchfox.org/mozilla-central/rev/1c391443f770eddc7cde9e52dba5ef50cc233c06/testing/geckodriver/src/main.rs#141-169

I assume what we want is basically the following given that we also make use of warp:
https://github.com/seanmonstar/warp/issues/628

Given that the user can most likely set how DNS resolution works on the machine the geckodriver --host argument could explicitly set to the IP address as needed if a dual-stack is present. As such we do not think it's a high priority for now.

Severity: -- → S3
Flags: needinfo?(james)
Priority: -- → P3
Whiteboard: [webdriver:backlog]
You need to log in before you can comment on or make changes to this bug.