-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix multicast address #8612
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
base: develop
Are you sure you want to change the base?
Fix multicast address #8612
Conversation
|
It "works" but this is very break everything and see if anyone cares kind of approach. I think a better solution is to instantiate two Edit: should be <10 SLOC change (make the IP an argument to |
|
Would that solution mean just sending all the udp packets to two multicast addresses, the old and new one, |
|
This is exactly what I have in mind 🙂 |
|
Well after looking at the code including How would that sound? I can make a PR suggestion of this approach. Edit: I realized I did not check how the udp receiving side is arranged. With repeating the udp.listenMulticast() call we would get everything as doubled on the receiving side, sigh. What would be best approach for receiving? For now on, use the old udp address for receiving, and "halfway" into old address deprecation, move on and only listen for the new address? And then finally, remove the deprecated sender address also? |
|
You will need a second listener too. It seems weird to me to do it here but I doubt I care. |
|
If the code starts to send multicast to addresses a+b and also the receiving side would be listening to a+b and both nodes are running the new firmware, every packet would be received as duplicated. One stupid "workaround" might be to first listen for both addresses and after first packet is seen on either address, Another option would be making the multicast address configurable and optional. The current default would be the old address naturally, but could be changed. Probably that would be way too much hassle to introduce something new to be configured, idk. |
You can give duplicated packets to the router and it will handle them.
We don't want that, it is not gonna help us transition since unless you restart all your nodes with the new code they are still all gonna use the old multicast address. But turns out the router already implement this logic so ... I would try letting both listeners callback into the router with the same packets and letting it dedup. |
|
Okay, if it is not harmful to send duplicates (other than that statistics get distorted?), On the sending side, just send the packet once for each destination address. If that is yes, then this should work? develop...sjm42:meshtastic-firmware:multicast-fix-take2 edit: oh, and also I am assuming that the |
On linux I wrote the code so it should work.
It would be beyond insane if writeTo mutate the passed-in buffer. |
|
Well if my proposed changes make sense, I would make a new pull request or what? :) |
|
@sjm42 usually you would force push this branch to avoid sending more notifications to people watching this repo but both work. |
Fixes #7674
🤝 Attestations