andyleap / go-ssb

GNU General Public License v3.0
42 stars 13 forks source link

Do not connect to self #3

Open kseistrup opened 7 years ago

kseistrup commented 7 years ago

Every now and then sbot will attempt to connect to itself — and succeed:

$ sudo netstat -anp | grep 'fcbb:16a3:2050'
tcp6  4122579 2487632 fcbb:16a3:2050:a06:8008 fcbb:16a3:2050:a0:57170 ESTABLISHED 15011/./sbot

Sbot should probably learn all of its own IP addresses and then ignore all $theaddress:$myport:$mypubkey triplets (incoming and outgoing). It will not be sufficient to ignore the pubkey or the IP addresses, since people may run several instances of sbot with the same key — either on separate device or on the same devices with another port.