-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
x/mobile: Calling net.Listen fails on Android 11+ #68082
Comments
The error comes from https://github.com/torvalds/linux/blob/e5b3efbe1ab1793bb49ae07d56d0973267e65112/net/ipv6/af_inet6.c#L364 In my code, I specified the zone name, and go needs to obtain the corresponding relationship between zone name and zone index from Line 217 in 4f77a83
but because there is a problem when go calls interfaceTable on the Android side #40569, go fails when doing zone name -> zone index mapping, so in order to pass a valid zone id to the socket I fixed this problem in anet: wlynxg/anet@a8525cb |
It might be possible to commit these changes to the standard library. |
This is difficult in some ways because the changes are tied to the Android version. |
How to get zone id ? I noticed that Android works with scope id for link local addresses not with zone name: |
@vikulin The zone id is actually the index of the interface Line 43 in 9d33956
In fact, when passing the zone id, you can choose the name Line 263 in 9d33956
Line 267 in 9d33956
|
@wlynxg I'm not sure that zone id is what I'm looking for. Obviously zone id = 46 is not the index since the Android device never had so many interfaces. Linux devices return interface names - this is where the difference. Code is expecting interface name but getting scope id.
returns
|
'github.com/wlynxg/anet' is a partial alternative implementation of the 'golang.org/x/net' module. The goal of 'anet' module is to provide workarounds of the issues golang/go#40569 and golang/go#68082 on Android 11+.
'github.com/wlynxg/anet' is a partial alternative implementation of the 'golang.org/x/net' module. The goal of 'anet' module is to provide workarounds of the issues golang/go#40569 and golang/go#68082 on Android 11+.
This solution is bases on https://github.com/wlynxg/anet project. `github.com/wlynxg/anet` is a partial alternative implementation of the `golang.org/x/net` module. The goal of `anet` module is to provide workarounds of the issues golang/go#40569 and golang/go#68082 on Android 11+. Tested on AOSP 13. Resolves: #1149
Go version
go version go1.20.11 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
What did you see happen?
What did you expect to see?
listen success
The text was updated successfully, but these errors were encountered: