On Mon, 15 Dec 2025 14:07:07 GMT, Matthias Baesken <[email protected]> wrote:

>> Looks like to get into the else case starting at line 284 or before the 
>> patch like 282 ,  ipv6_available() / ipv6av can be false ; or also the 
>> second part of the if check can be false  
>> 
>> !(family == java_net_InetAddress_IPv4 &&  v4MappedAddress == JNI_FALSE))
>> 
>> so we should distinguish the 2 cases. Not sure if this really happens, on 
>> our system showing the error we got the other one `Caused by: 
>> java.net.SocketException: Protocol family ipv6, ipv6 on machine unavailable`
>
> Or just  write the old message `"Protocol family unavailable" ` for this case 
> and enhance the else case ?

Looking more at the checks,  I think we can always use the exception 
`JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", "Protocol family ipv6, 
ipv6 on machine unavailable");`
without the if and else. At least as long as the other if checks do not change. 
Do you agree?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28825#discussion_r2619948700

Reply via email to