-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
set the don't fragment (DF) bit on Windows #3155
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3155 +/- ##
==========================================
- Coverage 85.41% 85.36% -0.05%
==========================================
Files 131 131
Lines 9698 9710 +12
==========================================
+ Hits 8283 8288 +5
- Misses 1045 1049 +4
- Partials 370 373 +3
Continue to review full report at Codecov.
|
Is there any way we can test this? I realize testing that DF is actually set might be difficult, but at least we should be able to pass a net.UDPConn to newConn and make sure it doesn’t return an error. |
Not sure what happened to the failed test here but it doesn't look related to my changes |
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.
I haven't checked Wireshark to see if the DF bit is actually set. @tobyxdd, have you?
Yes I did |
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.
Thank you @tobyxdd!
@tobyxdd Have you checked if this also works on IPv6? I was just working on an equivalent PR for OSX, and it looks like there are different syscalls for IPv4 and IPv6. |
Or am I misunderstanding something here? IPv6 shouldn't allow any packet fragmentation anyway, but then why is there a |
Just realized that IPv6 does have fragmentation (as an extension header), but only at the source, not routers. https://en.wikipedia.org/wiki/IPv6_packet#Fragment |
So yes I guess we do need to set DF for IPv6 as well (or get local MTU from the system?) |
I'm not sure. It depends on what happens when we try to send a too large packet. We'd need some way to feed that information back into the MTU discovery code. Getting the local MTU from the system and initializing the MTU discoverer with that seems like the safer option, but I'm not sure it's needed in practice, as our maximum packet size is below 1500 bytes anyway. |
No description provided.