Skip to content
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

libc::sendmmsg is not available on old Android phones #1503

Closed
link2xt opened this issue Mar 3, 2023 · 5 comments
Closed

libc::sendmmsg is not available on old Android phones #1503

link2xt opened this issue Mar 3, 2023 · 5 comments

Comments

@link2xt
Copy link
Contributor

link2xt commented Mar 3, 2023

sendmmsg was added in Linux 3.0 and recvmmsg was added in Linux 2.6.33 according to their man pages.

It is used in

let n = unsafe { libc::sendmmsg(io.as_raw_fd(), msgs.as_mut_ptr(), num_transmits as _, 0) };

@djc
Copy link
Member

djc commented Mar 3, 2023

Ugh, how old are these Android phones that you are targeting?

If it's not too much complexity, we're happy to take a PR to enable support on older kernels.

@link2xt
Copy link
Contributor Author

link2xt commented Mar 3, 2023

Ugh, how old are these Android phones that you are targeting?

We support Android API 16, so the oldest phones are roughly 10 years old.

I have created a PR for sendmmsg: #1504

@Ralith
Copy link
Collaborator

Ralith commented Mar 14, 2023

Fixed by #1504.

@Ralith Ralith closed this as completed Mar 14, 2023
@mxinden
Copy link
Contributor

mxinden commented Aug 13, 2024

I wonder whether the patch merged via #1504 is worth the trouble it is causing. In other words, I would like to discuss switching back to calling libc::recvmmsg instead of libc::syscall(libc::SYS_recvmmsg.

  • On Android x86 calling libc::syscall(libc::SYS_recvmmsg instead of libc::recvmmsg leads to a SECCOMP panic. See fix(udp): use libc::recvmmsg on Android x86 #1964.
  • At this point Android API Level 16 is 12 years old. Are there any known use-cases running quinn on such old devices? With the security concerns alone, I don't see a use-case outside a completely isolated environment.
  • Android 4 (up to API Level 20) has been end-of-life'd 01 Oct 2017. Should quinn support an OS that has been unsupported for 7 years?

//CC @link2xt, @flub and @dignifiedquire (since you have been active on deltachat/deltachat-core-rust#4007)

@link2xt
Copy link
Contributor Author

link2xt commented Aug 13, 2024

Feel free to drop Android 4 support and bump API level to 21 (Android 5.0) if supporting it is too much trouble. This is what tokio did already and we already bump to API level 19 in deltachat/deltachat-android#3215
Slightly better if you can support Android 4.4 (API level 19), but not a big deal if it is bumped to API level 21.

As for real use cases, Delta Chat has at least a few hundred Android 4 users according to Google Play statistics.

mxinden added a commit to mxinden/quinn that referenced this issue Aug 14, 2024
This reverts commit e6f1844.

e6f1844 called `sendmmsg` and `recvmmsg` through `libc::syscall` instead of
`libc::sendmmsg` and `libc::recvmmsg`, thus preventing linking issues on old
Android systems where `libc::sendmmsg` and `libc::recvmmsg` isn't available.

In quinn-rs#1503 (comment) the
decision was made to no longer support these old Android systems (API level 16).

This commit reverts e6f1844. Given that `sendmmsg` support was previously
dropped in ee08826, only the `recvmmsg` calls are reverted.
mxinden added a commit to mxinden/quinn that referenced this issue Aug 14, 2024
This reverts commit e6f1844.

e6f1844 called `sendmmsg` and `recvmmsg` through `libc::syscall` instead of
`libc::sendmmsg` and `libc::recvmmsg`, thus preventing linking issues on old
Android systems where `libc::sendmmsg` and `libc::recvmmsg` isn't available.

In quinn-rs#1503 (comment) the
decision was made to no longer support these old Android systems (API level 16).

This commit reverts e6f1844. Given that `sendmmsg` support was previously
dropped in ee08826, only the `recvmmsg` calls are reverted.
mxinden added a commit to mxinden/quinn that referenced this issue Aug 19, 2024
This reverts commit e6f1844.

e6f1844 called `sendmmsg` and `recvmmsg` through `libc::syscall` instead of
`libc::sendmmsg` and `libc::recvmmsg`, thus preventing linking issues on old
Android systems where `libc::sendmmsg` and `libc::recvmmsg` isn't available.

In quinn-rs#1503 (comment) the
decision was made to no longer support these old Android systems (API level 16).

This commit reverts e6f1844. Given that `sendmmsg` support was previously
dropped in ee08826, only the `recvmmsg` calls are reverted.
mxinden added a commit to mxinden/quinn that referenced this issue Sep 2, 2024
This reverts commit e6f1844.

e6f1844 called `sendmmsg` and `recvmmsg` through `libc::syscall` instead of
`libc::sendmmsg` and `libc::recvmmsg`, thus preventing linking issues on old
Android systems where `libc::sendmmsg` and `libc::recvmmsg` isn't available.

In quinn-rs#1503 (comment) the
decision was made to no longer support these old Android systems (API level 16).

This commit reverts e6f1844. Given that `sendmmsg` support was previously
dropped in ee08826, only the `recvmmsg` calls are reverted.
github-merge-queue bot pushed a commit that referenced this issue Sep 3, 2024
This reverts commit e6f1844.

e6f1844 called `sendmmsg` and `recvmmsg` through `libc::syscall` instead of
`libc::sendmmsg` and `libc::recvmmsg`, thus preventing linking issues on old
Android systems where `libc::sendmmsg` and `libc::recvmmsg` isn't available.

In #1503 (comment) the
decision was made to no longer support these old Android systems (API level 16).

This commit reverts e6f1844. Given that `sendmmsg` support was previously
dropped in ee08826, only the `recvmmsg` calls are reverted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants