Closed KirillSto closed 1 year ago
Thanks for the report! There doesn't seem much we can do to fix it in the pure Go side. The linked tailscale-android PR shows changes to both Go and Java code.
However if you want to submit a patch that checks the error and avoids retrying for this error case, that would be a welcome change.
About
I see SELinux spamming
type=1400 audit(0.0:1227): avc: denied { bind } for scontext=u:r:untrusted_app:s0:c148,c256,c512,c768 tcontext=u:r:untrusted_app:s0:c148,c256,c512,c768 tclass=netlink_route_socket permissive=0 bug=b/155595000 app=com.anytypeio.anytype.debug
error message in our application.Details
We are developing Go-based application that uses libp2p to sync data in IPFS. Application has Android interface, so Go-package is being packed in Android archieve .aar and transferred as static library to Android application.
While running our app on Emulator in Logcat interface of Android Studio we see warning messages
type=1400 audit(0.0:1227): avc: denied { bind } for scontext=u:r:untrusted_app:s0:c148,c256,c512,c768 tcontext=u:r:untrusted_app:s0:c148,c256,c512,c768 tclass=netlink_route_socket permissive=0 bug=b/155595000 app=com.anytypeio.anytype.debug
appearing every 5 seconds and stating that some process is trying to get access to some addresses. 30+ version of Android SDK does not allow to gain such permisiions.Commenting out this code block has leaded to log spam vanishing: https://github.com/libp2p/go-libp2p/blob/master/p2p/host/basic/basic_host.go#L307-L327
Possible cause
Presumably netroute.New() call is the issue of OS warning as it is trying to get RIB data using syscall.NetlinkRIB call inside, which is a known issue: https://github.com/tailscale/tailscale-android/pull/21 and connected with changes to network information availability in Android 11+: https://developer.android.com/training/articles/user-data-ids#mac-11-plus
Pkg version Information (go list -m all)
System Information (go env)
Dev tools versions info