You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of relying on network interface names we could check the IPv4 addresses against the default gateway's address.
For example:
The gateway's address is 123.123.123.0
Our system, in this example Windows, has (interface name + address):
"Ethernet 2": 234.234.234.234
"Ethernet 3": 123.123.123.123
If we would choose by name, "Ethernet 2" would match first and we would use that IP address in the URL suggestion, which is the wrong one.
If instead we would match the first three parts of the IP address against the first three parts of the gateway address, we would choose "Ethernet 3", which is the correct one.
Instead of relying on network interface names we could check the IPv4 addresses against the default gateway's address.
For example:
123.123.123.0
If we would choose by name, "Ethernet 2" would match first and we would use that IP address in the URL suggestion, which is the wrong one.
If instead we would match the first three parts of the IP address against the first three parts of the gateway address, we would choose "Ethernet 3", which is the correct one.
This requires determining the gateway's IP address, which is not possible with Go's stdlib. But this package seems to be perfect: https://github.com/jackpal/gateway
The text was updated successfully, but these errors were encountered: