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
connect: On linux, enable reporting of all ICMP errors on UDP sockets #6341
Conversation
Are there any particular situations when this helps curl users? It seems like a good thing to me but I'm also curious since I can't recall anyone ever missing these errors in the past... |
When there are network errors, yes, it will help, applications will fail immediately rather than hang or wait for timeout. You have to simulate flaky network like for example what is described on the equivalent glibc bug report https://sourceware.org/bugzilla/show_bug.cgi?id=24047 |
Just some
|
Huh.. yeah, would ned to fix that.. |
60c7a49
to
261e408
Compare
That should pass.. |
It fails on macOS:
|
..and I can't declare it within the #if because of strict iso C..ok.. will fix that too. |
You can move the declaration to be within the if block, right? |
Yes, but then in other target there will be a complain that "ISO C90 forbids mixed declarations and code" and will fail too 💥 |
Why? C89/C90 says variable declarations can be in the beginning of any block (that starts with a |
The linux kernel does not report all ICMP errors back to userspace due to historical reasons. IP*_RECVERR sockopt must be turned on to have the correct behaviour which is to pass all ICMP errors to userspace. See https://bugzilla.kernel.org/show_bug.cgi?id=202355
261e408
to
9123ee4
Compare
Yeah, I ammended the commit now. |
Thanks! |
The linux kernel does not report all ICMP errors back to userspace
due to historical reasons.
IP*_RECVERR sockopt must be turned on to have the correct behaviour
which is to pass all ICMP errors to userspace.
See
https://bugzilla.kernel.org/show_bug.cgi?id=202355<
PS: You almost certainly want this option to be set in your DNS resolver too (ares, or whatever, glibc was already fixed)