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

fix: permission denied appears on Android11+ #255

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wlynxg
Copy link

@wlynxg wlynxg commented Sep 29, 2024

@marten-seemann
Copy link
Contributor

Pulling in a fork of the net package seems like the worst way possible to solve the problem.

@wlynxg
Copy link
Author

wlynxg commented Sep 29, 2024

If go can merge pr, it would be the best way. However, due to the variability of Android versions, merging into the main branch seems very difficult.
Therefore, although using a third-party library to obtain the list of network card interfaces is not the best way, it has been the solution on the Android side for a long time.

@homier
Copy link

homier commented Sep 29, 2024

@marten-seemann for now it's the only way. Go maintainers do not really do anything about the issue, the PR is stuck for several months in a row without any progress, while a lot of folks can't use anything related to multiaddr on Android without compiling Go toolchain with patch.

fyi: pion-webrtc also took this approach with anet (pion/transport@3ba6182)

@gbraad
Copy link

gbraad commented Oct 1, 2024

I understand the sentiment of not wanting an abstraction layer to fix the issue, but without putting pressure on the upstream Golang issue, this will remain in this limbo.

@MarcoPolo
Copy link
Contributor

I don't love the solutions here.

Here's another solution I don't love, but maybe less bad than the others:

  1. Fork net ourselves (or vendor it with patches)
  2. Add a build tag to only include the fork on android builds.

@marten-seemann
Copy link
Contributor

InterfaceMultiaddrs is a helper function, which one could argue doesn't belong in this package in the first place, or at least take a []net.Addr as input. It should be absolutely trivial for users to copy-paste it. I don't see any reason whatsoever to pull in a 3rd-party dependency.

@Stebalien
Copy link
Member

IMO, the right solution is a package that exposes just a fixed InterfaceAddrs function. Overriding the entire net package is asking for trouble. That's also something that can be easily vendor.

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

Successfully merging this pull request may close these issues.

6 participants