-
Notifications
You must be signed in to change notification settings - Fork 17
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
IPv6 multicasting stopped to work in Android for [email protected] #6
Comments
Do you mean the public method to get the value of |
Correct. |
I suspect the |
You can call |
In other words speaking - "do it yourself". Anyway I will. |
@wlynxg I was suspecting the issue was caused by incorrect API Level values in |
What do you mean by IPv6 multicast stops working? package mobile
import (
"fmt"
"log"
"net"
"net/netip"
"github.com/wlynxg/anet"
)
func Run() {
allifaces, err := anet.Interfaces()
if err != nil {
log.Printf("get interfacess error: %s!\n", err)
}
for _, iface := range allifaces {
addrs, err := anet.InterfaceAddrsByInterface(&iface)
if err != nil {
log.Printf("get [%s] addrs error: %s\n", iface.Name, err)
} else {
log.Printf("success get [%s] addrs: %s\n", iface.Name, addrs)
}
for _, addr := range addrs {
parseAddr, err := netip.ParsePrefix(addr.String())
if err != nil {
continue
}
if parseAddr.Addr().Is4() || parseAddr.Addr().IsMulticast() {
continue
}
addr := fmt.Sprintf("[%s%%%s]:0", parseAddr.Addr().String(), iface.Name)
_, err = net.Listen("tcp", addr)
if err != nil {
log.Printf("listen %s error: %s\n", addr, err)
} else {
log.Printf("success listen %s!\n", addr)
}
}
}
} It works well on Android12 and Android14, and the running results are as follows: |
@vikulin Could you provide some minimal code (ideally the entire project) that reproduces the problem? I suspect the issue is not device-specific but rather depends on some context in which you call
@vikulin Do you mean this specific patch vikulin@99b8955 fixes the issue or is it the entire set of changes you made in that branch vikulin/anet@a79b5ca...99b8955 that fixes it? I'm asking because in vikulin/anet@a79b5ca...41ff359 (everything except the last commit) you basically disable I think that if caching is the problem, it may be worth to try checking the result of |
We can wait for him to provide an environment that can reproduce the problem and then consider how to solve it. |
@wlynxg Please learn what is "IPv6 Multicast". The code which was affected hasn't been debugged clearly but what I noticed in logs most probably socket write failed and did not send multicast beacon.
Yes, that's correct. |
Well, at least we know the problem isn't related to @vikulin do you have the
|
Yes, it does: |
I tried to build https://github.com/RiV-chain/crispa-android/tree/8f85b6303ae038815c19b7338cef3773f6653499 with https://github.com/RiV-chain/RiV-mesh/tree/23ab7e81764ed6bf18d88f9245986c7a14783476 and then ran it on my Android device (LinageOS 20 based on AOSP 13).
To confirm that the sending of multicast messages was not working, I tried to dump all incoming multicast packets using Wireshark from my laptop in the same network. And there were no incoming multicast messages. So I decided to switch back to https://github.com/wlynxg/anet/tree/v0.0.4 and retest
And I can see multicast messages from my phone in Wireshark. For some reason, the outcome is completely opposite to what @vikulin is experiencing. |
@bobrofon you ran incorrect Android client. Check this project out: |
The same result with CupLink. Multicasting works on my phone with https://github.com/wlynxg/anet/tree/v0.0.4 but with https://github.com/vikulin/anet/tree/99b8955b2cffbbff21367f7ecb17231aaa5dfe19 it doesn't (I see in Wireshark how my phone joins the multicast group but never sends anything). anet v0.0.4:
anet 99b8955:
@vikulin Which version of Android are you using? Can you show logcat from your device? |
@bobrofon Thank you for the debugging. I synced code (tag v0.4.7.16) with yggdrasil implementation for the multicasting related code where [email protected] is used. As result multicasting is not working and this is why I was updating link_tcp.go. I got following errors in Android CupLink client:
This is exactly what does yggdrasil in latest develop branch with anet lib update. Error occurs here: RiV-mesh: Yggdrasil: It seems like |
@bobrofon @wlynxg confirmed the issue in
![]() |
Can you provide your Android phone model and Android version number? |
Android 14, Pixel 7a |
@wlynxg I suppose the |
I have fixed the issue and my change isn't related to anet itself. Thanks All!. Closing the issue. |
See my comment here:
e684438#r145827457
The text was updated successfully, but these errors were encountered: