Skip to content
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

8284890: Support for Do not fragment IP socket options #8245

Closed
wants to merge 30 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
7cc694a
throwaway prototype
Michael-Mc-Mahon Mar 30, 2022
542a403
linux support
Michael-Mc-Mahon Mar 30, 2022
cf28f8e
windows support
Michael-Mc-Mahon Apr 1, 2022
dd893d1
moved option to jdk.net
Michael-Mc-Mahon Apr 6, 2022
e4a797c
update
Michael-Mc-Mahon Apr 6, 2022
002f676
updates
Michael-Mc-Mahon Apr 6, 2022
bab7b3f
building on all platforms
Michael-Mc-Mahon Apr 6, 2022
026ef42
running on Macos
Michael-Mc-Mahon Apr 6, 2022
b59d7c1
running on Windows now
Michael-Mc-Mahon Apr 7, 2022
f8ed779
updates
Michael-Mc-Mahon Apr 8, 2022
71004a6
fixed windows issue with getsockopt
Michael-Mc-Mahon Apr 8, 2022
321f561
fixed test
Michael-Mc-Mahon Apr 8, 2022
9a50c79
Merge branch 'master' into mtu
Michael-Mc-Mahon Apr 11, 2022
3ebc1de
simplified test. Loosened spec
Michael-Mc-Mahon Apr 11, 2022
47c3992
updates
Michael-Mc-Mahon Apr 11, 2022
9b86592
test update
Michael-Mc-Mahon Apr 12, 2022
6a39da9
windows update
Michael-Mc-Mahon Apr 12, 2022
58db57e
windows issue
Michael-Mc-Mahon Apr 13, 2022
b26a29c
windows 2016 issue
Michael-Mc-Mahon Apr 14, 2022
a62ac1a
minor spec update
Michael-Mc-Mahon Apr 14, 2022
446dd6c
fix whitespace errors
Michael-Mc-Mahon Apr 15, 2022
14c776b
builds in github action now
Michael-Mc-Mahon Apr 15, 2022
a420ed0
Merge branch 'master' into mtu
Michael-Mc-Mahon Apr 19, 2022
5458aae
test update
Michael-Mc-Mahon Apr 19, 2022
e90aa7c
windows update
Michael-Mc-Mahon Apr 19, 2022
5f1d87e
updates
Michael-Mc-Mahon Apr 19, 2022
509c3f8
fix whitespace
Michael-Mc-Mahon Apr 19, 2022
1e08ee9
typo in windows native code
Michael-Mc-Mahon Apr 19, 2022
428a980
test update
Michael-Mc-Mahon Apr 20, 2022
e6b12eb
test update
Michael-Mc-Mahon Apr 20, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/jdk/jdk/net/ExtendedSocketOption/DontFragmentTest.java
Original file line number Diff line number Diff line change
@@ -44,11 +44,11 @@ public static void main(String[] args) throws IOException {
testDatagramChannel(args, fam);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't there be a testcase for when DatagramChannel is opened using the no arg factory method DatagramChannel.open()?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure there is value in testing all of these permutations. Distinguishing DatagramChannel and DatagramSocket probably made sense, but it's all the same implementation under the hood.

Copy link
Member

@dfuch dfuch Apr 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. DatagramChannel.open() => opens a dual socket unless -Djava.net.preferIPv4Stack=true, in which case it should be equivalent to DatagramChannel.open(StandardProtocolFamily.INET)
  2. DatagramChannel.open(StandardProtocolFamily.INET) => opens an IPv4 socket
  3. DatagramChannel.open(StandardProtocolFamily.INET6) => opens an IPv6 socket

So I believe it makes sense to test the no-arg constructor since that's the only way to open a dual socket.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mind adding it. Though, the no-arg constructor is the same as cases 2. or 3. depending on the value of the preferIPv4Stack property.

try (DatagramSocket c = new DatagramSocket()) {
testDatagramSocket(c);
}
}
try (DatagramChannel dc = DatagramChannel.open(fam)) {
var c = dc.socket();
testDatagramSocket(c);
}
}
testMulticastSocket();
}