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
8270553: Tests should not use (real, in-use, routable) 1.1.1.1 as dummy IP value #4806
Conversation
|
I had to read up if this would work, and I am somewhat convinced it would. IANA Database mentions these addresses are Reserved-by-Protocol, and refers to RFC 1112, Section 4 which mentions these are reserved for future addressing modes.
But this rabbit hole excursion makes me think it would be better to just use the local loopback in these tests.
The test already attempts to connect to a server on the loopback address with setup that leads to the "no suitable proxy" scenario. I suspect the proposed patch is okay but I'd prefer to wait until @dfuch is back (Daniel has been doing a lot of work on test stability in this area and will probably want to run the change on a wide range of OS/configurations to check that it is stable). |
Thanks for suggesting a replacement for the 1.1.1.1 address Jonathan! I have run your patch through our test system and not observed any errors caused by this patch - so from my perspective you're good to go. Could you please add a comment before the line where the |
LGTM. Thanks for adding the comment Jonathan! If you integrate I will sponsor this.
(PS: I hadn't notice your changes because you used force-push - instead of merge - and the update sent by github let me believe the commit was a merge commit - apologies for the delay)
@jmtd This change now passes all automated pre-integration checks. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 358 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@shipilev, @dfuch) but any other Committer may sponsor as well.
|
Hi Jonathan, this should be ready to integrate so please enter /integrate in a new comment and then it can be sponsored. |
/integrate |
@dfuch thanks for the prompt and sorry for the delay! |
/sponsor |
Going to push as commit 394ebc8.
Your commit was automatically rebased without conflicts. |
The tests
test/jdk/java/net/HttpURLConnection/HttpURLConWithProxy.java
uses the IP address "1.1.1.1" as a value. I think at the time the address was picked, the assumption was the address was not valid / not routable. Since April 2018 the address is part of CloudFlare's "Free" DNS product: https://en.wikipedia.org/wiki/1.1.1.1. (this test was originally written in 2016, before the service was launched)I've verified using local packet captures that running the test does result in IP traffic being sent to 1.1.1.1. (Several other tests in JDK use 1.1.1.1 as a placeholder IP. I've checked them all and none of the others connect out to the IP like this one)
This PR substitutes that IP address value (and two others) for ones from a reserved IP range (240.0.0.0/4 according to RFC 6761) which will not result in runners of the test suit inadvertently sending IP packets to the CloudFlare service.
This could be invalidated again if that address range is allocated at some point in the future. A more future-proof fix would be to bind to random ports on localhost for each dummy proxy (as done for the target HTTP server in the test already). I can do that if preferred.
https://bugs.openjdk.java.net/browse/JDK-8270553
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4806/head:pull/4806
$ git checkout pull/4806
Update a local copy of the PR:
$ git checkout pull/4806
$ git pull https://git.openjdk.java.net/jdk pull/4806/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 4806
View PR using the GUI difftool:
$ git pr show -t 4806
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4806.diff