-
-
Notifications
You must be signed in to change notification settings - Fork 484
feat(ip_recverr): ADD IP_RECVERR and IPV6_RECVERR support for linux #2421
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
base: main
Are you sure you want to change the base?
Conversation
0643a90
to
5338a62
Compare
5338a62
to
aa6bf63
Compare
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.
Good work. I will take a more in-depth look.
hdr.msg_control = control.0.as_mut_ptr() as *mut _; | ||
hdr.msg_controllen = control.0.len() as _; | ||
|
||
let ret = unsafe { libc::recvmsg(fd, &mut hdr, libc::MSG_ERRQUEUE) }; |
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 wonder what performance impact this additional sys call has. Would you mind running the benchmark suite with and without and post the results here?
https://github.com/quinn-rs/quinn/blob/main/quinn-udp/benches/throughput.rs
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.
Even if it has low overhead, I think it might be better to add a new function to the socket, called something like: recv_icmp_errors
.
That means users who don't care about this functionality don't need to pay its cost, plus it will allow us to return a strongly-typed struct like IcmpError
from this function without having to change existing APIs.
Returning ICMP messages as errors from recv
seems a bit odd to me because it is not the recv
call that is failing.
On Linux, enables
IP_RECVERR
andIPV6_RECVERR
socket optionsThis allows the socket to receive ICMP errors via the error queue, enabling faster detection of network unreachability instead of waiting for connection timeouts.
Features Implemented
Closes #2052