markqvist / Reticulum

The cryptography-based networking stack for building unstoppable networks with LoRa, Packet Radio, WiFi and everything in between.
https://reticulum.network
MIT License
2k stars 124 forks source link

AutoInterface multicast scope bug #283

Closed blakangel closed 1 year ago

blakangel commented 1 year ago

I'm trying to get rnsd working on multiple vlan's using the IPv6 site local multicast scope. When setting discover_scope = site in rnsd config I get the following errors on both debian and ubuntu:

[2023-04-25 22:46:01] [Extra] AutoInterface[Default Interface] Selecting link-local address fe80::2a0:98ff:fe62:6863 for interface enp0s4 [2023-04-25 22:46:01] [Extra] AutoInterface[Default Interface] Creating multicast discovery listener on enp0s4 with address ff15:0:d70b:fb1c:16e4:5e39:485e:31e1 [2023-04-25 22:46:01] [Error] The interface "Default Interface" could not be created. Check your configuration file for errors! [2023-04-25 22:46:01] [Error] The contained exception was: [Errno -2] Name or service not known

After a bunch of research I tracked this down to the following line of code in AutoInterface.py: addr_info = socket.getaddrinfo(mcast_addr+"%"+ifname, self.discovery_port, socket.AF_INET6, socket.SOCK_DGRAM) For multicast scopes other than link local, you do not use the %ifname format. I removed that section and am able to join the site local group.

Sideband doesn't have a setting to change the discovery scope, though, so I can't test if it will connect through different vlans.

markqvist commented 1 year ago

Thanks for finding an diagnosing this! Fix incoming :)

markqvist commented 1 year ago

I just pushed a fix to the master branch. If you end up trying it out, I'd love to hear whether it is working as intended across your IPv6 site-wide discovery scope.