<div dir="ltr">Thanks, @Alan and <a class="gmail_plusreply" id="plusReplyChip-1">@Jaikiran :)</a><div><a class="gmail_plusreply"><br></a></div><div>I'll set myself up to submit a patch and reply to this chain once one is ready for review.</div><div><br></div><div>Bruno<br><a class="gmail_plusreply"><br></a></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 7, 2023 at 6:18 AM Jaikiran Pai <<a href="mailto:jai.forums2013@gmail.com">jai.forums2013@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello Bruno,<br>
<br>
Alan has created the JBS issue to track this. In order to submit a <br>
patch, you can follow the guidelines that are available at <br>
<a href="https://openjdk.org/guide/" rel="noreferrer" target="_blank">https://openjdk.org/guide/</a><br>
<br>
-Jaikiran<br>
<br>
On 07/06/23 3:20 pm, Alan Bateman wrote:<br>
> On 07/06/2023 07:17, Bruno Da Silva wrote:<br>
>> Hi all,<br>
>><br>
>> Random SWE here. I've found a bug in the LinuxSocketOptions.c native <br>
>> implementation of getting/setting quickack on a socket. When running <br>
>> strace, the socket option that is set is actually changing the <br>
>> SO_PRIORITY.<br>
>><br>
>> This is because the syscall is incorrectly called with <br>
>> level=SO_SOCKET rather than level=SOL_TCP. You can see this in the <br>
>> openjdk implementation on line 92 and 105:<br>
>> <a href="https://github.com/openjdk/jdk/blob/a08c5cb3f1be7a20c8f955951d1605bb8b1c1aa4/src/jdk.net/linux/native/libextnet/LinuxSocketOptions.c#L92" rel="noreferrer" target="_blank">https://github.com/openjdk/jdk/blob/a08c5cb3f1be7a20c8f955951d1605bb8b1c1aa4/src/jdk.net/linux/native/libextnet/LinuxSocketOptions.c#L92</a>. <br>
>> It has existed since the original implementation in JDK-8145635.<br>
>><br>
>> I believe the fix is to change both get/set syscalls like this:<br>
>> setsockopt(fd, SOL_SOCKET, TCP_QUICKACK, &optval, sizeof (optval));<br>
>> to<br>
>> setsockopt(fd, SOL_TCP, TCP_QUICKACK, &optval, sizeof (optval));<br>
>><br>
>> The bug has existed since JDK 10 and I see it still exists in the <br>
>> most recent versions of Java. It was found and tested in JDK 11.<br>
>><br>
>><br>
>> As a non-contributor, I don't know of a way of submitting a patch or <br>
>> directly reporting this bug. Can someone provide guidance on where to <br>
>> take it from here?<br>
>><br>
> Good find, I've created JDK-8309591 [1] to track it. Create a PR if <br>
> you want to run with this, otherwise someone else will need to pick <br>
> this up.<br>
><br>
> -Alan<br>
><br>
> [1] <a href="https://bugs.openjdk.org/browse/JDK-8309591" rel="noreferrer" target="_blank">https://bugs.openjdk.org/browse/JDK-8309591</a><br>
</blockquote></div>