Closed dignifiedquire closed 1 year ago
Thanks for the report! What kernel is this?
I am not entirely sure: https://github.com/cross-rs/cross#supported-targets is the relevant docs. I believe this executes in Qemu.
Do you know what the minimum kernel version you actually intend to support is? We could just look up the status of IPV6_DONTFRAG
on whatever that is.
If indeed a kernel you need to support lacks that socket option, quinn_udp::may_fragment()
should be modified to return true
in that environment (perhaps by attempting it on a dummy socket) and we should skip the call. As it looks like you've already discovered, explicitly binding an IPv4 address in that environment is a good workaround.
An overview of that environment:
- Env: github actions runner
- OS: Ubuntu 22.04.02
- Kernel: 5.15.0-1037-azure
- Cargo/Rust: 1.69.0
- Lowest android kernel: 3.14.0
- Tested android kernel: 4.15 (I think)
Since this is like 5 layers deep with cross (docker) + qemu (android) + whatever android version combo it's a bit hard to track all of it down, but the min kernel version for the android stuff we want to run is 3.14.0. However this is a lot more complicated since there are no kernel version guarantees for any given android version running on a device, mostly just rule of thumb based on what the "core release" included.
Strange, IPV6_DONTFRAG
seems to be supported since at least 3.0: https://elixir.bootlin.com/linux/v3.0/source/net/ipv6/ipv6_sockglue.c#L802
What address was the socket that gave you that error bound to?
What address was the socket that gave you that error bound to?
https://doc.rust-lang.org/nightly/std/net/struct.Ipv6Addr.html#associatedconstant.LOCALHOST
I also tested setting all the flags except DONTFRAG
and then it works without any issues.
Thanks. I'm very confused by why that would fail, but I'd be happy to merge a mitigation as outlined above. If anyone's feeling especially motivated, it would be interesting to step through the kernel to work out where exactly that error comes from.
While I wrote the feature detection in https://github.com/flub/quinn/tree/flub/detect-ipv6-dontfrag I don't think this is helpful. While testing that out on cross aarch64-linux-android it seems this platform just doesn't support IPv6 at all, regardless of socket options it fails by the time you try and bind with AddrNotAvailable
.
So I suggest this can be closed safely (I seem to not have permissions to do so).
Thanks for the effort!
Weird, I thought we bound before setting any socket options? Anyway, thanks for investigating.
Weird, I thought we bound before setting any socket options? Anyway, thanks for investigating.
We are doing some unusual things where we make our own AsyncUdpSocket
which is backed by 3 different real sockets to enable us to do holepunching. So we're to blame ourselves for the weird order things happen in.
Currently running through some tests, and it looks like IPv6 is broken on my cross builds. I checked the flags and the offender is the
IPV6_DONTFRAG
, which results in