On Fri, 9 Oct 2026 11:51:38 GMT, Volkan Yazici <[email protected]> wrote:
>> Harald Eilertsen has updated the pull request incrementally with one
>> additional commit since the last revision:
>>
>> Remove unnecessary ignore
>
> Changes LGTM.
>
> 1. I've downloaded a [FreeBSD 15.1 VM image], and started a VM with that.
> 2. Created the following simple reproducer, `LingerRepro.java`:
> ```
> import java.net.InetAddress;
> import java.net.ServerSocket;
> import java.net.Socket;
>
> import static java.net.StandardSocketOptions.SO_LINGER;
>
> public final class LingerRepro {
> public static void main(String[] args) throws Exception {
> try (var server = new ServerSocket(0, 1,
> InetAddress.getLoopbackAddress());
> var client = new Socket(server.getInetAddress(),
> server.getLocalPort());
> var accepted = server.accept()) {
> try {
> var expected = 32809;
> accepted.setSoLinger(true, expected);
> var actual = accepted.getSoLinger();
> System.out.printf(
> "setSoLinger(%s); getSoLinger(): %s (%s)%n",
> expected, actual,
> actual == 32767 ? "OK" : "BAD");
> accepted.setOption(SO_LINGER, expected);
> actual = accepted.getOption(SO_LINGER);
> System.out.printf(
> "setOption(SO_LINGER, %s); getOption(SO_LINGER):
> %s (%s)%n",
> expected, actual,
> actual == 32767 ? "OK" : "BAD");
> } finally {
> accepted.setSoLinger(false, 0);
> }
> }
> }
> }
> ```
> 3. Did `pkg install openjdk27` and run `LingerRepro`:
> ```
> setSoLinger(32809); getSoLinger(): 32767 (OK)
> setOption(SO_LINGER, 32809); getOption(SO_LINGER): -32727 (BAD)
> ```
> 4. Downloaded `/usr/ports`, manually patched `/usr/ports/java/openjdk27` with
> the `net_util_md.c` fix, build the JDK image, and re-run `LingerRepro`:
> ```
> setSoLinger(32809); getSoLinger(): 32767 (OK)
> setOption(SO_LINGER, 32809); getOption(SO_LINGER): 32767 (OK)
> ```
>
> [FreeBSD 15.1 VM image]:
> https://download.freebsd.org/releases/VM-IMAGES/15.1-RELEASE/
@vy Thanks a lot for the very thorough code review!
-------------
PR Comment: https://git.openjdk.org/jdk/pull/33248#issuecomment-6082050310