quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.76k stars 380 forks source link

Fallback to not using ECN if IP_TOS is not supported #1516

Closed link2xt closed 1 year ago

link2xt commented 1 year ago

On Linux <3.13 sendmsg/sendmmsg system calls return EINVAL without sending anything if they encounter an IP_TOS cmsg. To ensure we can still send on such systems, remember if we got an EINVAL error and switch to "fallback mode" in which we do not try to transmit ECN at all and only use well-supported features.

link2xt commented 1 year ago

This is an alternative to #1512

djc commented 1 year ago

Seems reasonable to me!

link2xt commented 1 year ago

I tested, it works on my Android with old kernel 3.10.108.

Ralith commented 1 year ago

Thanks!