BUG: Additional Reserved IP addresses
kfo2010 opened this issue · 2 comments
Code:
$bad_peers=array("127.0.0.1","localhost","10.0.0","192.168.0");
Fix:
Needs to be expanded to cover at least...
127., 10., 172.16.0.0 to 172.31.255.255, 192.168.*
I was able to get peers to pickup 127.0.0.2 as the hostname with many failures.
For full reserved list see see wiki: https://en.wikipedia.org/wiki/Reserved_IP_addresses
How I discovered this:
At some point in beginning after install if i run $ curl http://127.0.0.2/ to load schema in config it had saved hostname in "config" table as 127.0.0.2 instead of my server ip address. Then block updates fail since peers are trying to connect to 127.0.0.2 instead of my ip/hostname (might have been a typo in my code initially but it accepted 127.0.0.2 as localhost so bug is valid). I should be able to run $ curl http://127.0.0.1/ to initiate schema (NOTE: after second look i think 127.0.0.1 works OK but 127.0.0.2 or any 127.0.0.* causes failure since its not in $bad_peers. Peers pick up the bad address and cause flood of fails)
Additional Thoughts:
Also what if someone creates a local host file and points their domain to their server then loads site this way the first time. Seems like it would make them an invalid peer as well since hostname wont resolve (node operator error but still).
Also what happens if someone loads initial page through a cache layer or proxy? Like maybe cloudflare or something. What IP address does it pick up?
@KyleFromOhio, I agree with these points.
Implemented in the 0.4 release