Skip to content

Specify port when trying to determine egress interface. #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ UUID anotherUuid = gen.generate();
If your machine has a standard IP networking setup, the `Generators.egressTimeBasedGenerator` (added in JUG 4.1)
factory method will try to determine which network interface corresponds to the default route for
all outgoing network traffic, and use that for creating a time based generator.
This is likely a good choice for common usage scenarios if you want a version 1 UUID generator:
This is likely a good choice for common usage scenarios if you want a version 1 UUID generator, but unfortunately
is known not to work reliably on some platforms.

```java
TimeBasedGenerator gen = Generators.egressTimeBasedGenerator();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/fasterxml/uuid/EthernetAddress.java
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ public static EthernetAddress fromEgressInterface()
String roots = "abcdefghijklm";
int index = new Random().nextInt(roots.length());
String name = roots.charAt(index) + ".root-servers.net";
InetSocketAddress externalAddress = new InetSocketAddress(name, 0);
InetSocketAddress externalAddress = new InetSocketAddress(name, 53);
if (externalAddress.isUnresolved()) {
externalAddress = new InetSocketAddress("1.1.1.1", 0);
}
Expand Down