On Wed, 10 Jan 2024 01:53:02 GMT, Alex Menkov <amen...@openjdk.org> wrote:

> The change fixes workaround introduced by 
> [[JDK-8250630]](https://bugs.openjdk.org/browse/JDK-8250630).
> The root cause of the test failure was identified by JDK-8250630:
> On Apline Linux getaddrinfo function returns 2 entries for "any" address - 
> mapped IPv4 (`::ffff:0.0.0.0`) and IPv6 (`::`) and IPv4 is returned first.
> When JDWP agent listens on mapped IPv4, it accepts only connections from IPv4 
> addresses, connections from IPv6 addresses fail with "connection refused" 
> error.
> Fix for JDK-8250630 introduced workaround for the case - if we get 
> `::ffff:0.0.0.0` (`mappedAny`) and `::` (`in6addr_any`) is also returned by 
> getaddrinfo, agent uses `in6addr_any` for listening.
> 
> But the fix had a typo - the loop goes through returned addresses (`ai` 
> variable), but checks if `listenAddr` equals `in6addr_any`. This is always 
> false (because `listenAddr` equals `mappedAny`), so the workaround does not 
> work.
> 
> Submitter confirmed that the fix resolves the issue.
> 
> Testing: tier1, all JDI-related tests 
> (test/hotspot/jtreg/vmTestbase/nsk/jdwp, 
> test/hotspot/jtreg/vmTestbase/nsk/jdi, test/hotspot/jtreg/vmTestbase/nsk/jdb, 
> test/jdk/com/sun/jdi)

Marked as reviewed by mbaesken (Reviewer).

-------------

PR Review: https://git.openjdk.org/jdk/pull/17334#pullrequestreview-1812629326

Reply via email to