RFR: 8299593: getprotobyname should not be used
Alan Bateman
alanb at openjdk.org
Wed Jan 4 14:45:52 UTC 2023
On Wed, 4 Jan 2023 12:56:18 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:
> Please review this patch that removes the remaining uses of non-reentrant `getprotobyname` function.
>
> While the protocol number for TCP could theoretically be modified to something other than the default `IPPROTO_TCP`, that scenario would likely not work, and is not something that we are willing to support. [Existing code](https://github.com/openjdk/jdk/blob/2f3f3b618500b5f112fabca30d4c6780b2a8e723/src/java.base/unix/native/libnet/net_util_md.c#L355) in networking area is using `IPPROTO_TCP` for `TCP_NODELAY`, and no issues were reported.
>
> Tier 1-3 tests still pass.
Looks okay, should be no reason to use getprotobyname here. I assume everything would break if /etc/protocols were changed to set to another value.
-------------
PR: https://git.openjdk.org/jdk/pull/11842
More information about the serviceability-dev
mailing list