-
Notifications
You must be signed in to change notification settings - Fork 5.8k
JDK-8319382: com/sun/jdi/JdwpAllowTest.java shows failures on AIX if prefixLen of mask is larger than 32 in IPv6 case #16561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👋 Welcome back mbaesken! A progress list of the required criteria for merging this PR into |
// on AIX we might get IPv6 detected (by getaddrinfo) as IPv4, | ||
// so the default maxValue does not always work | ||
#if defined(_AIX) | ||
maxValue = 128; | ||
#endif | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC, this code would work for any port, but is only required for AIX. And since it is a hack to work around an AIX issue, you didn't want to subject all ports to it. The downside of this change is that it will cause the option parsing code to not properly produce an error if an IPv4 mask prefix between 32 and 128 is given.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The downside of this change is that it will cause the option parsing code to not properly produce an error if an IPv4 mask prefix between 32 and 128 is given.
Yes this is true; maybe we should not unconditionally increase the maxValue on AIX .
The fix looks wrong.
|
From what I see on AIX, only one entry is returned in the results struct of the getaddrinfo call. |
A colleague contacted IBM about the different behavior of getaddrinfo on AIX (compared to Linux/macOS); maybe we have to adjust the result of the getaddrinfo call on AIX. |
@MBaesken This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
Haven't heard from them so far, hopefully we get an update soon about the behavior of getaddrinfo on AIX . |
@MBaesken Just a thought: parseAllowedAddr() needs to parse only numeric addresses. getaddrinfo was used to handle both IPv4 and IPv6 by a single call, but maybe it would be better to reimplement parseAllowedAddr to do 2 inet_pton calls (for AF_INET and AF_INET6) |
Hi Alex, this seems to work (for AIX, and also for the other OpenJDK platforms) . |
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)
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/16561/head:pull/16561
$ git checkout pull/16561
Update a local copy of the PR:
$ git checkout pull/16561
$ git pull https://git.openjdk.org/jdk.git pull/16561/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 16561
View PR using the GUI difftool:
$ git pr show -t 16561
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/16561.diff
Webrev
Link to Webrev Comment