adoptium / adoptium/adoptium-support
DatagramSocket.getLocalAddress() is not returning the local address on Mac OS
- Dominant language
- No language data
- Stars
- 59
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Description
### Please provide a brief summary of the bug
Tested in 1.8.0_272/25.272-b10 and 1.8.0_322/25.322-b06 on Mac OS, use DatagramSocket to open a remote connection and then query the address of the local side of the connection. Seems to work well on Windows and Linux, but returns a zero address on Mac OS.
### Please provide steps to reproduce where possible
Test code to reproduce: [https://github.com/cowtowncoder/java-uuid-generator/blob/master/src/main/java/test/EgressDiagnostics.java](https://github.com/cowtowncoder/java-uuid-generator/blob/master/src/main/java/test/EgressDiagnostics.java)
### Expected Results
Local address of the connection is returned, as it is on Windows: [https://github.com/cowtowncoder/java-uuid-generator/pull/56#issuecomment-1214415012](https://github.com/cowtowncoder/java-uuid-generator/pull/56#issuecomment-1214415012)
### Actual Results
On Mac OS, the local address is reported as zeroes: [https://github.com/cowtowncoder/java-uuid-generator/pull/56#issuecomment-1214489004](https://github.com/cowtowncoder/java-uuid-generator/pull/56#issuecomment-1214489004)
### What Java Version are you using?
1.8.0_322-b06
### What is your operating system and platform?
java.runtime.version: 1.8.0_322-b06
java.vm.name: OpenJDK 64-Bit Server VM
java.vm.vendor: Temurin
java.vm.version: 25.322-b06
os.arch: x86_64
os.name: Mac OS X
os.version: 10.15.7
### How did you install Java?
_No response_
### Did it work before?
_No response_
### Did you test with other Java versions?
_No response_
### Relevant log output
_No response_
Contributor guide
Research direction
Start by running the linked EgressDiagnostics.java reproduction on macOS with the reported Java version, then compare DatagramSocket.getLocalAddress() with the Windows result described in the issue. Trace the relevant Java networking implementation or upstream ownership to identify where the zero address is produced. Done means the local address is reported correctly for a connected datagram socket on macOS.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100