icmp and raw sockets on linux

Alan Bateman Alan.Bateman at oracle.com
Sun Nov 29 16:33:43 UTC 2020


On 29/11/2020 14:54, Jamie Le Tual wrote:
> Although I've only just sent in the pdf form for an ora, I've already 
> submitted a pull request, https://github.com/openjdk/jdk/pull/1502 
> <https://urldefense.com/v3/__https://github.com/openjdk/jdk/pull/1502__;!!GqivPVa7Brio!JhGUqeElAhEy9M_c0xBiYFVZQXX0YeHTlOrypbtjph_VrhY7t4LmgPpmxNpSAwLCuA$> 
> wherein an attempt is first made to use an IPPROTO_ICMP socket before 
> falling back on RAW_SOCK and finally tcp echo.
>
> I suppose now I have to wait until I am able to open an issue in the 
> bug tracker so I can associate the pull request to it.
>
> Does anyone know what a unit test for this might look like? To cover 
> the use cases the code has to be invoked by both a privileged and 
> unprivileged user, and I'm not sure how to go about setting up a unit 
> test.

I've created JDK-8257235 [1] to track this. One thing to understand is 
whether there is an equivalent for IPPROTO_ICMPV6. Sorry, I can't look 
at the patch or comment in the PR until the bot confirms that you have 
signed the OCA.

Have you looked at the existing tests in test/jdk/java/net/InetAddress? 
It will be awkward to verify as the behaviour before/after will not be 
observable without looking at the network or system call trace.

-Alan

[1] https://bugs.openjdk.java.net/browse/JDK-8257235
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/net-dev/attachments/20201129/f839f605/attachment.htm>


More information about the net-dev mailing list