[🐛 Bug]: FindFreePort method hardcoded for IPv4 causing failure for pure IPv6 environments #14910
Labels
C-dotnet
.NET Bindings
I-defect
Something is not working as intended
R-help wanted
Issues looking for contributions
What happened?
When running Selenium on a "pure IPv6" system where all IPv4 interfaces have been removed, the FindFreePort method, which is used to find a free TCP port to use on the loopback interface for communication to the browser driver, fails since it is hard coded for IPv4 and there are no IPv4 interfaces.
(https://github.com/SeleniumHQ/selenium/blob/trunk/dotnet/src/webdriver/Internal/PortUtilities.cs) Line 40
Socket portSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
AddressFamily.InterNetwork is IPv4. AddressFamily.InterNetworkV6 is IPv6.
In Pure IPv6 environment, attempt create the Browser Driver object fails with exception: "An address incompatible with the requested protocol was used"
How can we reproduce the issue?
Relevant log output
Operating System
Windows 2019
Selenium version
PowerShell
What are the browser(s) and version(s) where you see this issue?
Edge 131.0.2903.86
What are the browser driver(s) and version(s) where you see this issue?
Microsoft Edge WebDriver 131.0.2903.99 (f96a870b1316f430223b7df17df32918b222060e)
Are you using Selenium Grid?
No
The text was updated successfully, but these errors were encountered: