ssbc / patchbay

An alternative Secure Scuttlebutt client interface that is fully compatible with Patchwork
http://www.scuttlebutt.nz
386 stars 78 forks source link

Patchbay broadcasts to the whole internet instead of the local network #403

Open AlexYst opened 1 year ago

AlexYst commented 1 year ago

I'm not sure if this happens on IPv6, as my test networks have all been IPv4.

Anyway, Patchbay seems to send out its peer-announcement packets to 255.255.255.255, which is the broadcast address for the entire Internet instead of using the broadcast addresses for the local network (10.255.255.255 if on a 10.0.0.0/8 network, 172.31.255.255 if on a 172.16.0.0/12 network, or 192.168.255.255 if on a 192.168.0.0/16 network).

Obviously, this should be corrected just for correctness sake, but in addition to that, it causes problems with some firewall configurations. For example, my firewall is set to block all out-of-LAN traffic and allow only traffic to the local LAN and loopback addresses. As Patchbay is only trying to announce itself to peers on the local LAN, it should work without issue on such a configuration, but because Patchbay is announcing itself to the entire Internet instead of just the LAN, its packets get rejected by my firewall before they have a chance to make it to nearby peers.