Closed Bug 1465072 Opened 3 years ago Closed 3 years ago

Force marionette::get_free_port() to use IPv4

Categories

(Testing :: geckodriver, enhancement)

enhancement
Not set
normal

Tracking

(firefox62 fixed)

RESOLVED FIXED
mozilla62
Tracking Status
firefox62 --- fixed

People

(Reporter: ato, Assigned: ato)

References

Details

Attachments

(1 file)

The marionette::get_free_port() function still uses localhost to
resolve a free port.  As a follow up to
https://bugzilla.mozilla.org/show_bug.cgi?id=1462040 we should
ensure it also consistently uses IPv4, otherwise we may end up
finding a free port on the IPv6 stack that Firefox cannot bind to.
Assignee: nobody → ato
Blocks: 1441204
Status: NEW → ASSIGNED
Depends on: 1462040
Comment on attachment 8981440 [details]
Bug 1465072 - Force IPv4 for marionette::get_free_port().

https://reviewboard.mozilla.org/r/247552/#review253602

::: testing/geckodriver/src/marionette.rs:1323
(Diff revision 1)
>          }
>      }
>  }
>  
>  fn get_free_port() -> IoResult<u16> {
> -    TcpListener::bind(&("localhost", 0))
> +    TcpListener::bind(&(DEFAULT_HOST, 0))

Hurray for using constants. Thanks for catching that!
Attachment #8981440 - Flags: review?(hskupin) → review+
Pushed by atolfsen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4ad07f3127fe
Force IPv4 for marionette::get_free_port(). r=whimboo
https://hg.mozilla.org/mozilla-central/rev/4ad07f3127fe
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
You need to log in before you can comment on or make changes to this bug.