On Wed, 8 Nov 2023 14:37:29 GMT, Matthias Baesken <mbaes...@openjdk.org> wrote:
> In parseAllowedMask (file socketTransport.c) , prefixLen of mask is compared > with a maxValue (32 for IPv4, 128 otherwise). This fails on AIX if it is > larger than 32, because getaddrinfo seems to often (always ?) detect IPv4 > family, even for IPv6 addresses, so we take the wrong maxValue. > Probably we have to adjust the allowed maxValue on AIX, or adjust the IPv6 > check. > > Example: > images/jdk/bin/java > -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:0,allow=0:0:0:0:0:0:10:0/106 > Error in allow option: '106' > ERROR: transport error 103: invalid netmask in allow option > ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510) The fix looks wrong. The problem is not with parsing of the prefix len, but with parsing of the address itself (parseAllowedAddr function). Note that parseAllowedAddr converts returned IPv4 addresses to mapped IPv6 and in the example provided it won't be expected ::10:0, so the "allow" logic will be broken. I think the issue need some research on the affected systems: - if getaddrinfo returns AF_INET, then what is returned in ai_addr field? it must be valid IPv4 address (which can be used for connect()); - does getaddrinfo return a single address? (parseAllowedAddr assumes so, but maybe that's wrong in the case) ------------- PR Comment: https://git.openjdk.org/jdk/pull/16561#issuecomment-1802741222